java.lang.RuntimeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I want to create a "mapping" table that contains the key and one extra field with the codes that map to this key. The purpose of this table is to be used as an annotation source of other views using the "join" method. Example: - I have a view with a field Diagnosis, which contains some ICD-10 code - I want to add another field e.g. "General Diagnosis", which should contain the parent ICD-10 codes of the Diagnosis field value. E.g. if the field Diagnosis contains "E10 (Insulin-dependent diabetes mellitus)" then the "General Diagnosis" field should contain the parent group code "E10–E14 (Diabetes mellitus)" The problem is that when I try to create such a mapping table, containing only this field, it fails with the following error when importing data into it (I hope this is the correct one from the log - see also attachment with steps on how to reproduce): 2014-10-01 12:45:31,531 [pool-2-thread-7] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable 'ICD_codes_to_parents_mapping' to 'ICD_parent_mapping. ICD_codes_to_parents_mapping' (copyMetadata=true, copyValues=true). 2014-10-01 12:45:31,547 [pool-2-thread-7] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: java.lang.NullPointerException at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:142) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) ~[opal-core-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) [opal-shell-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) [opal-shell-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) [opal-shell-2.4.jar:na] at org.obiba.opal.shell.CommandJob.run(CommandJob.java:149) [opal-shell-2.4.jar:na] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3-java8.jar:1.2.3-java8] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3-java8.jar:1.2.3-java8] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65] Caused by: java.lang.NullPointerException: null at org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable(VariableConverter.java:27) ~[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.datasource.hibernate.converter.VariableConverter.marshal(VariableConverter.java:34) ~[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.datasource.hibernate.HibernateValueTableWriter$HibernateVariableWriter.writeVariable(HibernateValueTableWriter.java:115) ~[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copyMetadata(DatasourceCopier.java:270) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copyMetadata(DatasourceCopier.java:262) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:224) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:202) ~[magma-api-1.11-sesi.jar:na] at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:132) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) ~[opal-core-2.4.jar:na] at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) ~[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:133) ~[opal-core-2.4.jar:na] ... 13 common frames omitted 2014-10-01 12:45:31,547 [pool-2-thread-7] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 18.42 ms
    via by Pieter Lukasse,
  • I want to create a "mapping" table that contains the key and one extra field with the codes that map to this key. The purpose of this table is to be used as an annotation source of other views using the "join" method. Example: - I have a view with a field Diagnosis, which contains some ICD-10 code - I want to add another field e.g. "General Diagnosis", which should contain the parent ICD-10 codes of the Diagnosis field value. E.g. if the field Diagnosis contains "E10 (Insulin-dependent diabetes mellitus)" then the "General Diagnosis" field should contain the parent group code "E10–E14 (Diabetes mellitus)" The problem is that when I try to create such a mapping table, containing only this field, it fails with the following error when importing data into it (I hope this is the correct one from the log - see also attachment with steps on how to reproduce): 2014-10-01 12:45:31,531 [pool-2-thread-7] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable 'ICD_codes_to_parents_mapping' to 'ICD_parent_mapping. ICD_codes_to_parents_mapping' (copyMetadata=true, copyValues=true). 2014-10-01 12:45:31,547 [pool-2-thread-7] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: java.lang.NullPointerException at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:142) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) ~[opal-core-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) [opal-shell-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) [opal-shell-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) [opal-shell-2.4.jar:na] at org.obiba.opal.shell.CommandJob.run(CommandJob.java:149) [opal-shell-2.4.jar:na] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3-java8.jar:1.2.3-java8] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3-java8.jar:1.2.3-java8] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65] Caused by: java.lang.NullPointerException: null at org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable(VariableConverter.java:27) ~[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.datasource.hibernate.converter.VariableConverter.marshal(VariableConverter.java:34) ~[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.datasource.hibernate.HibernateValueTableWriter$HibernateVariableWriter.writeVariable(HibernateValueTableWriter.java:115) ~[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copyMetadata(DatasourceCopier.java:270) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copyMetadata(DatasourceCopier.java:262) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:224) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) ~[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:202) ~[magma-api-1.11-sesi.jar:na] at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:132) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) ~[opal-core-2.4.jar:na] at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) ~[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) ~[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:133) ~[opal-core-2.4.jar:na] ... 13 common frames omitted 2014-10-01 12:45:31,547 [pool-2-thread-7] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 18.42 ms
    via by Pieter Lukasse,
  • 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.
    via by Carlos Silva,
  • 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.
    via by Carlos Silva,
    • java.lang.RuntimeException: java.lang.NullPointerException at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:142)[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105)[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87)[opal-core-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155)[opal-shell-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89)[opal-shell-2.4.jar:na] at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68)[opal-shell-2.4.jar:na] at org.obiba.opal.shell.CommandJob.run(CommandJob.java:149)[opal-shell-2.4.jar:na] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)[shiro-core-1.2.3-java8.jar:1.2.3-java8] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)[shiro-core-1.2.3-java8.jar:1.2.3-java8] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[na:1.7.0_65] at java.util.concurrent.FutureTask.run(FutureTask.java:262)[na:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[na:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[na:1.7.0_65] at java.lang.Thread.run(Thread.java:745)[na:1.7.0_65] Caused by: java.lang.NullPointerException: null at org.obiba.magma.datasource.hibernate.converter.VariableConverter.getStateForVariable(VariableConverter.java:27)[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.datasource.hibernate.converter.VariableConverter.marshal(VariableConverter.java:34)[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.datasource.hibernate.HibernateValueTableWriter$HibernateVariableWriter.writeVariable(HibernateValueTableWriter.java:115)[magma-datasource-hibernate-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copyMetadata(DatasourceCopier.java:270)[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copyMetadata(DatasourceCopier.java:262)[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:224)[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214)[magma-api-1.11-sesi.jar:na] at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:202)[magma-api-1.11-sesi.jar:na] at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:132)[opal-core-2.4.jar:na] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47)[opal-core-2.4.jar:na] at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)[spring-tx-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42)[opal-core-2.4.jar:na] at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31)[opal-core-2.4.jar:na] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:133)[opal-core-2.4.jar:na] ... 13 more
    No Bugmate found.