java.lang.ClassCastException: org.dspace.content.Bitstream cannot be cast to org.dspace.content.Item

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.ClassCastException: org.dspace.content.Bitstream cannot be cast to org.dspace.content.Item
  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.ClassCastException: org.dspace.content.Bitstream cannot be cast to org.dspace.content.Item
  3. 0

    Memcached Java客户端2.6.1发布 - 编程语言 - ITeye资讯

    iteye.com | 1 year ago
    java.lang.ClassCastException: cannot be cast to
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ClassCastException in HandleFactory.getPkgFragmentRoot (355)

    Eclipse Bugzilla | 1 year ago | error-reports-inbox
    java.lang.ClassCastException: cannot be cast to org.eclipse.wst.jsdt.internal.core.PackageFragmentRoot
  6. 0

    Bug ID: JDK-6499662 "java.lang.ClassCastException: cannot be cast to java.lang.String" happens from time to time

    sun.com | 4 months ago
    java.lang.ClassCastException: cannot be cast to java.lang.String

    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.ClassCastException

      org.dspace.content.Bitstream cannot be cast to org.dspace.content.Item

      at org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost()
    2. org.dspace.app
      DSpaceServlet.doPost
      1. org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet.doDSPost(AuthorizeAdminServlet.java:294)
      2. org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:122)
      3. org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:80)
      3 frames
    3. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
      1 frame