java.lang.NullPointerException

Hibernate JIRA | FOIRET | 9 years ago
  1. 0

    Hi, Find below a null pointer exception error when i try to find the ElemactionDAO by his ID (vdo.epi.hibernate.ElemactionDAO.findById) This error appears when i add a sort="natural" in the set of the entity (Action). An Action contains a set of Elemaction (Find after a part of the mapping file Action) This parameter resolves my sort issue in the set but it creates this one ... I use a TreeSet in the POJO Action for the Elemaction Could you tell me what is the issue ? java.lang.NullPointerException at java.lang.String.compareTo(Unknown Source) at vdo.epi.hibernate.Elemaction.compareTo(Elemaction.java:491) at java.util.TreeMap.compare(Unknown Source) at java.util.TreeMap.put(Unknown Source) at java.util.TreeSet.add(Unknown Source) at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:104) at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716) at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454) at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755) at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:567) at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:196) at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:404) at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96) at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82) at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:540) at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301) at $Proxy3.get(Unknown Source) at vdo.epi.hibernate.ElemactionDAO.findById(ElemactionDAO.java:159) at vdo.epi.page.ActioncreaPage.onEditElem(ActioncreaPage.java:424) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.sf.click.util.ClickUtils.invokeListener(ClickUtils.java:1393) at net.sf.click.control.ActionLink.onProcess(ActionLink.java:498) at net.sf.click.ClickServlet.processPage(ClickServlet.java:555) at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:356) at net.sf.click.ClickServlet.doGet(ClickServlet.java:284) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) Lines in the Mapping file of Action which defines the set of Elemaction <set name="elemaction" inverse="true" cascade="all" lazy="false" sort="natural"> <cache usage="read-write" /> <key column="actionId" /> <one-to-many class="Elemaction" /> </set>

    Hibernate JIRA | 9 years ago | FOIRET
    java.lang.NullPointerException
  2. 0

    Hi, Find below a null pointer exception error when i try to find the ElemactionDAO by his ID (vdo.epi.hibernate.ElemactionDAO.findById) This error appears when i add a sort="natural" in the set of the entity (Action). An Action contains a set of Elemaction (Find after a part of the mapping file Action) This parameter resolves my sort issue in the set but it creates this one ... I use a TreeSet in the POJO Action for the Elemaction Could you tell me what is the issue ? java.lang.NullPointerException at java.lang.String.compareTo(Unknown Source) at vdo.epi.hibernate.Elemaction.compareTo(Elemaction.java:491) at java.util.TreeMap.compare(Unknown Source) at java.util.TreeMap.put(Unknown Source) at java.util.TreeSet.add(Unknown Source) at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:104) at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716) at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454) at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755) at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:567) at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:196) at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:404) at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96) at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82) at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:540) at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301) at $Proxy3.get(Unknown Source) at vdo.epi.hibernate.ElemactionDAO.findById(ElemactionDAO.java:159) at vdo.epi.page.ActioncreaPage.onEditElem(ActioncreaPage.java:424) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.sf.click.util.ClickUtils.invokeListener(ClickUtils.java:1393) at net.sf.click.control.ActionLink.onProcess(ActionLink.java:498) at net.sf.click.ClickServlet.processPage(ClickServlet.java:555) at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:356) at net.sf.click.ClickServlet.doGet(ClickServlet.java:284) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) Lines in the Mapping file of Action which defines the set of Elemaction <set name="elemaction" inverse="true" cascade="all" lazy="false" sort="natural"> <cache usage="read-write" /> <key column="actionId" /> <one-to-many class="Elemaction" /> </set>

    Hibernate JIRA | 9 years ago | FOIRET
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Concurrent HTTP URL connections in Java

    Stack Overflow | 5 years ago | nilesh
    org.uncommons.reportng.ReportNGException: Failed generating HTML report.

    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 java.lang.String.compareTo()
    2. Java RT
      String.compareTo
      1. java.lang.String.compareTo(Unknown Source)
      1 frame
    3. vdo.epi.hibernate
      Elemaction.compareTo
      1. vdo.epi.hibernate.Elemaction.compareTo(Elemaction.java:491)
      1 frame
    4. Java RT
      TreeSet.add
      1. java.util.TreeMap.compare(Unknown Source)
      2. java.util.TreeMap.put(Unknown Source)
      3. java.util.TreeSet.add(Unknown Source)
      3 frames
    5. Hibernate
      AbstractPersistentCollection.forceInitialization
      1. org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:104)
      2. org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35)
      3. org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130)
      4. org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48)
      5. org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
      6. org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
      6 frames
    6. Hibernate
      StatefulPersistenceContext.initializeNonLazyCollections
      1. org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755)
      1 frame
    7. Hibernate
      SessionImpl.internalLoad
      1. org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:567)
      2. org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494)
      3. org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356)
      4. org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
      5. org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
      6. org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
      7. org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
      8. org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
      8 frames
    8. Hibernate
      TypeFactory.assemble
      1. org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
      2. org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:196)
      3. org.hibernate.type.TypeFactory.assemble(TypeFactory.java:404)
      3 frames
    9. Hibernate
      SessionImpl.get
      1. org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96)
      2. org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82)
      3. org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:540)
      4. org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494)
      5. org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356)
      6. org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
      7. org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
      8. org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
      9. org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
      10. org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
      10 frames
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    11. Hibernate
      ThreadLocalSessionContext$TransactionProtectionWrapper.invoke
      1. org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
      1 frame
    12. Unknown
      $Proxy3.get
      1. $Proxy3.get(Unknown Source)
      1 frame
    13. vdo.epi.hibernate
      ElemactionDAO.findById
      1. vdo.epi.hibernate.ElemactionDAO.findById(ElemactionDAO.java:159)
      1 frame
    14. vdo.epi.page
      ActioncreaPage.onEditElem
      1. vdo.epi.page.ActioncreaPage.onEditElem(ActioncreaPage.java:424)
      1 frame
    15. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    16. net.sf.click
      ClickServlet.doGet
      1. net.sf.click.util.ClickUtils.invokeListener(ClickUtils.java:1393)
      2. net.sf.click.control.ActionLink.onProcess(ActionLink.java:498)
      3. net.sf.click.ClickServlet.processPage(ClickServlet.java:555)
      4. net.sf.click.ClickServlet.handleRequest(ClickServlet.java:356)
      5. net.sf.click.ClickServlet.doGet(ClickServlet.java:284)
      5 frames
    17. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      2 frames
    18. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
      8 frames
    19. Grizzly HTTP
      LeaderFollowerWorkerThread.runIt
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
      2. org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      3. org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      4. org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      4 frames
    20. Tomcat Util
      ThreadPool$ControlRunnable.run
      1. org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      1 frame
    21. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame