java.lang.NullPointerException

Sakai JIRA | Ivan Masár | 10 months ago
  1. 0

    I encountered three distinct errors when trying to add, delete and edit a bitstream policy via JSPUI. This is on master with service-based api and reloadable configuration already merged. The first one (Add) is due to undefined SMTP server in configuration. This should trigger an error, but not an Internal Server Error. The second one (Delete) is a wrong type cast. The third one (Edit) seems related to Hibernate. ------------------------------------------------------------------ JSPUI edit item / authorizations / bitstream / add new policy 2016-02-03 13:51:04,584 WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=F5C3F1F73B0FC58B8F56A3500BC637A0:internal_error:-- URL Was: https://localhost/jspui/tools/authorize -- Method: POST -- Parameters were: -- submit_bitstream_add_policy: "Add New Policy" -- bitstream_id: "0c35c224-4b95-448c-9194-34b616c75bab" -- item_id: "4dd07d56-f3d6-44ed-a037-5c6347908df8" java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48) at org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129) at org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84) at org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163) at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:272) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) ... at java.lang.Thread.run(Thread.java:745) 2016-02-03 13:51:05,125 WARN org.dspace.app.webui.util.UIUtil @ Unable to send email alert javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Unknown SMTP host: smtp.example.com (java.net.UnknownHostException: smtp.example.com)) at javax.mail.Transport.send(Transport.java:163) at javax.mail.Transport.send(Transport.java:48) at org.dspace.core.Email.send(Email.java:360) at org.dspace.app.webui.util.UIUtil.sendAlert(UIUtil.java:462) at org.dspace.app.webui.servlet.InternalErrorServlet.doGet(InternalErrorServlet.java:54) ... Caused by: javax.mail.MessagingException: Unknown SMTP host: smtp.example.com (java.net.UnknownHostException: smtp.example.com) ------------------------------------------------------------------ JSPUI edit item / authorizations / bitstream / delete policy 2016-02-03 13:58:45,971 WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=F5C3F1F73B0FC58B8F56A3500BC637A0:internal_error:-- URL Was: https://localhost/jspui/tools/authorize -- Method: POST -- Parameters were: -- submit_item_delete_policy: "Delete" -- bitstream_id: "0c35c224-4b95-448c-9194-34b616c75bab" -- item_id: "4dd07d56-f3d6-44ed-a037-5c6347908df8" -- policy_id: "61663" java.lang.ClassCastException: org.dspace.content.Bitstream cannot be cast to org.dspace.content.Item at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:294) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) ... ------------------------------------------------------------------ JSPUI edit item / authorizations / bitstream / edit policy 2016-02-03 13:59:45,028 WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=F5C3F1F73B0FC58B8F56A3500BC637A0:internal_error:-- URL Was: https://localhost/jspui/tools/authorize -- Method: POST -- Parameters were: -- bitstream_id: "0c35c224-4b95-448c-9194-34b616c75bab" -- item_id: "4dd07d56-f3d6-44ed-a037-5c6347908df8" -- submit_item_edit_policy: "Edit" -- policy_id: "62920" java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48) at org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129) at org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84) at org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163) at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:219) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) ...

    Sakai JIRA | 10 months ago | Ivan Masár
    java.lang.NullPointerException
  2. 0

    I encountered three distinct errors when trying to add, delete and edit a bitstream policy via JSPUI. This is on master with service-based api and reloadable configuration already merged. The first one (Add) is due to undefined SMTP server in configuration. This should trigger an error, but not an Internal Server Error. The second one (Delete) is a wrong type cast. The third one (Edit) seems related to Hibernate. ------------------------------------------------------------------ JSPUI edit item / authorizations / bitstream / add new policy 2016-02-03 13:51:04,584 WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=F5C3F1F73B0FC58B8F56A3500BC637A0:internal_error:-- URL Was: https://localhost/jspui/tools/authorize -- Method: POST -- Parameters were: -- submit_bitstream_add_policy: "Add New Policy" -- bitstream_id: "0c35c224-4b95-448c-9194-34b616c75bab" -- item_id: "4dd07d56-f3d6-44ed-a037-5c6347908df8" java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48) at org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129) at org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84) at org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163) at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:272) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) ... at java.lang.Thread.run(Thread.java:745) 2016-02-03 13:51:05,125 WARN org.dspace.app.webui.util.UIUtil @ Unable to send email alert javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Unknown SMTP host: smtp.example.com (java.net.UnknownHostException: smtp.example.com)) at javax.mail.Transport.send(Transport.java:163) at javax.mail.Transport.send(Transport.java:48) at org.dspace.core.Email.send(Email.java:360) at org.dspace.app.webui.util.UIUtil.sendAlert(UIUtil.java:462) at org.dspace.app.webui.servlet.InternalErrorServlet.doGet(InternalErrorServlet.java:54) ... Caused by: javax.mail.MessagingException: Unknown SMTP host: smtp.example.com (java.net.UnknownHostException: smtp.example.com) ------------------------------------------------------------------ JSPUI edit item / authorizations / bitstream / delete policy 2016-02-03 13:58:45,971 WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=F5C3F1F73B0FC58B8F56A3500BC637A0:internal_error:-- URL Was: https://localhost/jspui/tools/authorize -- Method: POST -- Parameters were: -- submit_item_delete_policy: "Delete" -- bitstream_id: "0c35c224-4b95-448c-9194-34b616c75bab" -- item_id: "4dd07d56-f3d6-44ed-a037-5c6347908df8" -- policy_id: "61663" java.lang.ClassCastException: org.dspace.content.Bitstream cannot be cast to org.dspace.content.Item at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:294) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) ... ------------------------------------------------------------------ JSPUI edit item / authorizations / bitstream / edit policy 2016-02-03 13:59:45,028 WARN org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=F5C3F1F73B0FC58B8F56A3500BC637A0:internal_error:-- URL Was: https://localhost/jspui/tools/authorize -- Method: POST -- Parameters were: -- bitstream_id: "0c35c224-4b95-448c-9194-34b616c75bab" -- item_id: "4dd07d56-f3d6-44ed-a037-5c6347908df8" -- submit_item_edit_policy: "Edit" -- policy_id: "62920" java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48) at org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129) at org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84) at org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163) at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:219) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) ...

    Sakai JIRA | 10 months ago | Ivan Masár
    java.lang.NullPointerException
  3. 0

    If an administrator tries to add new authorization Policy to a community or a collection: Administer -> Access Control -> Authorization -> Mange a Community's Policies -> (Select a Community and Edit Policies) -> Add New Policy. A Null Pointer exception is thrown: -- Method: POST -- Parameters were: -- community_id: "187b942e-d278-444d-8fd2-8b05fc98b5bc" -- submit_community_add_policy: "Add New Policy" java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48) at org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129) at org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84) at org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163) at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:502) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

    Sakai JIRA | 10 months ago | Marsa Haoua
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    If an administrator tries to add new authorization Policy to a community or a collection: Administer -> Access Control -> Authorization -> Mange a Community's Policies -> (Select a Community and Edit Policies) -> Add New Policy. A Null Pointer exception is thrown: -- Method: POST -- Parameters were: -- community_id: "187b942e-d278-444d-8fd2-8b05fc98b5bc" -- submit_community_add_policy: "Add New Policy" java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48) at org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129) at org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84) at org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163) at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:502) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

    Sakai JIRA | 10 months ago | Marsa Haoua
    java.lang.NullPointerException
  6. 0

    This issues is being reported based on something that actually occurred on http://demo.dspace.org On the demo site, someone logged in as an Administrator and simply renamed the "dc.title" metadata field to be "dc.titlejaira": 1. Login as an Admin 2. Visit the 'dc' schema in the registry 3. Click on the 'dc.title' field, rename it and click Update After this change was made, the entire site became unresponsive, as any attempts to access 'dc.title' for any object resulted in the below NullPointerException. This meant that both XMLUI and JSPUI homepages were unable to load: {code} Java stacktrace: java.lang.NullPointerException at org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:49) at org.dspace.content.dao.impl.CommunityDAOImpl.findAllNoParent(CommunityDAOImpl.java:88) at org.dspace.content.CommunityServiceImpl.findAllTop(CommunityServiceImpl.java:154) {code} The above NullPointerException was being thrown because the "dc.title" field no longer existed in the registry, and it was being referenced by its name in the top-level communities listing ({{CommunityServiceImpl.findAllTop()}}). The only way to fix this issue was to change the field name back via a SQL UPDATE similar to the following (NOTE: in this case, I first had to determine the "metadata_field_id" of the old 'dc.title' field, which was 70. The ID may not be the same on all systems however) {code} UPDATE metadatafieldregistry SET element='title' where metadata_field_id=70; {code}

    Sakai JIRA | 5 months ago | Tim Donohue
    java.lang.NullPointerException

    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.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin()
    2. DSpace Kernel :: API and Implementation
      AbstractHibernateDSODAO.addMetadataLeftJoin
      1. org.dspace.core.AbstractHibernateDSODAO.addMetadataLeftJoin(AbstractHibernateDSODAO.java:48)
      1 frame
    3. org.dspace.eperson
      EPersonDAOImpl.findAll
      1. org.dspace.eperson.dao.impl.EPersonDAOImpl.getSearchQuery(EPersonDAOImpl.java:129)
      2. org.dspace.eperson.dao.impl.EPersonDAOImpl.findAll(EPersonDAOImpl.java:84)
      2 frames
    4. DSpace Kernel :: API and Implementation
      EPersonServiceImpl.findAll
      1. org.dspace.eperson.EPersonServiceImpl.findAll(EPersonServiceImpl.java:163)
      1 frame
    5. org.dspace.app
      DSpaceServlet.doPost
      1. org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:272)
      2. org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122)
      3. org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80)
      3 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
      2 frames
    7. Glassfish Core
      ApplicationFilterChain.internalDoFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      1 frame