From: Mark W. <mor...@SM...> - 2002-09-25 07:03:42
|
I'm getting this with both 1.1 and what's currently in CVS. I'm getting an NPE at cirrus.hibernate.helpers.ReflectHelper.get(ReflectHelper.java:169) because target is null. My mapping looks like this: <class name="Foo" table="Foos"> <id name="id" column="id" type="string" unsaved-value="null"> <generator class="assigned" /> </id> <property name="name" /> <component name="subComp" class="SubComp"> <property name="version" column=version" /> <property name="value" column="value" /> </component> </class> All I'm doing is: Foo f = new Foo(); f.setId("ID1"); session.save(f); If I comment out the <component> element, everything works. Any ideas? -Mark |
From: Gavin K. <ga...@ap...> - 2002-09-25 11:24:07
|
Curious. I managed to reproduce an NPE just like this, but from update(), not save()...... Are you sure it originated in save() .... can you show me a stack trace please. I'm concerned that the testsuite didn't show this / these problems :( ----- Original Message ----- From: "Mark Woon" <mor...@SM...> To: "Hibernate Mailing List" <hib...@li...> Sent: Wednesday, September 25, 2002 5:03 PM Subject: [Hibernate] Problem with <component> element > > I'm getting this with both 1.1 and what's currently in CVS. I'm getting > an NPE at > cirrus.hibernate.helpers.ReflectHelper.get(ReflectHelper.java:169) > because target is null. > > My mapping looks like this: > > <class name="Foo" table="Foos"> > <id name="id" column="id" type="string" unsaved-value="null"> > <generator class="assigned" /> > </id> > <property name="name" /> > <component name="subComp" class="SubComp"> > <property name="version" column=version" /> > <property name="value" column="value" /> > </component> > </class> > > > All I'm doing is: > > Foo f = new Foo(); > f.setId("ID1"); > session.save(f); > > > If I comment out the <component> element, everything works. > > Any ideas? > > -Mark > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Gavin K. <ga...@ap...> - 2002-09-25 11:30:42
|
P.S. I fixed the problem with update() and its in CVS.... ----- Original Message ----- From: "Gavin King" <ga...@ap...> To: "Mark Woon" <mor...@SM...>; "Hibernate Mailing List" <hib...@li...> Sent: Wednesday, September 25, 2002 9:23 PM Subject: Re: [Hibernate] Problem with <component> element > Curious. > > I managed to reproduce an NPE just like this, but from update(), not > save()...... > > Are you sure it originated in save() .... can you show me a stack trace > please. > > I'm concerned that the testsuite didn't show this / these problems :( > > ----- Original Message ----- > From: "Mark Woon" <mor...@SM...> > To: "Hibernate Mailing List" <hib...@li...> > Sent: Wednesday, September 25, 2002 5:03 PM > Subject: [Hibernate] Problem with <component> element > > > > > > I'm getting this with both 1.1 and what's currently in CVS. I'm getting > > an NPE at > > cirrus.hibernate.helpers.ReflectHelper.get(ReflectHelper.java:169) > > because target is null. > > > > My mapping looks like this: > > > > <class name="Foo" table="Foos"> > > <id name="id" column="id" type="string" unsaved-value="null"> > > <generator class="assigned" /> > > </id> > > <property name="name" /> > > <component name="subComp" class="SubComp"> > > <property name="version" column=version" /> > > <property name="value" column="value" /> > > </component> > > </class> > > > > > > All I'm doing is: > > > > Foo f = new Foo(); > > f.setId("ID1"); > > session.save(f); > > > > > > If I comment out the <component> element, everything works. > > > > Any ideas? > > > > -Mark > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > hibernate-devel mailing list > > hib...@li... > > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Mark W. <mor...@SM...> - 2002-09-25 11:50:19
|
Gavin King wrote: >P.S. I fixed the problem with update() and its in CVS.... > Hmm... Looks like that fixed my problem too. Thanks, -Mark |
From: Mark W. <mor...@SM...> - 2002-09-25 11:47:46
|
Gavin King wrote: >Curious. > >I managed to reproduce an NPE just like this, but from update(), not >save()...... > >Are you sure it originated in save() .... can you show me a stack trace >please. > Yes, I'm doing a save(). Stack trace: java.lang.NullPointerException 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 cirrus.hibernate.helpers.ReflectHelper.get(ReflectHelper.java:183) at cirrus.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:161) at cirrus.hibernate.impl.SessionImpl.removeCollectionsFor(SessionImpl.java:846) at cirrus.hibernate.impl.SessionImpl.removeCollectionsFor(SessionImpl.java:808) at cirrus.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:952) at cirrus.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:897) at cirrus.hibernate.impl.Cascades$2.cascade(Cascades.java:37) at cirrus.hibernate.impl.Cascades.cascade(Cascades.java:130) at cirrus.hibernate.impl.SessionImpl.cascade(SessionImpl.java:1770) at cirrus.hibernate.impl.SessionImpl.doSave(SessionImpl.java:576) at cirrus.hibernate.impl.SessionImpl.save(SessionImpl.java:458) at misc.Test.test(Test.java:258) at misc.Test.main(Test.java:89) Note that it says ReflectHelper.java:183 instead of 169 because I added a bunch of debug code to figure out what was null. >I'm concerned that the testsuite didn't show this / these problems :( > > Yeah, that confused me too, since I checked the test suite and saw that there were tests for this, and thought it was something I was doing.... -Mark |
From: Gavin K. <ga...@ap...> - 2002-09-25 12:13:20
|
>>cirrus.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:897) at cirrus.hibernate.impl.Cascades$2.cascade(Cascades.java:37) at cirrus.hibernate.impl.Cascades.cascade(Cascades.java:130) at cirrus.hibernate.impl.SessionImpl.cascade(SessionImpl.java:1770) at cirrus.hibernate.impl.SessionImpl.doSave(SessionImpl.java:576) at cirrus.hibernate.impl.SessionImpl.save(SessionImpl.java:458)<< Huh???? What on earth is being cascaded here? You have no associations in the mapping you showed me! If cascade() is getting called for a mapping with no associations, theres something very wrong, so please send me a copy of the code that reproduces this..... ----- Original Message ----- From: "Mark Woon" <mor...@SM...> Cc: "Hibernate Mailing List" <hib...@li...> Sent: Wednesday, September 25, 2002 9:47 PM Subject: Re: [Hibernate] Problem with <component> element > Gavin King wrote: > > >Curious. > > > >I managed to reproduce an NPE just like this, but from update(), not > >save()...... > > > >Are you sure it originated in save() .... can you show me a stack trace > >please. > > > Yes, I'm doing a save(). Stack trace: > > java.lang.NullPointerException > 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 > cirrus.hibernate.helpers.ReflectHelper.get(ReflectHelper.java:183) > at > cirrus.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:161) > at > cirrus.hibernate.impl.SessionImpl.removeCollectionsFor(SessionImpl.java:846) > at > cirrus.hibernate.impl.SessionImpl.removeCollectionsFor(SessionImpl.java:808) > at cirrus.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:952) > at > cirrus.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:897) > at cirrus.hibernate.impl.Cascades$2.cascade(Cascades.java:37) > at cirrus.hibernate.impl.Cascades.cascade(Cascades.java:130) > at cirrus.hibernate.impl.SessionImpl.cascade(SessionImpl.java:1770) > at cirrus.hibernate.impl.SessionImpl.doSave(SessionImpl.java:576) > at cirrus.hibernate.impl.SessionImpl.save(SessionImpl.java:458) > at misc.Test.test(Test.java:258) > at misc.Test.main(Test.java:89) > > Note that it says ReflectHelper.java:183 instead of 169 because I added > a bunch of debug code to figure out what was null. > > >I'm concerned that the testsuite didn't show this / these problems :( > > > > > Yeah, that confused me too, since I checked the test suite and saw that > there were tests for this, and thought it was something I was doing.... > > -Mark > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Gavin K. <ga...@ap...> - 2002-09-25 14:07:18
|
A set of strings isn't an association... So I'm still confused why cascade() is called. ----- Original Message ----- From: "Mark Woon" <mor...@SM...> To: "Gavin King" <ga...@ap...> Sent: Wednesday, September 25, 2002 10:56 PM Subject: Re: [Hibernate] Problem with <component> element > Gavin King wrote: > > >>>cirrus.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:897) > >>> > >>> > > at cirrus.hibernate.impl.Cascades$2.cascade(Cascades.java:37) > > at cirrus.hibernate.impl.Cascades.cascade(Cascades.java:130) > > at cirrus.hibernate.impl.SessionImpl.cascade(SessionImpl.java:1770) > > at cirrus.hibernate.impl.SessionImpl.doSave(SessionImpl.java:576) > > at cirrus.hibernate.impl.SessionImpl.save(SessionImpl.java:458)<< > > > >Huh???? What on earth is being cascaded here? You have no associations in > >the mapping you showed me! > > > > Sorry. > > Yes, there was an association: > > <class name="Foo" table="Foos"> > <id name="id" column="id" type="string" unsaved-value="null"> > <generator class="assigned" /> > </id> > <property name="name" /> > <set role="altNames" table="AltNames"> > <key column="fooId" type="string" /> > <element column="name" type="string" /> > </set> > <component name="subComp" class="SubComp"> > <property name="version" column=version" /> > <property name="value" column="value" /> > </component> > </class> > > > -Mark |