java.lang.NullPointerException

JIRA | Carlos Silva | 2 years ago
  1. 0

    We found a case where its not possible to create new variables (at least using the GUI) on a table where a variable was deleted. So to reproduce this: * Create one table using the attached csv * Delete the variable 'abc' * Create a new variable (name and type is irrelevant) * You will get a NPE. From now on you will always get this NPE for this table, so creating new variables is impossible. Here the stacktrace: {code} 69399283 [qtp1571615117-230] ERROR org.obiba.opal.web.magma.provider.UnhandledExceptionMapper - Unhandled exception java.lang.NullPointerException at org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable(VariableConverter.java:27) at org.obiba.magma.datasource.hibernate.converter.VariableConverter.marshal(VariableConverter.java:34) at org.obiba.magma.datasource.hibernate.HibernateValueTableWriter$HibernateVariableWriter.writeVariable(HibernateValueTableWriter.java:115) at org.obiba.opal.web.magma.VariablesResourceImpl.addOrUpdateTableVariables(VariablesResourceImpl.java:120) at org.obiba.opal.web.magma.VariablesResourceImpl.addOrUpdateVariables(VariablesResourceImpl.java:110) {code} I traced the error back to the list of VariableState in a ValueTableState. The removed variables (VariableState) are actually deleted from the database, but the issue seems to be related to variable_index gaps. So ValueTableState.getVariables() returns not the list of actual variable rows in the database, but the highest variable_index for that table plus one. That is, the list has null elements (gaps), matching exactly the index of the deleted variables. If you delete more variables with a variable_index other than the last for that table, you will get more null elements in the list.

    JIRA | 2 years ago | Carlos Silva
    java.lang.NullPointerException
  2. 0

    We found a case where its not possible to create new variables (at least using the GUI) on a table where a variable was deleted. So to reproduce this: * Create one table using the attached csv * Delete the variable 'abc' * Create a new variable (name and type is irrelevant) * You will get a NPE. From now on you will always get this NPE for this table, so creating new variables is impossible. Here the stacktrace: {code} 69399283 [qtp1571615117-230] ERROR org.obiba.opal.web.magma.provider.UnhandledExceptionMapper - Unhandled exception java.lang.NullPointerException at org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable(VariableConverter.java:27) at org.obiba.magma.datasource.hibernate.converter.VariableConverter.marshal(VariableConverter.java:34) at org.obiba.magma.datasource.hibernate.HibernateValueTableWriter$HibernateVariableWriter.writeVariable(HibernateValueTableWriter.java:115) at org.obiba.opal.web.magma.VariablesResourceImpl.addOrUpdateTableVariables(VariablesResourceImpl.java:120) at org.obiba.opal.web.magma.VariablesResourceImpl.addOrUpdateVariables(VariablesResourceImpl.java:110) {code} I traced the error back to the list of VariableState in a ValueTableState. The removed variables (VariableState) are actually deleted from the database, but the issue seems to be related to variable_index gaps. So ValueTableState.getVariables() returns not the list of actual variable rows in the database, but the highest variable_index for that table plus one. That is, the list has null elements (gaps), matching exactly the index of the deleted variables. If you delete more variables with a variable_index other than the last for that table, you will get more null elements in the list.

    JIRA | 2 years ago | Carlos Silva
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable()
    2. org.obiba.magma
      HibernateValueTableWriter$HibernateVariableWriter.writeVariable
      1. org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable(VariableConverter.java:27)
      2. org.obiba.magma.datasource.hibernate.converter.VariableConverter.marshal(VariableConverter.java:34)
      3. org.obiba.magma.datasource.hibernate.HibernateValueTableWriter$HibernateVariableWriter.writeVariable(HibernateValueTableWriter.java:115)
      3 frames
    3. org.obiba.opal
      VariablesResourceImpl.addOrUpdateVariables
      1. org.obiba.opal.web.magma.VariablesResourceImpl.addOrUpdateTableVariables(VariablesResourceImpl.java:120)
      2. org.obiba.opal.web.magma.VariablesResourceImpl.addOrUpdateVariables(VariablesResourceImpl.java:110)
      2 frames