java.lang.NullPointerException

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.

  • Tomcat error after pulling from master branch
    via by Pantelis Karamolegkos,
  • Installation problem
    via by Nico Schwab,
  • Hibernate and Enum
    via by Stefan Fritzsche,
  • $ ant fresh_install ... [java] 2015-10-08 10:52:08,420 INFO org.hibernate.tool.hbm2ddl.TableMetadata @ HHH000037: Columns: [dspace_object, resource_id, status, resource_type_id, doi_id, doi] [java] 2015-10-08 10:52:08,421 INFO org.dspace.storage.rdbms.DatabaseRegistryUpdater @ Updating Bitstream Format Registry based on /dspace/config/registries/bitstream-formats.xml [java] Caught exception: [java] java.lang.RuntimeException: Error attempting to update Bitstream Format and/or Metadata Registries [java] at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:83) [java] at org.dspace.storage.rdbms.DatabaseRegistryUpdater.afterMigrate(DatabaseRegistryUpdater.java:110) [java] at org.flywaydb.core.internal.command.DbMigrate$3.doInTransaction(DbMigrate.java:226) [java] at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) [java] at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:223) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1059) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) [java] at org.flywaydb.core.Flyway.execute(Flyway.java:1418) [java] at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:558) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:477) [java] at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:257) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:606) [java] at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:226) [java] at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78) [java] Caused by: java.lang.NullPointerException [java] at org.dspace.core.AbstractHibernateDAO.getHibernateSession(AbstractHibernateDAO.java:40) [java] at org.dspace.core.AbstractHibernateDAO.createCriteria(AbstractHibernateDAO.java:100) [java] at org.dspace.content.dao.impl.BitstreamFormatDAOImpl.findByMIMEType(BitstreamFormatDAOImpl.java:50) [java] at org.dspace.content.BitstreamFormatServiceImpl.findByMIMEType(BitstreamFormatServiceImpl.java:90) [java] at org.dspace.administer.RegistryLoader.loadFormat(RegistryLoader.java:173) [java] at org.dspace.administer.RegistryLoader.loadBitstreamFormats(RegistryLoader.java:139) [java] at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:59) [java] ... 17 more
    via by Ivan Masár,
  • $ ant fresh_install ... [java] 2015-10-08 10:52:08,420 INFO org.hibernate.tool.hbm2ddl.TableMetadata @ HHH000037: Columns: [dspace_object, resource_id, status, resource_type_id, doi_id, doi] [java] 2015-10-08 10:52:08,421 INFO org.dspace.storage.rdbms.DatabaseRegistryUpdater @ Updating Bitstream Format Registry based on /dspace/config/registries/bitstream-formats.xml [java] Caught exception: [java] java.lang.RuntimeException: Error attempting to update Bitstream Format and/or Metadata Registries [java] at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:83) [java] at org.dspace.storage.rdbms.DatabaseRegistryUpdater.afterMigrate(DatabaseRegistryUpdater.java:110) [java] at org.flywaydb.core.internal.command.DbMigrate$3.doInTransaction(DbMigrate.java:226) [java] at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) [java] at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:223) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1059) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) [java] at org.flywaydb.core.Flyway.execute(Flyway.java:1418) [java] at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:558) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:477) [java] at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:257) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:606) [java] at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:226) [java] at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78) [java] Caused by: java.lang.NullPointerException [java] at org.dspace.core.AbstractHibernateDAO.getHibernateSession(AbstractHibernateDAO.java:40) [java] at org.dspace.core.AbstractHibernateDAO.createCriteria(AbstractHibernateDAO.java:100) [java] at org.dspace.content.dao.impl.BitstreamFormatDAOImpl.findByMIMEType(BitstreamFormatDAOImpl.java:50) [java] at org.dspace.content.BitstreamFormatServiceImpl.findByMIMEType(BitstreamFormatServiceImpl.java:90) [java] at org.dspace.administer.RegistryLoader.loadFormat(RegistryLoader.java:173) [java] at org.dspace.administer.RegistryLoader.loadBitstreamFormats(RegistryLoader.java:139) [java] at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:59) [java] ... 17 more
    via by Ivan Masár,
  • I'm seeing a NPE when I try to harvest a collection with current master (008ad12). Java stacktrace: java.lang.NullPointerException at org.dspace.core.AbstractHibernateDAO.getHibernateSession(AbstractHibernateDAO.java:48) at org.dspace.core.AbstractHibernateDAO.findByID(AbstractHibernateDAO.java:75) at org.dspace.content.CollectionServiceImpl.find(CollectionServiceImpl.java:243) at org.dspace.content.CollectionServiceImpl.find(CollectionServiceImpl.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) ... The actual error seems to be that the instance I am harvesting from has some extra schemas. 2016-09-30 08:44:34,476 ERROR org.dspace.harvest.OAIHarvester @ Error occurred while generating an OAI response: The 'xxx' schema has not been defined in this DSpace instance. null org.dspace.content.crosswalk.CrosswalkException: The 'xxx' schema has not been defined in this DSpace instance. at org.dspace.content.crosswalk.CrosswalkMetadataValidator.checkMetadata(CrosswalkMetadataValidator.java:81) at org.dspace.content.crosswalk.DIMIngestionCrosswalk.ingest(DIMIngestionCrosswalk.java:73) at org.dspace.harvest.OAIHarvester.processRecord(OAIHarvester.java:547) at org.dspace.harvest.OAIHarvester.runHarvest(OAIHarvester.java:367) This is kind of not surprising...otherwise harvesting DIM metadata format would mean potentially creating missing schemas/elements. That's not supposed to be happening, or is it?
    via by Ondřej Košarko,
  • Hello, I'm trying to get DSpace running on My PC and I have successfully installed DSpace-6.0-Release.About web application, I want to start with jspui.I copied jspui from [dspace]/webapps to [tomcat]/webapps and then started tomcat.Here comes the question:DSpace failed to initialize database with exception.Here is part of dspace.log and I will upload it as an attachment: 2016-12-07 11:18:11,938 FATAL org.dspace.core.Context @ Cannot obtain the bean which provides a database connection. Check previous entries in the dspace.log to find why the db failed to initialize. 2016-12-07 11:18:11,939 INFO org.dspace.storage.rdbms.DatabaseRegistryUpdater @ Updating Bitstream Format Registry based on D:/dspace\config\registries\bitstream-formats.xml 2016-12-07 11:18:12,129 ERROR org.dspace.storage.rdbms.DatabaseRegistryUpdater @ Error attempting to update Bitstream Format and/or Metadata Registries java.lang.NullPointerException at org.dspace.core.AbstractHibernateDAO.getHibernateSession(AbstractHibernateDAO.java:48) at org.dspace.core.AbstractHibernateDAO.createCriteria(AbstractHibernateDAO.java:108) at org.dspace.content.dao.impl.BitstreamFormatDAOImpl.findByMIMEType(BitstreamFormatDAOImpl.java:57) at org.dspace.content.BitstreamFormatServiceImpl.findByMIMEType(BitstreamFormatServiceImpl.java:95) at org.dspace.administer.RegistryLoader.loadFormat(RegistryLoader.java:184) at org.dspace.administer.RegistryLoader.loadBitstreamFormats(RegistryLoader.java:146) at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:68) at org.dspace.storage.rdbms.DatabaseRegistryUpdater.afterMigrate(DatabaseRegistryUpdater.java:121) at org.flywaydb.core.internal.command.DbMigrate$3.doInTransaction(DbMigrate.java:250) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:246) at org.flywaydb.core.Flyway$1.execute(Flyway.java:959) at org.flywaydb.core.Flyway$1.execute(Flyway.java:917) at org.flywaydb.core.Flyway.execute(Flyway.java:1373) at org.flywaydb.core.Flyway.migrate(Flyway.java:917) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:655) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:574) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:550) at org.dspace.core.Context.<clinit>(Context.java:94) at org.dspace.app.util.AbstractDSpaceWebapp.register(AbstractDSpaceWebapp.java:74) at org.dspace.app.util.DSpaceWebappListener.contextInitialized(DSpaceWebappListener.java:31) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5017) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5531) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) It seems DSpace failed to insert table BITSTREAMFORMATREGISTRY.I couldn't figure out why.I have made sure JVM and oracle both run on utf-8 encoding.The database connection should be all right for 44 tables had already been created.I wondered if I configure local.cfg properly, so I upload it as attachment.I have just started with DSpace, any advice will be helpful.Thanks a lot.
    via by Yunkai Zhang,
  • Required metadata field 'dc.title' doesn't exist
    via by David Brian Holt,
  • /bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace Migrating database to latest version... (Check dspace logs for details) Caught exception: java.lang.RuntimeException: Error attempting to update Bitstream Format and/or Metadata Registries at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:93) at org.dspace.storage.rdbms.DatabaseRegistryUpdater.afterMigrate(DatabaseRegistryUpdater.java:121) at org.flywaydb.core.internal.command.DbMigrate$3.doInTransaction(DbMigrate.java:250) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:246) at org.flywaydb.core.Flyway$1.execute(Flyway.java:959) at org.flywaydb.core.Flyway$1.execute(Flyway.java:917) at org.flywaydb.core.Flyway.execute(Flyway.java:1373) at org.flywaydb.core.Flyway.migrate(Flyway.java:917) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:655) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:574) at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:222) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) Caused by: java.lang.NullPointerException at org.dspace.core.AbstractHibernateDAO.getHibernateSession(AbstractHibernateDAO.java:48) at org.dspace.core.AbstractHibernateDAO.createCriteria(AbstractHibernateDAO.java:108) at org.dspace.content.dao.impl.BitstreamFormatDAOImpl.findByMIMEType(BitstreamFormatDAOImpl.java:57) at org.dspace.content.BitstreamFormatServiceImpl.findByMIMEType(BitstreamFormatServiceImpl.java:95) at org.dspace.administer.RegistryLoader.loadFormat(RegistryLoader.java:184) at org.dspace.administer.RegistryLoader.loadBitstreamFormats(RegistryLoader.java:146) at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:68) ... 17 more =============================================================================================================================== [dspace@dspace-aux-1 dspace6x-aux]$ /opt/dspace/bin/dspace database migrate ignored Database URL: jdbc:postgresql://localhost:5432/dspace Migrating database to latest version AND running previously "Ignored" migrations... (Check logs for details) Migration exception: java.sql.SQLException: Flyway migration error occurred at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:666) at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:188) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) Caused by: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Migration V5.6_2016.08.23__DS-3097.sql failed --------------------------------------------- SQL State : 42883 Error Code : 0 Message : ERROR: operator does not exist: uuid = integer Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 286 Location : org/dspace/storage/rdbms/sqlmigration/postgres/V5.6_2016.08.23__DS-3097.sql (/var/data/dspace_local_build/dspace6x-aux/file:/opt/dspace/lib/dspace-api-6.1-SNAPSHOT.jar!/org/dspace/storage/rdbms/sqlmigration/postgres/V5.6_2016.08.23__DS-3097.sql) Line : 13 Statement : UPDATE resourcepolicy SET action_id = 12 where action_id = 0 and resource_type_id = 0 and resource_id in ( SELECT bundle2bitstream.bitstream_id FROM bundle2bitstream LEFT JOIN item2bundle ON bundle2bitstream.bundle_id = item2bundle.bundle_id LEFT JOIN item ON item2bundle.item_id = item.item_id WHERE item.withdrawn = true ) at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:117) at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:71) at org.flywaydb.core.internal.command.DbMigrate.doMigrate(DbMigrate.java:352) at org.flywaydb.core.internal.command.DbMigrate.access$1100(DbMigrate.java:47) at org.flywaydb.core.internal.command.DbMigrate$4.doInTransaction(DbMigrate.java:308) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:305) at org.flywaydb.core.internal.command.DbMigrate.access$1000(DbMigrate.java:47) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:230) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:173) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:173) at org.flywaydb.core.Flyway$1.execute(Flyway.java:959) at org.flywaydb.core.Flyway$1.execute(Flyway.java:917) at org.flywaydb.core.Flyway.execute(Flyway.java:1373) at org.flywaydb.core.Flyway.migrate(Flyway.java:917) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:655) ... 7 more Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: uuid = integer Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 286 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:305) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:291) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:269) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:265) at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291) at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291) at org.flywaydb.core.internal.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:238) at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:114) ... 23 more
    via by Terry Brady,
    • java.lang.NullPointerException at org.dspace.core.AbstractHibernateDAO.getHibernateSession(AbstractHibernateDAO.java:48) at org.dspace.core.AbstractHibernateDAO.create(AbstractHibernateDAO.java:38) at org.dspace.app.util.WebAppServiceImpl.create(WebAppServiceImpl.java:49) at org.dspace.app.util.AbstractDSpaceWebapp.register(AbstractDSpaceWebapp.java:75) at org.dspace.app.util.DSpaceWebappListener.contextInitialized(DSpaceWebappListener.java:31) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
    No Bugmate found.