java.lang.NullPointerException

Hibernate JIRA | Istvan Orban | 1 decade ago
  1. 0

    After discussing this error on the Forum, emmanuel asked me to put this thing into the JIRA. I got this error java.lang.NullPointerException at net.sf.hibernate.collection.Set.toString(Set.java:219) at java.lang.String.valueOf(String.java:2177) at java.lang.StringBuffer.append(StringBuffer.java:361) at hu.pmmedia.test.hibernate.HibernateCase.testHibernate(HibernateCase.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182) I have the following scenario -> parent table, child table PARENT table has a string (instanz) and a calendar (beginndatum) as a COMPOSITE primary key CHILD table has the same two from the parent plus a calendar (erfassungsbeginn) field as composite key. IF I load the parent object, I got that error when I call the getChildren() on the parent. I tried having bidirectional mapping, error is the same ALTHOUGH from the child I can always get the parent object loaded :))) in this example I don't have bidirection to make it less complicated

    Hibernate JIRA | 1 decade ago | Istvan Orban
    java.lang.NullPointerException
  2. 0

    After discussing this error on the Forum, emmanuel asked me to put this thing into the JIRA. I got this error java.lang.NullPointerException at net.sf.hibernate.collection.Set.toString(Set.java:219) at java.lang.String.valueOf(String.java:2177) at java.lang.StringBuffer.append(StringBuffer.java:361) at hu.pmmedia.test.hibernate.HibernateCase.testHibernate(HibernateCase.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182) I have the following scenario -> parent table, child table PARENT table has a string (instanz) and a calendar (beginndatum) as a COMPOSITE primary key CHILD table has the same two from the parent plus a calendar (erfassungsbeginn) field as composite key. IF I load the parent object, I got that error when I call the getChildren() on the parent. I tried having bidirectional mapping, error is the same ALTHOUGH from the child I can always get the parent object loaded :))) in this example I don't have bidirection to make it less complicated

    Hibernate JIRA | 1 decade ago | Istvan Orban
    java.lang.NullPointerException
  3. 0

    When accessing from parent to children I get following exception: log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. de.jdufner.BestellKopf@7bc56beb bestelldatum=java.util.GregorianCalendar[time=1086386400000,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2004,MONTH=5,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=5,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?,ZONE_OFFSET=?,DST_OFFSET=?] exportnummer=0 lieferdatum=null bestellwert=0.0 uptimestamp=2004-06-05 00:00:00.0 upprog=UNKNOWN Exception in thread "main" java.lang.NullPointerException at net.sf.hibernate.collection.Set.toString(Set.java:218) at java.lang.String.valueOf(String.java:2177) at java.io.PrintStream.print(PrintStream.java:462) at java.io.PrintStream.println(PrintStream.java:599) at de.jdufner.Main.main(Main.java:46) No nested exception, nothing else. This exception is not limited to the toString() method, if I try to iterator over all elements in collection I get the exception too. I found bug HB-753, it is very similar to my bug, but I didn't get an exception from my hashCode() method. I'll attach all files to reproduce this bug. Thanks, Jurgen

    Hibernate JIRA | 1 decade ago | Jurgen Dufner
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When accessing from parent to children I get following exception: log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. de.jdufner.BestellKopf@7bc56beb bestelldatum=java.util.GregorianCalendar[time=1086386400000, areFieldsSet=false,areAllFieldsSet=false,lenient=true, zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000, dstSavings=3600000,useDaylight=true,transitions=143, lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000, dstSavings=3600000,useDaylight=true,startYear=0,startMode=2, startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000, startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1, endTime=3600000,endTimeMode=2]],firstDayOfWeek=2, minimalDaysInFirstWeek=4,ERA=1,YEAR=2004,MONTH=5,WEEK_OF_YEAR=?, WEEK_OF_MONTH=?,DAY_OF_MONTH=5,DAY_OF_YEAR=?,DAY_OF_WEEK=?, DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?, SECOND=?,MILLISECOND=?,ZONE_OFFSET=?,DST_OFFSET=?] exportnummer=0 lieferdatum=null bestellwert=0.0 uptimestamp=2004-06-05 00:00:00.0 upprog=UNKNOWN Exception in thread "main" java.lang.NullPointerException at net.sf.hibernate.collection.Set.toString(Set.java:218) at java.lang.String.valueOf(String.java:2177) at java.io.PrintStream.print(PrintStream.java:462) at java.io.PrintStream.println(PrintStream.java:599) at de.jdufner.Main.main(Main.java:46) No nested exception, nothing else. This exception is not limited to the toString() method, if I try to iterator over all elements in collection I get the exception too. I found bug HB-753, it is very similar to my bug, but I didn't get an exception from my hashCode() method. I'll attach all files to reproduce this bug. Thanks, Jurgen

    Hibernate JIRA | 1 decade ago | Jurgen Dufner
    java.lang.NullPointerException
  6. 0

    When accessing from parent to children I get following exception: log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. de.jdufner.BestellKopf@7bc56beb bestelldatum=java.util.GregorianCalendar[time=1086386400000,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2004,MONTH=5,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=5,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?,ZONE_OFFSET=?,DST_OFFSET=?] exportnummer=0 lieferdatum=null bestellwert=0.0 uptimestamp=2004-06-05 00:00:00.0 upprog=UNKNOWN Exception in thread "main" java.lang.NullPointerException at net.sf.hibernate.collection.Set.toString(Set.java:218) at java.lang.String.valueOf(String.java:2177) at java.io.PrintStream.print(PrintStream.java:462) at java.io.PrintStream.println(PrintStream.java:599) at de.jdufner.Main.main(Main.java:46) No nested exception, nothing else. This exception is not limited to the toString() method, if I try to iterator over all elements in collection I get the exception too. I found bug HB-753, it is very similar to my bug, but I didn't get an exception from my hashCode() method. I'll attach all files to reproduce this bug. Thanks, Jurgen

    Hibernate JIRA | 1 decade ago | Jurgen Dufner
    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 net.sf.hibernate.collection.Set.toString()
    2. net.sf.hibernate
      Set.toString
      1. net.sf.hibernate.collection.Set.toString(Set.java:219)
      1 frame
    3. Java RT
      StringBuffer.append
      1. java.lang.String.valueOf(String.java:2177)
      2. java.lang.StringBuffer.append(StringBuffer.java:361)
      2 frames
    4. hu.pmmedia.test
      HibernateCase.testHibernate
      1. hu.pmmedia.test.hibernate.HibernateCase.testHibernate(HibernateCase.java:56)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    6. JUnit
      TestSuite.run
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      3. junit.framework.TestResult$1.protect(TestResult.java:106)
      4. junit.framework.TestResult.runProtected(TestResult.java:124)
      5. junit.framework.TestResult.run(TestResult.java:109)
      6. junit.framework.TestCase.run(TestCase.java:118)
      7. junit.framework.TestSuite.runTest(TestSuite.java:208)
      8. junit.framework.TestSuite.run(TestSuite.java:203)
      8 frames
    7. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182)
      3 frames