You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Phill Moran <pj...@rogers.com> on 2007/04/26 21:39:24 UTC
How to debug object retrieveal in JPA?
Community,
How does one go about debugging object retrieval/creation. I continue to have
exceptions and little to go on as far as the cause.
The named JPQL is good since I know it generates a good sql (can trace code and
see it) . I know the sql is good as I can copy/paste it into mysql query
browser, execute and get the correct data back. The problem is that these lines
result in an NPE.
Query q =
this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
q.setParameter("storeName", storeName.toUpperCase());
q.setParameter("loginName", loginName.toUpperCase());
List<Person> results = null;
try {
results = (List<Person>) q.getResultList();
System.out.println(results.size());
}
catch(Exception e) {
e.printStackTrace();
}
if (results.isEmpty()) { <- NPE thrown here
throw new UserNotFoundException("No user found");
}
Also the "mappingTool validate" seems to work fine. Of course how would I know
since I can find no description of what a good one looks like but reading it (no
exceptions) seem to make sense.
Any help would be much appreciated.
Phill
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
I changed the print statement you asked about and got a
"org.apache.openjpa.kernel.DelegatingResultList@267b76" It holds the exception I
mentioned in the last email (out of sync with this one)
Phill
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 26, 2007 4:35 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
> What is interesting is the line with a "1" (from
> System.out.println(results.size())). What this represents is the
> message that the "result list is closed" nothing else in the trace.
>
> So what causes the result list to be closed?
I don't follow -- I would assume that the '1' represents the numbers of elements
in the result list.
What happens if you change that to be 'System.out.println(results)'?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 1:18 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I did not mean it threw an NPE but I was left with a null result list.
>
> I have setup trace already and I actually get nothing back.
> Here is the trace across the execution point
>
> 13734 WARN [main] openjpa.MetaData - Found duplicate query
> "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> Ignoring.
> 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 31103354 SELECT t0.id,
> t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil, t0.created,
> t0.displayName, t0.firstName, t0.lastLogin, t0.lastName, t0.locale,
> t0.loginName, t0.middleName, t2.id, t2.lastUpdated, t2.description,
> t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value, t1.id,
> t1.lastUpdated, t1.created, t1.description, t1.displayName, t1.name,
> t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value,
> t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON t0.roleFK =
> t2.id LEFT OUTER JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK
> = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
> WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName
> ASC, t0.firstName ASC [params=(String) BIDSPEC,
> (String) PMORAN]
> 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [15 ms] spent
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK = t1.id LEFT
> OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK
> = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
> WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> [params=(String) BIDSPEC,
> (String) PMORAN]
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [0 ms] spent
> 1
> [2007-04-26 16:07:36,125] INFO
> ca.BidSpec.testing.emall.UserFactoryTest Rolled back transaction after
> test execution
>
> What is interesting is the line with a "1" (from
> System.out.println(results.size())). What this represents is the
> message that the "result list is closed" nothing else in the trace.
>
> So what causes the result list to be closed?
>
> Phill
>
> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On Behalf
> Of Marc Prud'hommeaux
> Sent: April 26, 2007 3:54 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> Phill-
>
> The maximum verbosity of logging is obtained by specifying the
> "openjpa.Log"
> property to "DefaultLevel=TRACE".
>
> What is the full exception stack trace? We might be able to help
> identify the problem. In any case OpenJPA should never be throwing an
> NPE, so we should at least probably fix the error message.
>
>
> On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>
> > Community,
> >
> > How does one go about debugging object retrieval/creation.
> I continue
> > to have exceptions and little to go on as far as the cause.
> > The named JPQL is good since I know it generates a good sql
> (can trace
> > code and see it) . I know the sql is good as I can
> copy/paste it into
> > mysql query browser, execute and get the correct data back. The
> > problem is that these lines result in an NPE.
> >
> > Query q =
> > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > q.setParameter("storeName", storeName.toUpperCase());
> > q.setParameter("loginName", loginName.toUpperCase());
> > List<Person> results = null;
> > try {
> > results = (List<Person>) q.getResultList();
> > System.out.println(results.size());
> > }
> > catch(Exception e) {
> > e.printStackTrace();
> > }
> > if (results.isEmpty()) { <- NPE thrown here
> > throw new UserNotFoundException("No
> user found");
> > }
> > Also the "mappingTool validate" seems to work fine. Of course how
> > would I know since I can find no description of what a good
> one looks
> > like but reading it (no
> > exceptions) seem to make sense.
> >
> > Any help would be much appreciated.
> >
> > Phill
> >
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
> What is interesting is the line with a "1" (from
> System.out.println(results.size())). What this represents is
> the message that the "result list is closed" nothing else in
> the trace.
>
> So what causes the result list to be closed?
I don't follow -- I would assume that the '1' represents the numbers of
elements in the result list.
What happens if you change that to be 'System.out.println(results)'?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 1:18 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I did not mean it threw an NPE but I was left with a null
> result list.
>
> I have setup trace already and I actually get nothing back.
> Here is the trace across the execution point
>
> 13734 WARN [main] openjpa.MetaData - Found duplicate query
> "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> Ignoring.
> 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 31103354 SELECT t0.id,
> t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> t0.created, t0.displayName, t0.firstName, t0.lastLogin,
> t0.lastName, t0.locale, t0.loginName, t0.middleName, t2.id,
> t2.lastUpdated, t2.description, t3.id, t3.lastUpdated,
> t3.description, t2.value, t4.id, t4.lastUpdated,
> t4.description, t4.categoryTypeFK, t4.value, t1.id,
> t1.lastUpdated, t1.created, t1.description, t1.displayName,
> t1.name, t5.id, t5.lastUpdated, t5.description,
> t5.categoryTypeFK, t5.value, t0.title, t0.visible FROM person
> t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK = t1.id
> LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON
> t1.typeFK = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> t0.lastName ASC, t0.firstName ASC [params=(String) BIDSPEC,
> (String) PMORAN]
> 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [15 ms] spent
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT
> OUTER JOIN category t4 ON t0.salutationFK = t4.id LEFT OUTER
> JOIN category t5 ON t1.typeFK = t5.id LEFT OUTER JOIN
> categorytype t3 ON t2.categoryTypeFK = t3.id WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> [params=(String) BIDSPEC,
> (String) PMORAN]
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [0 ms] spent
> 1
> [2007-04-26 16:07:36,125] INFO
> ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> transaction after test execution
>
> What is interesting is the line with a "1" (from
> System.out.println(results.size())). What this represents is
> the message that the "result list is closed" nothing else in
> the trace.
>
> So what causes the result list to be closed?
>
> Phill
>
> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On
> Behalf Of Marc Prud'hommeaux
> Sent: April 26, 2007 3:54 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> Phill-
>
> The maximum verbosity of logging is obtained by specifying
> the "openjpa.Log"
> property to "DefaultLevel=TRACE".
>
> What is the full exception stack trace? We might be able to
> help identify the problem. In any case OpenJPA should never
> be throwing an NPE, so we should at least probably fix the
> error message.
>
>
> On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>
> > Community,
> >
> > How does one go about debugging object retrieval/creation.
> I continue
> > to have exceptions and little to go on as far as the cause.
> > The named JPQL is good since I know it generates a good sql
> (can trace
> > code and see it) . I know the sql is good as I can
> copy/paste it into
> > mysql query browser, execute and get the correct data back. The
> > problem is that these lines result in an NPE.
> >
> > Query q =
> > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > q.setParameter("storeName", storeName.toUpperCase());
> > q.setParameter("loginName", loginName.toUpperCase());
> > List<Person> results = null;
> > try {
> > results = (List<Person>) q.getResultList();
> > System.out.println(results.size());
> > }
> > catch(Exception e) {
> > e.printStackTrace();
> > }
> > if (results.isEmpty()) { <- NPE thrown here
> > throw new UserNotFoundException("No
> user found");
> > }
> > Also the "mappingTool validate" seems to work fine. Of course how
> > would I know since I can find no description of what a good
> one looks
> > like but reading it (no
> > exceptions) seem to make sense.
> >
> > Any help would be much appreciated.
> >
> > Phill
> >
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
So I take it that you're no longer seeing the "this result set has been
closed" error. What changed in your setup since that error was
happening?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 12:07 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> This is all I get:
>
> <0.9.7-incubating nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:857)
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:756)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> Manager.java:776)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> .java:257)
> at
> org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> tImpl.java:2152)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> .java:251)
> at
> org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> tResultObject(Inst
> anceResultObjectProvider.java:59)
> at
> org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> ResultList.java:13
> 1)
> at
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> (AbstractNonSequen
> tialResultList.java:72)
> at
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> esultList.java:244
> )
> at
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> ect(PersonFactoryI
> mpl.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> eflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.i
> nvokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterce
> ptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> kDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> eflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.i
> nvokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterce
> ptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> kDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> yTest.java:119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at
> org.springframework.test.ConditionalTestCase.runBare(Condition
> alTestCase.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:159)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:239)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> Runner.java:35)
> at
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> .java:29)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> stClassRunner.java
> :42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> eforeAndAfterRunne
> r.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> .java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> (JUnit4TestReferen
> ce.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> ecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> s(RemoteTestRunner
> .java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> s(RemoteTestRunner
> .java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> oteTestRunner.java
> :386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> moteTestRunner.jav
> a:196)
> Caused by: java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:472)
> at
> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:121)
> at
> org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> agerImpl.java:250)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> e(JDBCStoreManager
> .java:330)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> CStoreManager.java
> :255)
> at
> org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> legatingStoreManag
> er.java:111)
> at
> org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> anager.java:57)
> at
> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:876)
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:834)
> ... 64 more
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 2:41 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Can you post the current full exception + any nested
> exceptions and their nested
> exceptions and their nested exceptions and so on? I think
> that that data is
> already in this thread, but I just want to confirm that
> things are still the
> same as they were.
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments,
> may contain
> information of BEA Systems, Inc., its subsidiaries and
> affiliated
> entities, that may be confidential, proprietary,
> copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named
> in this message. If you are not the intended recipient, and
> have received this
> message in error, please immediately return this by email and
> then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 11:13 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Sure here it is and the sql it generates. BTW the SQL works
> as I can
> > execute it in MySQL query browser and get the record back I
> am after.
> > Does it matter that I am after a single record? I don't specify the
> > single records expected response (since it could be larger but
> > currently in test it is only 1)
> >
> > @NamedQuery(name = "PersonFXStoreAndLogin", query = "SELECT p FROM
> > Person p WHERE UPPER(p.store.name) = :storeName and
> > UPPER(p.loginName) = :loginName ORDER BY p.lastName,
> p.firstName") })
> >
> > SQL:
> > 37391 BidSpecPersistenceUnit TRACE [main] openjpa.jdbc.SQL
> > - <t 2860004, conn
> > 24859001> executing prepstmnt 31775072 SELECT t0.id, t0.version,
> > 24859001> t0.lastUpdated,
> > t0.active, t0.activeFrom, t0.activeUntil, t0.created,
> t0.displayName,
> > t0.firstName, t0.lastLogin, t0.lastName, t0.locale, t0.loginName,
> > t0.middleName, t2.id, t2.version, t2.lastUpdated, t2.description,
> > t3.id, t3.version, t3.lastUpdated, t3.description, t2.value, t4.id,
> > t4.version, t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > t4.value, t1.id, t1.version, t1.lastUpdated, t1.created,
> > t1.description, t1.displayName, t1.name, t5.id, t5.version,
> > t5.lastUpdated, t5.description, t5.categoryTypeFK,
> t5.value, t0.title,
> > t0.visible FROM person t0 INNER JOIN manufacturer
> > t1 ON t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > t0.roleFK = t2.id LEFT OUTER JOIN category
> > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> ON t1.typeFK
> > = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id
> > WHERE
> > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> t0.lastName
> > ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > (String) PMORAN]
> >
> > The initial excpetion is :
> > Error Exception occurred: com.sun.jdi.InvocationException
> > occurred invoking
> > method..
> >
> > Here is the method that causes the problem
> > public Person getLoginPersonValueObject(String storeName, String
> > loginName)
> > throws PersonValueObjectNotFoundException,
> > UserNotActiveException,
> > UserNotFoundException {
> > Query q =
> > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > q.setParameter("storeName", storeName.toUpperCase());
> > q.setParameter("loginName", loginName.toUpperCase());
> > List<Person> results = null;
> > try {
> > results = (List<Person>) q.getResultList();
> > System.out.println(results.get(0));
> > }
> > catch(Exception e) {
> > e.printStackTrace();
> > }
> > if (results.isEmpty()) {
> > throw new UserNotFoundException("No
> user found");
> > }
> > if (results.size() > 1) {
> > throw new PersonValueObjectNotFoundException(
> > "returned multiple
> > login name for same store. StoreName=" + storeName
> > + ",
> > loginName=" +
> > loginName);
> > }
> > Person person = results.iterator().next();
> > if (!person.isActive()) {
> > throw new UserNotActiveException();
> > }
> > return person;
> > }
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 30, 2007 2:01 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Odd indeed. Can you post your named query definition?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its
> subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Monday, April 30, 2007 10:55 AM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > Hard to pull this little piece (of a much larger one) and
> > package it.
> > > Let me tool around some more and see if I can uncover
> more. What is
> > > odd is not all my JPA classes have this problem but all
> > inherit from
> > > the same base and are fairly similar. I will try commenting
> > out parts
> > > of it and see if it clears. IF not I will have to package
> and send
> > > along
> > >
> > > Phill
> > >
> > > -----Original Message-----
> > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > Sent: April 30, 2007 1:45 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > Odd. Any chance of packaging it up and attaching it to a
> JIRA issue?
> > >
> > > -Patrick
> > >
> > > --
> > > Patrick Linskey
> > > BEA Systems, Inc.
> > > ______________________________________________________________
> > > _________
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please immediately return this by email and then delete it.
> > >
> > > > -----Original Message-----
> > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > Sent: Monday, April 30, 2007 10:37 AM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > > I upgraded and result stayed the same. Also this is in a spring
> > > > transaction. In fact these are all part of JUnit tests.
> > > >
> > > > -----Original Message-----
> > > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > Sent: April 30, 2007 12:05 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > > It looks like this exception is different than the
> > others; it looks
> > > > like this exception is actually being thrown, rather than
> > being put
> > > > into your result list.
> > > > Is that correct?
> > > >
> > > > Is this something that you could package up as a test case?
> > > > Also, I seem to remember some sort of issue with
> > > overly-eager result
> > > > list closing in non-transactional environments in 0.9.6,
> > > but I can't
> > > > find a related JIRA issue.
> > > > It's possible that moving up to 0.9.7 (released Friday;
> > > > http://cwiki.apache.org/openjpa/downloads.html) might get
> > > around the
> > > > problem.
> > > >
> > > > -Patrick
> > > >
> > > > --
> > > > Patrick Linskey
> > > > BEA Systems, Inc.
> > > > ______________________________________________________________
> > > > _________
> > > > Notice: This email message, together with any attachments, may
> > > > contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > > affiliated entities, that may be confidential, proprietary,
> > > > copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > > use of the individual or entity named in this message. If
> > > you are not
> > > > the intended recipient, and have received this message
> in error,
> > > > please immediately return this by email and then delete it.
> > > >
> > > > > -----Original Message-----
> > > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > > Sent: Monday, April 30, 2007 7:28 AM
> > > > > To: open-jpa-dev@incubator.apache.org
> > > > > Subject: RE: How to debug object retrieveal in JPA?
> > > > >
> > > > > Anyone have any more suggestions on how to debug this?
> > > > >
> > > > > -----Original Message-----
> > > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > > Sent: April 26, 2007 11:20 PM
> > > > > To: open-jpa-dev@incubator.apache.org
> > > > > Subject: RE: How to debug object retrieveal in JPA?
> > > > >
> > > > > I don't close it in anyway directly
> > > > >
> > > > > -----Original Message-----
> > > > > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > > > > Sent: April 26, 2007 11:16 PM
> > > > > To: open-jpa-dev@incubator.apache.org
> > > > > Subject: Re: How to debug object retrieveal in JPA?
> > > > >
> > > > > Can it be that there is a glue code that closes EM in
> > > > between? Just a
> > > > > thought...
> > > > >
> > > > > -marina
> > > > >
> > > > > Phill Moran wrote:
> > > > > > I had suspected the Locale so I made a set/getLocale that
> > > > > communicate
> > > > > > in
> > > > > String.
> > > > > > I figured that openJPA does not actually care how I
> implement.
> > > > > >
> > > > > > But for this run I removed it completely and did a clean
> > > > > rebuild. Good
> > > > > > news and bad the exception changed:
> > > > > >
> > > > > >
> > > > > > java.util.NoSuchElementException: The result list has
> > > been closed.
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > > > > tList.java
> > > > > > :91)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > > > > tNonSequen
> > > > > > tialResultList.java:68)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > > > > t.java:241
> > > > > > )
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > > > > onFactoryI
> > > > > > mpl.java:99)
> > > > > > at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > > at
> > > > > >
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > > orImpl.java:39)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > > orImpl.jav
> > > > > > a:25)
> > > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > > > n(AopUtils
> > > > > > .java:304)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > > > npoint(Ref
> > > > > > lectiveMethodInvocation.java:172)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > > eflectiveM
> > > > > > ethodInvocation.java:139)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > > > oke(Transa
> > > > > > ctionInterceptor.java:107)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > > eflectiveM
> > > > > > ethodInvocation.java:161)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > > > AopProxy.j
> > > > > > ava:203)
> > > > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > > at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > > at
> > > > > >
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > > orImpl.java:39)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > > orImpl.jav
> > > > > > a:25)
> > > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > > > n(AopUtils
> > > > > > .java:304)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > > > npoint(Ref
> > > > > > lectiveMethodInvocation.java:172)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > > eflectiveM
> > > > > > ethodInvocation.java:139)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > > > oke(Transa
> > > > > > ctionInterceptor.java:107)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > > eflectiveM
> > > > > > ethodInvocation.java:161)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > > > AopProxy.j
> > > > > > ava:203)
> > > > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > > at
> > > > > >
> > > > > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > > > yTest.java:119)
> > > > > > at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > > at
> > > > > >
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > > orImpl.java:39)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > > orImpl.jav
> > > > > > a:25)
> > > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > > > > se.java:69
> > > > > > )
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > > alTests.ac
> > > > > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > > > at
> > > > > >
> > > > > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > > nsactionalTests$1.
> > > > > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > > alTests.ru
> > > > > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > > alTests.ru
> > > > > >
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > > alTests.ru
> > > > > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > > > at
> > > > > >
> > > > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > > JpaTests.java:159)
> > > > > > at
> > > > > >
> > > > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > > JpaTests.java:239)
> > > > > > at
> > > junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > > > at
> > > junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > > > at junit.framework.TestResult.run(TestResult.java:113)
> > > > > > at junit.framework.TestCase.run(TestCase.java:124)
> > > > > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > > > at
> > > > > >
> > > > > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > > > Runner.java:35)
> > > > > > at
> > > > > >
> > > > > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > > > .java:29)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > > > > unner.java
> > > > > > :42)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > > > > AfterRunne
> > > > > > r.java:34)
> > > > > > at
> > > > > >
> > > > > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > > > .java:52)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > > > > estReferen
> > > > > > ce.java:38)
> > > > > > at
> > > > > >
> > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > > > ecution.java:38)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > > > TestRunner
> > > > > > .java:460)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > > > TestRunner
> > > > > > .java:673)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > > > > unner.java
> > > > > > :386)
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > > > > Runner.jav
> > > > > > a:196)
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > > > Sent: April 26, 2007 9:59 PM
> > > > > > To: open-jpa-dev@incubator.apache.org
> > > > > > Subject: RE: How to debug object retrieveal in JPA?
> > > > > >
> > > > > >
> > > > > >>Caused by: java.lang.NullPointerException
> > > > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > > > >> at java.util.Locale.<init>(Locale.java:272)
> > > > > >> at java.util.Locale.<init>(Locale.java:302)
> > > > > >> at
> > > ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > > > >> at
> > > ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > > > >> at
> > > ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > > > >> at
> > > > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > > > .java:117)
> > > > > >
> > > > > >
> > > > > > Now we're getting somewhere.... what happens if you remove
> > > > > the Locale
> > > > > > field from the Person class?
> > > > > >
> > > > > > -Patrick
> > > > > >
> > > > > > --
> > > > > > Patrick Linskey
> > > > > > BEA Systems, Inc.
> > > > > >
> > > > >
> > > >
> > >
> >
> ______________________________________________________________________
> > > > > > _
> > > > > > Notice: This email message, together with any
> > attachments, may
> > > > > > contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > > > affiliated entities, that may be confidential,
> proprietary,
> > > > > > copyrighted and/or legally privileged, and is intended
> > > > > solely for the
> > > > > > use of the individual or entity named in this message. If
> > > > > you are not
> > > > > > the intended recipient, and have received this message
> > > in error,
> > > > > > please
> > > > > immediately return this by email and then delete it.
> > > > > >
> > > > > >
> > > > > >>-----Original Message-----
> > > > > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > > >>Sent: Thursday, April 26, 2007 6:32 PM
> > > > > >>To: open-jpa-dev@incubator.apache.org
> > > > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > > > >>
> > > > > >>Run that config gives us this lovely message:
> > > > > >>
> > > > > >><0|false|0.9.6-incubating>
> > > > > >>org.apache.openjpa.persistence.PersistenceException:
> > > > > >>null
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > > > > >>Manager.java:773)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > > > >>.java:254)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > > > > >>tImpl.java:2115)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > > > >>.java:248)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > > > > >>tResultObject(Inst
> > > > > >>anceResultObjectProvider.java:56)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > > > > >>ResultList.java:12
> > > > > >>8)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > > > > >>(AbstractNonSequen
> > > > > >>tialResultList.java:69)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > > > > >>esultList.java:241
> > > > > >>)
> > > > > >> at
> > > > >
> >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > > > > >>ect(PersonFactoryI
> > > > > >>mpl.java:99)
> > > > > >> at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > >> at
> > > > >
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > > >>orImpl.java:39)
> > > > > >> at
> > > > >
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > >>odAccessorImpl.jav
> > > > > >>a:25)
> > > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > >> at
> > > > >
> >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > > > >>eflection(AopUtils
> > > > > >>.java:304)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > > > >>nvokeJoinpoint(Ref
> > > > > >>lectiveMethodInvocation.java:172)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > > >>roceed(ReflectiveM
> > > > > >>ethodInvocation.java:139)
> > > > > >> at
> > > > >
> >>org.springframework.transaction.interceptor.TransactionInterce
> > > > > >>ptor.invoke(Transa
> > > > > >>ctionInterceptor.java:107)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > > >>roceed(ReflectiveM
> > > > > >>ethodInvocation.java:161)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > > > >>kDynamicAopProxy.j
> > > > > >>ava:203)
> > > > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > >> at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > >> at
> > > > >
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > > >>orImpl.java:39)
> > > > > >> at
> > > > >
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > >>odAccessorImpl.jav
> > > > > >>a:25)
> > > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > >> at
> > > > >
> >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > > > >>eflection(AopUtils
> > > > > >>.java:304)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > > > >>nvokeJoinpoint(Ref
> > > > > >>lectiveMethodInvocation.java:172)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > > >>roceed(ReflectiveM
> > > > > >>ethodInvocation.java:139)
> > > > > >> at
> > > > >
> >>org.springframework.transaction.interceptor.TransactionInterce
> > > > > >>ptor.invoke(Transa
> > > > > >>ctionInterceptor.java:107)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > > >>roceed(ReflectiveM
> > > > > >>ethodInvocation.java:161)
> > > > > >> at
> > > > >
> >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > > > >>kDynamicAopProxy.j
> > > > > >>ava:203)
> > > > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > >> at
> > > > >
> >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > > > >>yTest.java:119)
> > > > > >> at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > >> at
> > > > >
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > > >>orImpl.java:39)
> > > > > >> at
> > > > >
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > >>odAccessorImpl.jav
> > > > > >>a:25)
> > > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > > >> at
> > > > >
> >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > > > > >>alTestCase.java:69
> > > > > >>)
> > > > > >> at
> > > > >
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > > >>nsactionalTests.ac
> > > > > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > > >> at
> > > > >
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > > >>nsactionalTests$1.
> > > > > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > > >> at
> > > > >
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > > >>nsactionalTests.ru
> > > > > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > > >> at
> > > > >
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > > >>nsactionalTests.ru
> > > > >
> >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > > >> at
> > > > >
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > > >>nsactionalTests.ru
> > > > > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > > >> at
> > > > >
> >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > > >>JpaTests.java:159)
> > > > > >> at
> > > > >
> >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > > >>JpaTests.java:239)
> > > > > >> at
> > > junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > > >> at
> > > junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > > >> at junit.framework.TestResult.run(TestResult.java:113)
> > > > > >> at junit.framework.TestCase.run(TestCase.java:124)
> > > > > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > > >> at
> > > > >
> >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > > > >>Runner.java:35)
> > > > > >> at
> > > > >
> >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > > > >>.java:29)
> > > > > >> at
> > > > >
> >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > > > > >>stClassRunner.java
> > > > > >>:42)
> > > > > >> at
> > > > >
> >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > > > > >>eforeAndAfterRunne
> > > > > >>r.java:34)
> > > > > >> at
> > > > >
> >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > > > >>.java:52)
> > > > > >> at
> > > > >
> >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > > > > >>(JUnit4TestReferen
> > > > > >>ce.java:38)
> > > > > >> at
> > > > >
> >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > > > >>ecution.java:38)
> > > > > >> at
> > > > >
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > > > >>s(RemoteTestRunner
> > > > > >>.java:460)
> > > > > >> at
> > > > >
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > > > >>s(RemoteTestRunner
> > > > > >>.java:673)
> > > > > >> at
> > > > >
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > > > > >>oteTestRunner.java
> > > > > >>:386)
> > > > > >> at
> > > > >
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > > > > >>moteTestRunner.jav
> > > > > >>a:196)
> > > > > >>Caused by: java.lang.NullPointerException
> > > > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > > > >> at java.util.Locale.<init>(Locale.java:272)
> > > > > >> at java.util.Locale.<init>(Locale.java:302)
> > > > > >> at
> > > ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > > > >> at
> > > ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > > > >> at
> > > ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > > > >> at
> > > > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > > > .java:117)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > > > > >>agerImpl.java:247)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > > > > >>e(JDBCStoreManager
> > > > > >>.java:327)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > > > > >>CStoreManager.java
> > > > > >>:252)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > > > > >>legatingStoreManag
> > > > > >>er.java:108)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > > > > >>anager.java:54)
> > > > > >> at
> > > > >
> > > >
> > >
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > > > > >> at
> > > > >
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > > > > >> ... 64 more
> > > > > >>
> > > > > >>-----Original Message-----
> > > > > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > > >>Sent: April 26, 2007 5:40 PM
> > > > > >>To: open-jpa-dev@incubator.apache.org
> > > > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > > > >>
> > > > > >>
> > > > > >>>Can you post what you get if you do '((Exception)
> > > > > >>>results.get(0)).printStackTrace()'?
> > > > > >>
> > > > > >>... so results.get(0) is returning a List? That's very odd.
> > > > > >>What if you
> > > > > >>do:
> > > > > >>
> > > > > >>System.out.println(results.get(0))?
> > > > > >>
> > > > > >>If it is a List of Exceptions, what if you print out the
> > > > > stacks of the
> > > > > >>exceptions in the list?
> > > > > >>
> > > > > >>-Patrick
> > > > > >>
> > > > > >>--
> > > > > >>Patrick Linskey
> > > > > >>BEA Systems, Inc.
> > > > >
> >>______________________________________________________________
> > > > > >>_________
> > > > > >>Notice: This email message, together with any
> > attachments, may
> > > > > >>contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > > >>affiliated entities, that may be confidential,
> proprietary,
> > > > > >>copyrighted and/or legally privileged, and is intended
> > > > > solely for the
> > > > > >>use of the individual or entity named in this message. If
> > > > > you are not
> > > > > >>the intended recipient, and have received this message
> > > in error,
> > > > > >>please immediately return this by email and then delete it.
> > > > > >>
> > > > > >>
> > > > > >>>-----Original Message-----
> > > > > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > > > > >>>To: open-jpa-dev@incubator.apache.org
> > > > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > > > >>>
> > > > > >>>Can't cast List to Exception
> > > > > >>>
> > > > > >>>-----Original Message-----
> > > > > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > > >>>Sent: April 26, 2007 5:00 PM
> > > > > >>>To: open-jpa-dev@incubator.apache.org
> > > > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > > > >>>
> > > > > >>>So you're saying that the ResultList contains an
> Exception?
> > > > > >>>Can you post what you get if you do '((Exception)
> > > > > >>>results.get(0)).printStackTrace()'?
> > > > > >>>
> > > > > >>>-Patrick
> > > > > >>>
> > > > > >>>--
> > > > > >>>Patrick Linskey
> > > > > >>>BEA Systems, Inc.
> > > > >
> > >>>______________________________________________________________
> > > > > >>>_________
> > > > > >>>Notice: This email message, together with any
> > > attachments, may
> > > > > >>>contain information of BEA Systems, Inc., its
> > > > > subsidiaries and
> > > > > >>>affiliated entities, that may be confidential,
> > proprietary,
> > > > > >>>copyrighted and/or legally privileged, and is intended
> > > > > >>
> > > > > >>solely for the
> > > > > >>
> > > > > >>>use of the individual or entity named in this message. If
> > > > > >>
> > > > > >>you are not
> > > > > >>
> > > > > >>>the intended recipient, and have received this message
> > > in error,
> > > > > >>>please immediately return this by email and then delete it.
> > > > > >>>
> > > > > >>>
> > > > > >>>>-----Original Message-----
> > > > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > > > >>>>
> > > > > >>>>Some more information on this exception
> > > > > >>>>
> > > > > >>>>Right after the execution the exception held inside the
> > > > result is
> > > > > >>>>"com.sun.jdi.InvocationException occurred invoking
> > > > > >>
> > > > > >>method..." Can't
> > > > > >>
> > > > > >>>>seem to get more data out of it
> > > > > >>>>
> > > > > >>>>Once the system.out is executed the exception changes to
> > > > > >>>
> > > > > >>>"The result
> > > > > >>>
> > > > > >>>>list has been closed"
> > > > > >>>>
> > > > > >>>>-----Original Message-----
> > > > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > > >>>>Sent: April 26, 2007 4:18 PM
> > > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > > > >>>>
> > > > > >>>>I did not mean it threw an NPE but I was left with a null
> > > > > >>>
> > > > > >>>result list.
> > > > > >>>
> > > > > >>>>I have setup trace already and I actually get
> nothing back.
> > > > > >>>>Here is the trace across the execution point
> > > > > >>>>
> > > > > >>>>13734 WARN [main] openjpa.MetaData - Found
> > duplicate query
> > > > > >>>>"PersonFXLastFirst" in "class
> > ca.BidSpec.emall.user.Person".
> > > > > >>>>Ignoring.
> > > > > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > > > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > > > > >>>
> > > > > >>>t0.created,
> > > > > >>>
> > > > > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > > > > >>
> > > > > >>t0.locale,
> > > > > >>
> > > > > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > > > > >>
> > > > > >>t2.description,
> > > > > >>
> > > > > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > > > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > > > > >>
> > > > > >>t4.value, t1.id,
> > > > > >>
> > > > > >>>>t1.lastUpdated, t1.created, t1.description,
> t1.displayName,
> > > > > >>>
> > > > > >>>t1.name,
> > > > > >>>
> > > > > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > > > > >>
> > > > > >>t5.value,
> > > > > >>
> > > > > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> > > > manufacturer t1 ON
> > > > > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > > > > >>>
> > > > > >>>t0.roleFK =
> > > > > >>>
> > > > > >>>>t2.id LEFT OUTER JOIN category
> > > > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > > > >>>
> > > > > >>>ON t1.typeFK
> > > > > >>>
> > > > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > > > >>>
> > > > > >>>t2.categoryTypeFK = t3.id
> > > > > >>>
> > > > > >>>>WHERE
> > > > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > > > > >>>
> > > > > >>>t0.lastName
> > > > > >>>
> > > > > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > > > >>>>(String) PMORAN]
> > > > > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > > >>>>9575056> [15 ms] spent
> > > > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > > > >>>>person t0 INNER JOIN manufacturer t1 ON
> t0.manufacturerFK =
> > > > > >>>
> > > > > >>>t1.id LEFT
> > > > > >>>
> > > > > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > > > > >>
> > > > > >>JOIN category
> > > > > >>
> > > > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > > > >>>
> > > > > >>>ON t1.typeFK
> > > > > >>>
> > > > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > > > >>>
> > > > > >>>t2.categoryTypeFK = t3.id
> > > > > >>>
> > > > > >>>>WHERE
> > > > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > > > >>>>[params=(String) BIDSPEC,
> > > > > >>>>(String) PMORAN]
> > > > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > > >>>>9575056> [0 ms] spent
> > > > > >>>>1
> > > > > >>>>[2007-04-26 16:07:36,125] INFO
> > > > > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > > > > >>>
> > > > > >>>transaction after
> > > > > >>>
> > > > > >>>>test execution
> > > > > >>>>
> > > > > >>>>What is interesting is the line with a "1" (from
> > > > > >>>>System.out.println(results.size())). What this
> > > > represents is the
> > > > > >>>>message that the "result list is closed" nothing else in
> > > > > >>
> > > > > >>the trace.
> > > > > >>
> > > > > >>>>So what causes the result list to be closed?
> > > > > >>>>
> > > > > >>>>Phill
> > > > > >>>>
> > > > > >>>>-----Original Message-----
> > > > > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > > > > >>>
> > > > > >>>On Behalf
> > > > > >>>
> > > > > >>>>Of Marc Prud'hommeaux
> > > > > >>>>Sent: April 26, 2007 3:54 PM
> > > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > > > > >>>>
> > > > > >>>>Phill-
> > > > > >>>>
> > > > > >>>>The maximum verbosity of logging is obtained by
> > > specifying the
> > > > > >>>>"openjpa.Log"
> > > > > >>>>property to "DefaultLevel=TRACE".
> > > > > >>>>
> > > > > >>>>What is the full exception stack trace? We might be
> > > > able to help
> > > > > >>>>identify the problem. In any case OpenJPA should never be
> > > > > >>>
> > > > > >>>throwing an
> > > > > >>>
> > > > > >>>>NPE, so we should at least probably fix the error message.
> > > > > >>>>
> > > > > >>>>
> > > > > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > > > > >>>>
> > > > > >>>>
> > > > > >>>>>Community,
> > > > > >>>>>
> > > > > >>>>>How does one go about debugging object
> retrieval/creation.
> > > > > >>>>
> > > > > >>>>I continue
> > > > > >>>>
> > > > > >>>>>to have exceptions and little to go on as far as
> the cause.
> > > > > >>>>>The named JPQL is good since I know it generates
> a good sql
> > > > > >>>>
> > > > > >>>>(can trace
> > > > > >>>>
> > > > > >>>>>code and see it) . I know the sql is good as I can
> > > > > >>>>
> > > > > >>>>copy/paste it into
> > > > > >>>>
> > > > > >>>>>mysql query browser, execute and get the correct data
> > > > back. The
> > > > > >>>>>problem is that these lines result in an NPE.
> > > > > >>>>>
> > > > > >>>>> Query q =
> > > > > >>>>>
> > > > > >>
> > > > >
> > >
> >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > > > >>
> > > > > >>>>> q.setParameter("storeName",
> > > > > >>
> > > > > >>storeName.toUpperCase());
> > > > > >>
> > > > > >>>>> q.setParameter("loginName",
> > > > > >>
> > > > > >>loginName.toUpperCase());
> > > > > >>
> > > > > >>>>> List<Person> results = null;
> > > > > >>>>> try {
> > > > > >>>>> results = (List<Person>) q.getResultList();
> > > > > >>>>> System.out.println(results.size());
> > > > > >>>>> }
> > > > > >>>>> catch(Exception e) {
> > > > > >>>>> e.printStackTrace();
> > > > > >>>>> }
> > > > > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > > > > >>>>> throw new UserNotFoundException("No
> > > > > >>>>
> > > > > >>>>user found");
> > > > > >>>>
> > > > > >>>>> }
> > > > > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > > > > >>
> > > > > >>course how
> > > > > >>
> > > > > >>>>>would I know since I can find no description of
> what a good
> > > > > >>>>
> > > > > >>>>one looks
> > > > > >>>>
> > > > > >>>>>like but reading it (no
> > > > > >>>>>exceptions) seem to make sense.
> > > > > >>>>>
> > > > > >>>>>Any help would be much appreciated.
> > > > > >>>>>
> > > > > >>>>>Phill
> > > > > >>>>>
> > > > > >>>>
> > > > > >>>>
> > > > > >>>Notice: This email message, together with any
> > > attachments, may
> > > > > >>>contain information of BEA Systems, Inc., its
> > > > > subsidiaries and
> > > > > >>>affiliated entities, that may be confidential,
> > proprietary,
> > > > > >>>copyrighted and/or legally privileged, and is intended
> > > > > >>
> > > > > >>solely for the
> > > > > >>
> > > > > >>>use of the individual or entity named in this message. If
> > > > > >>
> > > > > >>you are not
> > > > > >>
> > > > > >>>the intended recipient, and have received this message
> > > in error,
> > > > > >>>please immediately return this by email and then delete it.
> > > > > >>>
> > > > > >>>
> > > > > >>
> > > > > >>Notice: This email message, together with any
> > attachments, may
> > > > > >>contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > > >>affiliated entities, that may be confidential,
> proprietary,
> > > > > >>copyrighted and/or legally privileged, and is intended
> > > > > solely for the
> > > > > >>use of the individual or entity named in this message. If
> > > > > you are not
> > > > > >>the intended recipient, and have received this message
> > > in error,
> > > > > >>please immediately return this by email and then delete it.
> > > > > >>
> > > > > >>
> > > > > >
> > > > > >
> > > > > > Notice: This email message, together with any
> > attachments, may
> > > > > > contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > > > affiliated entities, that may be confidential,
> proprietary,
> > > > > > copyrighted and/or legally privileged, and is intended
> > > > > solely for the
> > > > > > use of the individual or entity named in this message. If
> > > > > you are not
> > > > > > the intended recipient, and have received this message
> > > in error,
> > > > > > please
> > > > > immediately return this by email and then delete it.
> > > > > >
> > > > >
> > > > >
> > > >
> > > > Notice: This email message, together with any attachments, may
> > > > contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > > affiliated entities, that may be confidential, proprietary,
> > > > copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > > use of the individual or entity named in this message. If
> > > you are not
> > > > the intended recipient, and have received this message
> in error,
> > > > please immediately return this by email and then delete it.
> > > >
> > > >
> > >
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please immediately return this by email and then delete it.
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its
> subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments,
> may contain
> information of BEA Systems, Inc., its subsidiaries and
> affiliated
> entities, that may be confidential, proprietary,
> copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named
> in this message. If you are not the intended recipient, and
> have received this
> message in error, please immediately return this by email and
> then delete it.
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
This looks to be the problem (thanks Abe) It has caused another exception to
come up but let me look into it and see the cause.
You were right though I was issuing a .clear() on a null pointer in the set
method.
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 30, 2007 3:52 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
> That is the original method with a new name. As the documentation
> states, the getters and setters used in property access may appear
> with a "pc" prefix in stack traces under OpenJPA.
What's the rationale behind this? It seems like this will inevitably make
debugging of problems more of a challenge, since the user's own method names
will no longer match up.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Abe White [mailto:awhite@bea.com]
> Sent: Monday, April 30, 2007 12:29 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> >> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
> >
> > I had read this and assumed that it was an
> OpenJPA-generated method,
> > but if so, there shouldn't be a line number. Did you
> reverse-compile
> > your classes at some point and change the synthetic interception
> > methods?
>
> That is the original method with a new name. As the documentation
> states, the getters and setters used in property access may appear
> with a "pc" prefix in stack traces under OpenJPA.
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
> That is the original method with a new name. As the
> documentation states, the getters and setters used in
> property access may appear with a "pc" prefix in stack traces
> under OpenJPA.
What's the rationale behind this? It seems like this will inevitably
make debugging of problems more of a challenge, since the user's own
method names will no longer match up.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Abe White [mailto:awhite@bea.com]
> Sent: Monday, April 30, 2007 12:29 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> >> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
> >
> > I had read this and assumed that it was an
> OpenJPA-generated method,
> > but if so, there shouldn't be a line number. Did you
> reverse-compile
> > your classes at some point and change the synthetic interception
> > methods?
>
> That is the original method with a new name. As the
> documentation states, the getters and setters used in
> property access may appear with a "pc" prefix in stack traces
> under OpenJPA.
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
> documentation states, the getters and setters used in
> property access may appear with a "pc" prefix in stack traces
> under OpenJPA.
Ah yes... I always forget about property access.
Phill: are you using property access? If so, can you post what you're
doing in your business logic in those methods? When using property
access, OpenJPA must use your setters and getters to access the
persistent state of your objects, so some of your business-level
invariants on the method arguments may not be adhered to by OpenJPA.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Abe White [mailto:awhite@bea.com]
> Sent: Monday, April 30, 2007 12:29 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> >> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
> >
> > I had read this and assumed that it was an
> OpenJPA-generated method,
> > but if so, there shouldn't be a line number. Did you
> reverse-compile
> > your classes at some point and change the synthetic interception
> > methods?
>
> That is the original method with a new name. As the
> documentation states, the getters and setters used in
> property access may appear with a "pc" prefix in stack traces
> under OpenJPA.
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
Re: How to debug object retrieveal in JPA?
Posted by Abe White <aw...@bea.com>.
>> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
>
> I had read this and assumed that it was an OpenJPA-generated
> method, but
> if so, there shouldn't be a line number. Did you reverse-compile your
> classes at some point and change the synthetic interception methods?
That is the original method with a new name. As the documentation
states, the getters and setters used in property access may appear
with a "pc" prefix in stack traces under OpenJPA.
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
I had read this and assumed that it was an OpenJPA-generated method, but
if so, there shouldn't be a line number. Did you reverse-compile your
classes at some point and change the synthetic interception methods?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Abe White [mailto:awhite@bea.com]
> Sent: Monday, April 30, 2007 12:22 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
>
> > Caused by: java.lang.NullPointerException
> > at java.util.ArrayList.addAll(ArrayList.java:472)
> > at
> ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
> > at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > at
> >
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:121)
>
> There you go. OpenJPA is clearing the instance state as part
> of its initialization routine, and that's causing a
> NullPointerException in your setter at Person.java line 727.
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
Re: How to debug object retrieveal in JPA?
Posted by Abe White <aw...@bea.com>.
> Caused by: java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:472)
> at ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:121)
There you go. OpenJPA is clearing the instance state as part of its
initialization routine, and that's causing a NullPointerException in
your setter at Person.java line 727.
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
This is all I get:
<0.9.7-incubating nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:857)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:756)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:776)
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:257)
at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2152)
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:251)
at
org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(Inst
anceResultObjectProvider.java:59)
at
org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:13
1)
at
org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(AbstractNonSequen
tialResultList.java:72)
at
org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultList.java:244
)
at
ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(PersonFactoryI
mpl.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:304)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:139)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:107)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:161)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:203)
at $Proxy34.getLoginPersonValueObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:304)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:139)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:107)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:161)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:203)
at $Proxy34.getLoginPersonValueObject(Unknown Source)
at
ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactoryTest.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69
)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ac
cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.
run(AbstractAnnotationAwareTransactionalTests.java:115)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nTest(AbstractAnnotationAwareTransactionalTests.java:180)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nBare(AbstractAnnotationAwareTransactionalTests.java:111)
at
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159)
at
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at
org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java
:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunne
r.java:34)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
ce.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:196)
Caused by: java.lang.NullPointerException
at java.util.ArrayList.addAll(ArrayList.java:472)
at ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
at
org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:121)
at
org.apache.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:250)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager
.java:330)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java
:255)
at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManag
er.java:111)
at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:876)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:834)
... 64 more
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 30, 2007 2:41 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
Can you post the current full exception + any nested exceptions and their nested
exceptions and their nested exceptions and so on? I think that that data is
already in this thread, but I just want to confirm that things are still the
same as they were.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 11:13 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Sure here it is and the sql it generates. BTW the SQL works as I can
> execute it in MySQL query browser and get the record back I am after.
> Does it matter that I am after a single record? I don't specify the
> single records expected response (since it could be larger but
> currently in test it is only 1)
>
> @NamedQuery(name = "PersonFXStoreAndLogin", query = "SELECT p FROM
> Person p WHERE UPPER(p.store.name) = :storeName and
> UPPER(p.loginName) = :loginName ORDER BY p.lastName, p.firstName") })
>
> SQL:
> 37391 BidSpecPersistenceUnit TRACE [main] openjpa.jdbc.SQL
> - <t 2860004, conn
> 24859001> executing prepstmnt 31775072 SELECT t0.id, t0.version,
> 24859001> t0.lastUpdated,
> t0.active, t0.activeFrom, t0.activeUntil, t0.created, t0.displayName,
> t0.firstName, t0.lastLogin, t0.lastName, t0.locale, t0.loginName,
> t0.middleName, t2.id, t2.version, t2.lastUpdated, t2.description,
> t3.id, t3.version, t3.lastUpdated, t3.description, t2.value, t4.id,
> t4.version, t4.lastUpdated, t4.description, t4.categoryTypeFK,
> t4.value, t1.id, t1.version, t1.lastUpdated, t1.created,
> t1.description, t1.displayName, t1.name, t5.id, t5.version,
> t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value, t0.title,
> t0.visible FROM person t0 INNER JOIN manufacturer
> t1 ON t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> t0.roleFK = t2.id LEFT OUTER JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK
> = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
> WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName
> ASC, t0.firstName ASC [params=(String) BIDSPEC,
> (String) PMORAN]
>
> The initial excpetion is :
> Error Exception occurred: com.sun.jdi.InvocationException
> occurred invoking
> method..
>
> Here is the method that causes the problem
> public Person getLoginPersonValueObject(String storeName, String
> loginName)
> throws PersonValueObjectNotFoundException,
> UserNotActiveException,
> UserNotFoundException {
> Query q =
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> q.setParameter("storeName", storeName.toUpperCase());
> q.setParameter("loginName", loginName.toUpperCase());
> List<Person> results = null;
> try {
> results = (List<Person>) q.getResultList();
> System.out.println(results.get(0));
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> if (results.isEmpty()) {
> throw new UserNotFoundException("No user found");
> }
> if (results.size() > 1) {
> throw new PersonValueObjectNotFoundException(
> "returned multiple
> login name for same store. StoreName=" + storeName
> + ",
> loginName=" +
> loginName);
> }
> Person person = results.iterator().next();
> if (!person.isActive()) {
> throw new UserNotActiveException();
> }
> return person;
> }
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 2:01 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Odd indeed. Can you post your named query definition?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 10:55 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Hard to pull this little piece (of a much larger one) and
> package it.
> > Let me tool around some more and see if I can uncover more. What is
> > odd is not all my JPA classes have this problem but all
> inherit from
> > the same base and are fairly similar. I will try commenting
> out parts
> > of it and see if it clears. IF not I will have to package and send
> > along
> >
> > Phill
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 30, 2007 1:45 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Odd. Any chance of packaging it up and attaching it to a JIRA issue?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Monday, April 30, 2007 10:37 AM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > I upgraded and result stayed the same. Also this is in a spring
> > > transaction. In fact these are all part of JUnit tests.
> > >
> > > -----Original Message-----
> > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > Sent: April 30, 2007 12:05 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > It looks like this exception is different than the
> others; it looks
> > > like this exception is actually being thrown, rather than
> being put
> > > into your result list.
> > > Is that correct?
> > >
> > > Is this something that you could package up as a test case?
> > > Also, I seem to remember some sort of issue with
> > overly-eager result
> > > list closing in non-transactional environments in 0.9.6,
> > but I can't
> > > find a related JIRA issue.
> > > It's possible that moving up to 0.9.7 (released Friday;
> > > http://cwiki.apache.org/openjpa/downloads.html) might get
> > around the
> > > problem.
> > >
> > > -Patrick
> > >
> > > --
> > > Patrick Linskey
> > > BEA Systems, Inc.
> > > ______________________________________________________________
> > > _________
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please immediately return this by email and then delete it.
> > >
> > > > -----Original Message-----
> > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > Sent: Monday, April 30, 2007 7:28 AM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > > Anyone have any more suggestions on how to debug this?
> > > >
> > > > -----Original Message-----
> > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > Sent: April 26, 2007 11:20 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > > I don't close it in anyway directly
> > > >
> > > > -----Original Message-----
> > > > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > > > Sent: April 26, 2007 11:16 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: Re: How to debug object retrieveal in JPA?
> > > >
> > > > Can it be that there is a glue code that closes EM in
> > > between? Just a
> > > > thought...
> > > >
> > > > -marina
> > > >
> > > > Phill Moran wrote:
> > > > > I had suspected the Locale so I made a set/getLocale that
> > > > communicate
> > > > > in
> > > > String.
> > > > > I figured that openJPA does not actually care how I implement.
> > > > >
> > > > > But for this run I removed it completely and did a clean
> > > > rebuild. Good
> > > > > news and bad the exception changed:
> > > > >
> > > > >
> > > > > java.util.NoSuchElementException: The result list has
> > been closed.
> > > > > at
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > > > tList.java
> > > > > :91)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > > > tNonSequen
> > > > > tialResultList.java:68)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > > > t.java:241
> > > > > )
> > > > > at
> > > > >
> > > >
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > > > onFactoryI
> > > > > mpl.java:99)
> > > > > at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > at
> > > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > orImpl.java:39)
> > > > > at
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > orImpl.jav
> > > > > a:25)
> > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > > n(AopUtils
> > > > > .java:304)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > > npoint(Ref
> > > > > lectiveMethodInvocation.java:172)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:139)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > > oke(Transa
> > > > > ctionInterceptor.java:107)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:161)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > > AopProxy.j
> > > > > ava:203)
> > > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > at
> > > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > orImpl.java:39)
> > > > > at
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > orImpl.jav
> > > > > a:25)
> > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > > n(AopUtils
> > > > > .java:304)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > > npoint(Ref
> > > > > lectiveMethodInvocation.java:172)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:139)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > > oke(Transa
> > > > > ctionInterceptor.java:107)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:161)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > > AopProxy.j
> > > > > ava:203)
> > > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > at
> > > > >
> > > > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > > yTest.java:119)
> > > > > at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > at
> > > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > orImpl.java:39)
> > > > > at
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > orImpl.jav
> > > > > a:25)
> > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > > > se.java:69
> > > > > )
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ac
> > > > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > > at
> > > > >
> > > > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > nsactionalTests$1.
> > > > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ru
> > > > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ru
> > > > > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ru
> > > > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > > at
> > > > >
> > > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > JpaTests.java:159)
> > > > > at
> > > > >
> > > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > JpaTests.java:239)
> > > > > at
> > junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > > at
> > junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > > at junit.framework.TestResult.run(TestResult.java:113)
> > > > > at junit.framework.TestCase.run(TestCase.java:124)
> > > > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > > at
> > > > >
> > > > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > > Runner.java:35)
> > > > > at
> > > > >
> > > > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > > .java:29)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > > > unner.java
> > > > > :42)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > > > AfterRunne
> > > > > r.java:34)
> > > > > at
> > > > >
> > > > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > > .java:52)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > > > estReferen
> > > > > ce.java:38)
> > > > > at
> > > > >
> > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > > ecution.java:38)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > > TestRunner
> > > > > .java:460)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > > TestRunner
> > > > > .java:673)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > > > unner.java
> > > > > :386)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > > > Runner.jav
> > > > > a:196)
> > > > >
> > > > > -----Original Message-----
> > > > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > > Sent: April 26, 2007 9:59 PM
> > > > > To: open-jpa-dev@incubator.apache.org
> > > > > Subject: RE: How to debug object retrieveal in JPA?
> > > > >
> > > > >
> > > > >>Caused by: java.lang.NullPointerException
> > > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > > >> at java.util.Locale.<init>(Locale.java:272)
> > > > >> at java.util.Locale.<init>(Locale.java:302)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > > >> at
> > > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > > .java:117)
> > > > >
> > > > >
> > > > > Now we're getting somewhere.... what happens if you remove
> > > > the Locale
> > > > > field from the Person class?
> > > > >
> > > > > -Patrick
> > > > >
> > > > > --
> > > > > Patrick Linskey
> > > > > BEA Systems, Inc.
> > > > >
> > > >
> > >
> >
> ______________________________________________________________________
> > > > > _
> > > > > Notice: This email message, together with any
> attachments, may
> > > > > contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > > affiliated entities, that may be confidential, proprietary,
> > > > > copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > > use of the individual or entity named in this message. If
> > > > you are not
> > > > > the intended recipient, and have received this message
> > in error,
> > > > > please
> > > > immediately return this by email and then delete it.
> > > > >
> > > > >
> > > > >>-----Original Message-----
> > > > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>Sent: Thursday, April 26, 2007 6:32 PM
> > > > >>To: open-jpa-dev@incubator.apache.org
> > > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>
> > > > >>Run that config gives us this lovely message:
> > > > >>
> > > > >><0|false|0.9.6-incubating>
> > > > >>org.apache.openjpa.persistence.PersistenceException:
> > > > >>null
> > > > >> at
> > > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > > > >>Manager.java:773)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > > >>.java:254)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > > > >>tImpl.java:2115)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > > >>.java:248)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > > > >>tResultObject(Inst
> > > > >>anceResultObjectProvider.java:56)
> > > > >> at
> > > > >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > > > >>ResultList.java:12
> > > > >>8)
> > > > >> at
> > > > >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > > > >>(AbstractNonSequen
> > > > >>tialResultList.java:69)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > > > >>esultList.java:241
> > > > >>)
> > > > >> at
> > > > >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > > > >>ect(PersonFactoryI
> > > > >>mpl.java:99)
> > > > >> at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >> at
> > > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > >>orImpl.java:39)
> > > > >> at
> > > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > >>odAccessorImpl.jav
> > > > >>a:25)
> > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >> at
> > > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > > >>eflection(AopUtils
> > > > >>.java:304)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > > >>nvokeJoinpoint(Ref
> > > > >>lectiveMethodInvocation.java:172)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:139)
> > > > >> at
> > > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > > >>ptor.invoke(Transa
> > > > >>ctionInterceptor.java:107)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:161)
> > > > >> at
> > > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > > >>kDynamicAopProxy.j
> > > > >>ava:203)
> > > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > >> at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >> at
> > > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > >>orImpl.java:39)
> > > > >> at
> > > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > >>odAccessorImpl.jav
> > > > >>a:25)
> > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >> at
> > > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > > >>eflection(AopUtils
> > > > >>.java:304)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > > >>nvokeJoinpoint(Ref
> > > > >>lectiveMethodInvocation.java:172)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:139)
> > > > >> at
> > > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > > >>ptor.invoke(Transa
> > > > >>ctionInterceptor.java:107)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:161)
> > > > >> at
> > > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > > >>kDynamicAopProxy.j
> > > > >>ava:203)
> > > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > >> at
> > > > >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > > >>yTest.java:119)
> > > > >> at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >> at
> > > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > >>orImpl.java:39)
> > > > >> at
> > > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > >>odAccessorImpl.jav
> > > > >>a:25)
> > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > >> at
> > > > >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > > > >>alTestCase.java:69
> > > > >>)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ac
> > > > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests$1.
> > > > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ru
> > > > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ru
> > > > >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ru
> > > > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > >> at
> > > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > >>JpaTests.java:159)
> > > > >> at
> > > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > >>JpaTests.java:239)
> > > > >> at
> > junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > >> at
> > junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > >> at junit.framework.TestResult.run(TestResult.java:113)
> > > > >> at junit.framework.TestCase.run(TestCase.java:124)
> > > > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > >> at
> > > > >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > > >>Runner.java:35)
> > > > >> at
> > > > >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > > >>.java:29)
> > > > >> at
> > > > >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > > > >>stClassRunner.java
> > > > >>:42)
> > > > >> at
> > > > >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > > > >>eforeAndAfterRunne
> > > > >>r.java:34)
> > > > >> at
> > > > >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > > >>.java:52)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > > > >>(JUnit4TestReferen
> > > > >>ce.java:38)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > > >>ecution.java:38)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > > >>s(RemoteTestRunner
> > > > >>.java:460)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > > >>s(RemoteTestRunner
> > > > >>.java:673)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > > > >>oteTestRunner.java
> > > > >>:386)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > > > >>moteTestRunner.jav
> > > > >>a:196)
> > > > >>Caused by: java.lang.NullPointerException
> > > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > > >> at java.util.Locale.<init>(Locale.java:272)
> > > > >> at java.util.Locale.<init>(Locale.java:302)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > > >> at
> > > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > > .java:117)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > > > >>agerImpl.java:247)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > > > >>e(JDBCStoreManager
> > > > >>.java:327)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > > > >>CStoreManager.java
> > > > >>:252)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > > > >>legatingStoreManag
> > > > >>er.java:108)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > > > >>anager.java:54)
> > > > >> at
> > > >
> > >
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > > > >> ... 64 more
> > > > >>
> > > > >>-----Original Message-----
> > > > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > >>Sent: April 26, 2007 5:40 PM
> > > > >>To: open-jpa-dev@incubator.apache.org
> > > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>
> > > > >>
> > > > >>>Can you post what you get if you do '((Exception)
> > > > >>>results.get(0)).printStackTrace()'?
> > > > >>
> > > > >>... so results.get(0) is returning a List? That's very odd.
> > > > >>What if you
> > > > >>do:
> > > > >>
> > > > >>System.out.println(results.get(0))?
> > > > >>
> > > > >>If it is a List of Exceptions, what if you print out the
> > > > stacks of the
> > > > >>exceptions in the list?
> > > > >>
> > > > >>-Patrick
> > > > >>
> > > > >>--
> > > > >>Patrick Linskey
> > > > >>BEA Systems, Inc.
> > > > >>______________________________________________________________
> > > > >>_________
> > > > >>Notice: This email message, together with any
> attachments, may
> > > > >>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > >>affiliated entities, that may be confidential, proprietary,
> > > > >>copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > >>use of the individual or entity named in this message. If
> > > > you are not
> > > > >>the intended recipient, and have received this message
> > in error,
> > > > >>please immediately return this by email and then delete it.
> > > > >>
> > > > >>
> > > > >>>-----Original Message-----
> > > > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > > > >>>To: open-jpa-dev@incubator.apache.org
> > > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>
> > > > >>>Can't cast List to Exception
> > > > >>>
> > > > >>>-----Original Message-----
> > > > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > >>>Sent: April 26, 2007 5:00 PM
> > > > >>>To: open-jpa-dev@incubator.apache.org
> > > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>
> > > > >>>So you're saying that the ResultList contains an Exception?
> > > > >>>Can you post what you get if you do '((Exception)
> > > > >>>results.get(0)).printStackTrace()'?
> > > > >>>
> > > > >>>-Patrick
> > > > >>>
> > > > >>>--
> > > > >>>Patrick Linskey
> > > > >>>BEA Systems, Inc.
> > > >
> >>>______________________________________________________________
> > > > >>>_________
> > > > >>>Notice: This email message, together with any
> > attachments, may
> > > > >>>contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > >>>affiliated entities, that may be confidential,
> proprietary,
> > > > >>>copyrighted and/or legally privileged, and is intended
> > > > >>
> > > > >>solely for the
> > > > >>
> > > > >>>use of the individual or entity named in this message. If
> > > > >>
> > > > >>you are not
> > > > >>
> > > > >>>the intended recipient, and have received this message
> > in error,
> > > > >>>please immediately return this by email and then delete it.
> > > > >>>
> > > > >>>
> > > > >>>>-----Original Message-----
> > > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>>
> > > > >>>>Some more information on this exception
> > > > >>>>
> > > > >>>>Right after the execution the exception held inside the
> > > result is
> > > > >>>>"com.sun.jdi.InvocationException occurred invoking
> > > > >>
> > > > >>method..." Can't
> > > > >>
> > > > >>>>seem to get more data out of it
> > > > >>>>
> > > > >>>>Once the system.out is executed the exception changes to
> > > > >>>
> > > > >>>"The result
> > > > >>>
> > > > >>>>list has been closed"
> > > > >>>>
> > > > >>>>-----Original Message-----
> > > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>>>Sent: April 26, 2007 4:18 PM
> > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>>
> > > > >>>>I did not mean it threw an NPE but I was left with a null
> > > > >>>
> > > > >>>result list.
> > > > >>>
> > > > >>>>I have setup trace already and I actually get nothing back.
> > > > >>>>Here is the trace across the execution point
> > > > >>>>
> > > > >>>>13734 WARN [main] openjpa.MetaData - Found
> duplicate query
> > > > >>>>"PersonFXLastFirst" in "class
> ca.BidSpec.emall.user.Person".
> > > > >>>>Ignoring.
> > > > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > > > >>>
> > > > >>>t0.created,
> > > > >>>
> > > > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > > > >>
> > > > >>t0.locale,
> > > > >>
> > > > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > > > >>
> > > > >>t2.description,
> > > > >>
> > > > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > > > >>
> > > > >>t4.value, t1.id,
> > > > >>
> > > > >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > > > >>>
> > > > >>>t1.name,
> > > > >>>
> > > > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > > > >>
> > > > >>t5.value,
> > > > >>
> > > > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> > > manufacturer t1 ON
> > > > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > > > >>>
> > > > >>>t0.roleFK =
> > > > >>>
> > > > >>>>t2.id LEFT OUTER JOIN category
> > > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > > >>>
> > > > >>>ON t1.typeFK
> > > > >>>
> > > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > > >>>
> > > > >>>t2.categoryTypeFK = t3.id
> > > > >>>
> > > > >>>>WHERE
> > > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > > > >>>
> > > > >>>t0.lastName
> > > > >>>
> > > > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > > >>>>(String) PMORAN]
> > > > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> [15 ms] spent
> > > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > > >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > > > >>>
> > > > >>>t1.id LEFT
> > > > >>>
> > > > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > > > >>
> > > > >>JOIN category
> > > > >>
> > > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > > >>>
> > > > >>>ON t1.typeFK
> > > > >>>
> > > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > > >>>
> > > > >>>t2.categoryTypeFK = t3.id
> > > > >>>
> > > > >>>>WHERE
> > > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > > >>>>[params=(String) BIDSPEC,
> > > > >>>>(String) PMORAN]
> > > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> [0 ms] spent
> > > > >>>>1
> > > > >>>>[2007-04-26 16:07:36,125] INFO
> > > > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > > > >>>
> > > > >>>transaction after
> > > > >>>
> > > > >>>>test execution
> > > > >>>>
> > > > >>>>What is interesting is the line with a "1" (from
> > > > >>>>System.out.println(results.size())). What this
> > > represents is the
> > > > >>>>message that the "result list is closed" nothing else in
> > > > >>
> > > > >>the trace.
> > > > >>
> > > > >>>>So what causes the result list to be closed?
> > > > >>>>
> > > > >>>>Phill
> > > > >>>>
> > > > >>>>-----Original Message-----
> > > > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > > > >>>
> > > > >>>On Behalf
> > > > >>>
> > > > >>>>Of Marc Prud'hommeaux
> > > > >>>>Sent: April 26, 2007 3:54 PM
> > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > > > >>>>
> > > > >>>>Phill-
> > > > >>>>
> > > > >>>>The maximum verbosity of logging is obtained by
> > specifying the
> > > > >>>>"openjpa.Log"
> > > > >>>>property to "DefaultLevel=TRACE".
> > > > >>>>
> > > > >>>>What is the full exception stack trace? We might be
> > > able to help
> > > > >>>>identify the problem. In any case OpenJPA should never be
> > > > >>>
> > > > >>>throwing an
> > > > >>>
> > > > >>>>NPE, so we should at least probably fix the error message.
> > > > >>>>
> > > > >>>>
> > > > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > > > >>>>
> > > > >>>>
> > > > >>>>>Community,
> > > > >>>>>
> > > > >>>>>How does one go about debugging object retrieval/creation.
> > > > >>>>
> > > > >>>>I continue
> > > > >>>>
> > > > >>>>>to have exceptions and little to go on as far as the cause.
> > > > >>>>>The named JPQL is good since I know it generates a good sql
> > > > >>>>
> > > > >>>>(can trace
> > > > >>>>
> > > > >>>>>code and see it) . I know the sql is good as I can
> > > > >>>>
> > > > >>>>copy/paste it into
> > > > >>>>
> > > > >>>>>mysql query browser, execute and get the correct data
> > > back. The
> > > > >>>>>problem is that these lines result in an NPE.
> > > > >>>>>
> > > > >>>>> Query q =
> > > > >>>>>
> > > > >>
> > > >
> > >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > > >>
> > > > >>>>> q.setParameter("storeName",
> > > > >>
> > > > >>storeName.toUpperCase());
> > > > >>
> > > > >>>>> q.setParameter("loginName",
> > > > >>
> > > > >>loginName.toUpperCase());
> > > > >>
> > > > >>>>> List<Person> results = null;
> > > > >>>>> try {
> > > > >>>>> results = (List<Person>) q.getResultList();
> > > > >>>>> System.out.println(results.size());
> > > > >>>>> }
> > > > >>>>> catch(Exception e) {
> > > > >>>>> e.printStackTrace();
> > > > >>>>> }
> > > > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > > > >>>>> throw new UserNotFoundException("No
> > > > >>>>
> > > > >>>>user found");
> > > > >>>>
> > > > >>>>> }
> > > > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > > > >>
> > > > >>course how
> > > > >>
> > > > >>>>>would I know since I can find no description of what a good
> > > > >>>>
> > > > >>>>one looks
> > > > >>>>
> > > > >>>>>like but reading it (no
> > > > >>>>>exceptions) seem to make sense.
> > > > >>>>>
> > > > >>>>>Any help would be much appreciated.
> > > > >>>>>
> > > > >>>>>Phill
> > > > >>>>>
> > > > >>>>
> > > > >>>>
> > > > >>>Notice: This email message, together with any
> > attachments, may
> > > > >>>contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > >>>affiliated entities, that may be confidential,
> proprietary,
> > > > >>>copyrighted and/or legally privileged, and is intended
> > > > >>
> > > > >>solely for the
> > > > >>
> > > > >>>use of the individual or entity named in this message. If
> > > > >>
> > > > >>you are not
> > > > >>
> > > > >>>the intended recipient, and have received this message
> > in error,
> > > > >>>please immediately return this by email and then delete it.
> > > > >>>
> > > > >>>
> > > > >>
> > > > >>Notice: This email message, together with any
> attachments, may
> > > > >>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > >>affiliated entities, that may be confidential, proprietary,
> > > > >>copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > >>use of the individual or entity named in this message. If
> > > > you are not
> > > > >>the intended recipient, and have received this message
> > in error,
> > > > >>please immediately return this by email and then delete it.
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > > Notice: This email message, together with any
> attachments, may
> > > > > contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > > affiliated entities, that may be confidential, proprietary,
> > > > > copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > > use of the individual or entity named in this message. If
> > > > you are not
> > > > > the intended recipient, and have received this message
> > in error,
> > > > > please
> > > > immediately return this by email and then delete it.
> > > > >
> > > >
> > > >
> > >
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please immediately return this by email and then delete it.
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
Can you post the current full exception + any nested exceptions and
their nested exceptions and their nested exceptions and so on? I think
that that data is already in this thread, but I just want to confirm
that things are still the same as they were.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 11:13 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Sure here it is and the sql it generates. BTW the SQL works
> as I can execute it in MySQL query browser and get the record
> back I am after. Does it matter that I am after a single
> record? I don't specify the single records expected response
> (since it could be larger but currently in test it is only 1)
>
> @NamedQuery(name = "PersonFXStoreAndLogin", query = "SELECT p
> FROM Person p WHERE UPPER(p.store.name) = :storeName and
> UPPER(p.loginName) = :loginName ORDER BY p.lastName, p.firstName") })
>
> SQL:
> 37391 BidSpecPersistenceUnit TRACE [main] openjpa.jdbc.SQL
> - <t 2860004, conn
> 24859001> executing prepstmnt 31775072 SELECT t0.id, t0.version,
> 24859001> t0.lastUpdated,
> t0.active, t0.activeFrom, t0.activeUntil, t0.created,
> t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> t0.locale, t0.loginName, t0.middleName, t2.id, t2.version,
> t2.lastUpdated, t2.description, t3.id, t3.version,
> t3.lastUpdated, t3.description, t2.value, t4.id, t4.version,
> t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value,
> t1.id, t1.version, t1.lastUpdated, t1.created,
> t1.description, t1.displayName, t1.name, t5.id, t5.version,
> t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value,
> t0.title, t0.visible FROM person t0 INNER JOIN manufacturer
> t1 ON t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2
> ON t0.roleFK = t2.id LEFT OUTER JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON
> t1.typeFK = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> t0.lastName ASC, t0.firstName ASC [params=(String) BIDSPEC,
> (String) PMORAN]
>
> The initial excpetion is :
> Error Exception occurred: com.sun.jdi.InvocationException
> occurred invoking
> method..
>
> Here is the method that causes the problem
> public Person getLoginPersonValueObject(String storeName, String
> loginName)
> throws PersonValueObjectNotFoundException,
> UserNotActiveException,
> UserNotFoundException {
> Query q =
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> q.setParameter("storeName", storeName.toUpperCase());
> q.setParameter("loginName", loginName.toUpperCase());
> List<Person> results = null;
> try {
> results = (List<Person>) q.getResultList();
> System.out.println(results.get(0));
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> if (results.isEmpty()) {
> throw new UserNotFoundException("No
> user found");
> }
> if (results.size() > 1) {
> throw new PersonValueObjectNotFoundException(
> "returned multiple
> login name for same store. StoreName=" + storeName
> + ",
> loginName=" +
> loginName);
> }
> Person person = results.iterator().next();
> if (!person.isActive()) {
> throw new UserNotActiveException();
> }
> return person;
> }
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 2:01 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Odd indeed. Can you post your named query definition?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 10:55 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Hard to pull this little piece (of a much larger one) and
> package it.
> > Let me tool around some more and see if I can uncover more. What is
> > odd is not all my JPA classes have this problem but all
> inherit from
> > the same base and are fairly similar. I will try commenting
> out parts
> > of it and see if it clears. IF not I will have to package and send
> > along
> >
> > Phill
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 30, 2007 1:45 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Odd. Any chance of packaging it up and attaching it to a JIRA issue?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Monday, April 30, 2007 10:37 AM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > I upgraded and result stayed the same. Also this is in a spring
> > > transaction. In fact these are all part of JUnit tests.
> > >
> > > -----Original Message-----
> > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > Sent: April 30, 2007 12:05 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > It looks like this exception is different than the
> others; it looks
> > > like this exception is actually being thrown, rather than
> being put
> > > into your result list.
> > > Is that correct?
> > >
> > > Is this something that you could package up as a test case?
> > > Also, I seem to remember some sort of issue with
> > overly-eager result
> > > list closing in non-transactional environments in 0.9.6,
> > but I can't
> > > find a related JIRA issue.
> > > It's possible that moving up to 0.9.7 (released Friday;
> > > http://cwiki.apache.org/openjpa/downloads.html) might get
> > around the
> > > problem.
> > >
> > > -Patrick
> > >
> > > --
> > > Patrick Linskey
> > > BEA Systems, Inc.
> > > ______________________________________________________________
> > > _________
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please immediately return this by email and then delete it.
> > >
> > > > -----Original Message-----
> > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > Sent: Monday, April 30, 2007 7:28 AM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > > Anyone have any more suggestions on how to debug this?
> > > >
> > > > -----Original Message-----
> > > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > Sent: April 26, 2007 11:20 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > > I don't close it in anyway directly
> > > >
> > > > -----Original Message-----
> > > > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > > > Sent: April 26, 2007 11:16 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: Re: How to debug object retrieveal in JPA?
> > > >
> > > > Can it be that there is a glue code that closes EM in
> > > between? Just a
> > > > thought...
> > > >
> > > > -marina
> > > >
> > > > Phill Moran wrote:
> > > > > I had suspected the Locale so I made a set/getLocale that
> > > > communicate
> > > > > in
> > > > String.
> > > > > I figured that openJPA does not actually care how I implement.
> > > > >
> > > > > But for this run I removed it completely and did a clean
> > > > rebuild. Good
> > > > > news and bad the exception changed:
> > > > >
> > > > >
> > > > > java.util.NoSuchElementException: The result list has
> > been closed.
> > > > > at
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > > > tList.java
> > > > > :91)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > > > tNonSequen
> > > > > tialResultList.java:68)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > > > t.java:241
> > > > > )
> > > > > at
> > > > >
> > > >
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > > > onFactoryI
> > > > > mpl.java:99)
> > > > > at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > at
> > > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > orImpl.java:39)
> > > > > at
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > orImpl.jav
> > > > > a:25)
> > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > > n(AopUtils
> > > > > .java:304)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > > npoint(Ref
> > > > > lectiveMethodInvocation.java:172)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:139)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > > oke(Transa
> > > > > ctionInterceptor.java:107)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:161)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > > AopProxy.j
> > > > > ava:203)
> > > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > at
> > > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > orImpl.java:39)
> > > > > at
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > orImpl.jav
> > > > > a:25)
> > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > > n(AopUtils
> > > > > .java:304)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > > npoint(Ref
> > > > > lectiveMethodInvocation.java:172)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:139)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > > oke(Transa
> > > > > ctionInterceptor.java:107)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > > eflectiveM
> > > > > ethodInvocation.java:161)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > > AopProxy.j
> > > > > ava:203)
> > > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > > at
> > > > >
> > > > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > > yTest.java:119)
> > > > > at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > > at
> > > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > orImpl.java:39)
> > > > > at
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > > orImpl.jav
> > > > > a:25)
> > > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > > > se.java:69
> > > > > )
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ac
> > > > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > > at
> > > > >
> > > > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > nsactionalTests$1.
> > > > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ru
> > > > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ru
> > > > > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > > alTests.ru
> > > > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > > at
> > > > >
> > > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > JpaTests.java:159)
> > > > > at
> > > > >
> > > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > JpaTests.java:239)
> > > > > at
> > junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > > at
> > junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > > at junit.framework.TestResult.run(TestResult.java:113)
> > > > > at junit.framework.TestCase.run(TestCase.java:124)
> > > > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > > at
> > > > >
> > > > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > > Runner.java:35)
> > > > > at
> > > > >
> > > > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > > .java:29)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > > > unner.java
> > > > > :42)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > > > AfterRunne
> > > > > r.java:34)
> > > > > at
> > > > >
> > > > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > > .java:52)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > > > estReferen
> > > > > ce.java:38)
> > > > > at
> > > > >
> > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > > ecution.java:38)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > > TestRunner
> > > > > .java:460)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > > TestRunner
> > > > > .java:673)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > > > unner.java
> > > > > :386)
> > > > > at
> > > > >
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > > > Runner.jav
> > > > > a:196)
> > > > >
> > > > > -----Original Message-----
> > > > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > > Sent: April 26, 2007 9:59 PM
> > > > > To: open-jpa-dev@incubator.apache.org
> > > > > Subject: RE: How to debug object retrieveal in JPA?
> > > > >
> > > > >
> > > > >>Caused by: java.lang.NullPointerException
> > > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > > >> at java.util.Locale.<init>(Locale.java:272)
> > > > >> at java.util.Locale.<init>(Locale.java:302)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > > >> at
> > > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > > .java:117)
> > > > >
> > > > >
> > > > > Now we're getting somewhere.... what happens if you remove
> > > > the Locale
> > > > > field from the Person class?
> > > > >
> > > > > -Patrick
> > > > >
> > > > > --
> > > > > Patrick Linskey
> > > > > BEA Systems, Inc.
> > > > >
> > > >
> > >
> >
> ______________________________________________________________________
> > > > > _
> > > > > Notice: This email message, together with any
> attachments, may
> > > > > contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > > affiliated entities, that may be confidential, proprietary,
> > > > > copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > > use of the individual or entity named in this message. If
> > > > you are not
> > > > > the intended recipient, and have received this message
> > in error,
> > > > > please
> > > > immediately return this by email and then delete it.
> > > > >
> > > > >
> > > > >>-----Original Message-----
> > > > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>Sent: Thursday, April 26, 2007 6:32 PM
> > > > >>To: open-jpa-dev@incubator.apache.org
> > > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>
> > > > >>Run that config gives us this lovely message:
> > > > >>
> > > > >><0|false|0.9.6-incubating>
> > > > >>org.apache.openjpa.persistence.PersistenceException:
> > > > >>null
> > > > >> at
> > > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > > > >>Manager.java:773)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > > >>.java:254)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > > > >>tImpl.java:2115)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > > >>.java:248)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > > > >>tResultObject(Inst
> > > > >>anceResultObjectProvider.java:56)
> > > > >> at
> > > > >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > > > >>ResultList.java:12
> > > > >>8)
> > > > >> at
> > > > >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > > > >>(AbstractNonSequen
> > > > >>tialResultList.java:69)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > > > >>esultList.java:241
> > > > >>)
> > > > >> at
> > > > >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > > > >>ect(PersonFactoryI
> > > > >>mpl.java:99)
> > > > >> at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >> at
> > > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > >>orImpl.java:39)
> > > > >> at
> > > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > >>odAccessorImpl.jav
> > > > >>a:25)
> > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >> at
> > > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > > >>eflection(AopUtils
> > > > >>.java:304)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > > >>nvokeJoinpoint(Ref
> > > > >>lectiveMethodInvocation.java:172)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:139)
> > > > >> at
> > > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > > >>ptor.invoke(Transa
> > > > >>ctionInterceptor.java:107)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:161)
> > > > >> at
> > > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > > >>kDynamicAopProxy.j
> > > > >>ava:203)
> > > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > >> at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >> at
> > > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > >>orImpl.java:39)
> > > > >> at
> > > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > >>odAccessorImpl.jav
> > > > >>a:25)
> > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >> at
> > > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > > >>eflection(AopUtils
> > > > >>.java:304)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > > >>nvokeJoinpoint(Ref
> > > > >>lectiveMethodInvocation.java:172)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:139)
> > > > >> at
> > > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > > >>ptor.invoke(Transa
> > > > >>ctionInterceptor.java:107)
> > > > >> at
> > > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > > >>roceed(ReflectiveM
> > > > >>ethodInvocation.java:161)
> > > > >> at
> > > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > > >>kDynamicAopProxy.j
> > > > >>ava:203)
> > > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > >> at
> > > > >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > > >>yTest.java:119)
> > > > >> at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >> at
> > > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > > >>orImpl.java:39)
> > > > >> at
> > > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > >>odAccessorImpl.jav
> > > > >>a:25)
> > > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > >> at
> > > > >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > > > >>alTestCase.java:69
> > > > >>)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ac
> > > > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests$1.
> > > > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ru
> > > > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ru
> > > > >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > >> at
> > > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > > >>nsactionalTests.ru
> > > > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > >> at
> > > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > >>JpaTests.java:159)
> > > > >> at
> > > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > > >>JpaTests.java:239)
> > > > >> at
> > junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > >> at
> > junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > >> at junit.framework.TestResult.run(TestResult.java:113)
> > > > >> at junit.framework.TestCase.run(TestCase.java:124)
> > > > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > >> at
> > > > >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > > >>Runner.java:35)
> > > > >> at
> > > > >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > > >>.java:29)
> > > > >> at
> > > > >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > > > >>stClassRunner.java
> > > > >>:42)
> > > > >> at
> > > > >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > > > >>eforeAndAfterRunne
> > > > >>r.java:34)
> > > > >> at
> > > > >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > > >>.java:52)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > > > >>(JUnit4TestReferen
> > > > >>ce.java:38)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > > >>ecution.java:38)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > > >>s(RemoteTestRunner
> > > > >>.java:460)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > > >>s(RemoteTestRunner
> > > > >>.java:673)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > > > >>oteTestRunner.java
> > > > >>:386)
> > > > >> at
> > > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > > > >>moteTestRunner.jav
> > > > >>a:196)
> > > > >>Caused by: java.lang.NullPointerException
> > > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > > >> at java.util.Locale.<init>(Locale.java:272)
> > > > >> at java.util.Locale.<init>(Locale.java:302)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > > >> at
> > ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > > >> at
> > > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > > .java:117)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > > > >>agerImpl.java:247)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > > > >>e(JDBCStoreManager
> > > > >>.java:327)
> > > > >> at
> > > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > > > >>CStoreManager.java
> > > > >>:252)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > > > >>legatingStoreManag
> > > > >>er.java:108)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > > > >>anager.java:54)
> > > > >> at
> > > >
> > >
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > > > >> at
> > > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > > > >> ... 64 more
> > > > >>
> > > > >>-----Original Message-----
> > > > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > >>Sent: April 26, 2007 5:40 PM
> > > > >>To: open-jpa-dev@incubator.apache.org
> > > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>
> > > > >>
> > > > >>>Can you post what you get if you do '((Exception)
> > > > >>>results.get(0)).printStackTrace()'?
> > > > >>
> > > > >>... so results.get(0) is returning a List? That's very odd.
> > > > >>What if you
> > > > >>do:
> > > > >>
> > > > >>System.out.println(results.get(0))?
> > > > >>
> > > > >>If it is a List of Exceptions, what if you print out the
> > > > stacks of the
> > > > >>exceptions in the list?
> > > > >>
> > > > >>-Patrick
> > > > >>
> > > > >>--
> > > > >>Patrick Linskey
> > > > >>BEA Systems, Inc.
> > > > >>______________________________________________________________
> > > > >>_________
> > > > >>Notice: This email message, together with any
> attachments, may
> > > > >>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > >>affiliated entities, that may be confidential, proprietary,
> > > > >>copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > >>use of the individual or entity named in this message. If
> > > > you are not
> > > > >>the intended recipient, and have received this message
> > in error,
> > > > >>please immediately return this by email and then delete it.
> > > > >>
> > > > >>
> > > > >>>-----Original Message-----
> > > > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > > > >>>To: open-jpa-dev@incubator.apache.org
> > > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>
> > > > >>>Can't cast List to Exception
> > > > >>>
> > > > >>>-----Original Message-----
> > > > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > >>>Sent: April 26, 2007 5:00 PM
> > > > >>>To: open-jpa-dev@incubator.apache.org
> > > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>
> > > > >>>So you're saying that the ResultList contains an Exception?
> > > > >>>Can you post what you get if you do '((Exception)
> > > > >>>results.get(0)).printStackTrace()'?
> > > > >>>
> > > > >>>-Patrick
> > > > >>>
> > > > >>>--
> > > > >>>Patrick Linskey
> > > > >>>BEA Systems, Inc.
> > > >
> >>>______________________________________________________________
> > > > >>>_________
> > > > >>>Notice: This email message, together with any
> > attachments, may
> > > > >>>contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > >>>affiliated entities, that may be confidential,
> proprietary,
> > > > >>>copyrighted and/or legally privileged, and is intended
> > > > >>
> > > > >>solely for the
> > > > >>
> > > > >>>use of the individual or entity named in this message. If
> > > > >>
> > > > >>you are not
> > > > >>
> > > > >>>the intended recipient, and have received this message
> > in error,
> > > > >>>please immediately return this by email and then delete it.
> > > > >>>
> > > > >>>
> > > > >>>>-----Original Message-----
> > > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>>
> > > > >>>>Some more information on this exception
> > > > >>>>
> > > > >>>>Right after the execution the exception held inside the
> > > result is
> > > > >>>>"com.sun.jdi.InvocationException occurred invoking
> > > > >>
> > > > >>method..." Can't
> > > > >>
> > > > >>>>seem to get more data out of it
> > > > >>>>
> > > > >>>>Once the system.out is executed the exception changes to
> > > > >>>
> > > > >>>"The result
> > > > >>>
> > > > >>>>list has been closed"
> > > > >>>>
> > > > >>>>-----Original Message-----
> > > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > > >>>>Sent: April 26, 2007 4:18 PM
> > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > > >>>>
> > > > >>>>I did not mean it threw an NPE but I was left with a null
> > > > >>>
> > > > >>>result list.
> > > > >>>
> > > > >>>>I have setup trace already and I actually get nothing back.
> > > > >>>>Here is the trace across the execution point
> > > > >>>>
> > > > >>>>13734 WARN [main] openjpa.MetaData - Found
> duplicate query
> > > > >>>>"PersonFXLastFirst" in "class
> ca.BidSpec.emall.user.Person".
> > > > >>>>Ignoring.
> > > > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > > > >>>
> > > > >>>t0.created,
> > > > >>>
> > > > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > > > >>
> > > > >>t0.locale,
> > > > >>
> > > > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > > > >>
> > > > >>t2.description,
> > > > >>
> > > > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > > > >>
> > > > >>t4.value, t1.id,
> > > > >>
> > > > >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > > > >>>
> > > > >>>t1.name,
> > > > >>>
> > > > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > > > >>
> > > > >>t5.value,
> > > > >>
> > > > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> > > manufacturer t1 ON
> > > > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > > > >>>
> > > > >>>t0.roleFK =
> > > > >>>
> > > > >>>>t2.id LEFT OUTER JOIN category
> > > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > > >>>
> > > > >>>ON t1.typeFK
> > > > >>>
> > > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > > >>>
> > > > >>>t2.categoryTypeFK = t3.id
> > > > >>>
> > > > >>>>WHERE
> > > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > > > >>>
> > > > >>>t0.lastName
> > > > >>>
> > > > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > > >>>>(String) PMORAN]
> > > > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> [15 ms] spent
> > > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > > >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > > > >>>
> > > > >>>t1.id LEFT
> > > > >>>
> > > > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > > > >>
> > > > >>JOIN category
> > > > >>
> > > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > > >>>
> > > > >>>ON t1.typeFK
> > > > >>>
> > > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > > >>>
> > > > >>>t2.categoryTypeFK = t3.id
> > > > >>>
> > > > >>>>WHERE
> > > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > > >>>>[params=(String) BIDSPEC,
> > > > >>>>(String) PMORAN]
> > > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > > >>>>9575056> [0 ms] spent
> > > > >>>>1
> > > > >>>>[2007-04-26 16:07:36,125] INFO
> > > > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > > > >>>
> > > > >>>transaction after
> > > > >>>
> > > > >>>>test execution
> > > > >>>>
> > > > >>>>What is interesting is the line with a "1" (from
> > > > >>>>System.out.println(results.size())). What this
> > > represents is the
> > > > >>>>message that the "result list is closed" nothing else in
> > > > >>
> > > > >>the trace.
> > > > >>
> > > > >>>>So what causes the result list to be closed?
> > > > >>>>
> > > > >>>>Phill
> > > > >>>>
> > > > >>>>-----Original Message-----
> > > > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > > > >>>
> > > > >>>On Behalf
> > > > >>>
> > > > >>>>Of Marc Prud'hommeaux
> > > > >>>>Sent: April 26, 2007 3:54 PM
> > > > >>>>To: open-jpa-dev@incubator.apache.org
> > > > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > > > >>>>
> > > > >>>>Phill-
> > > > >>>>
> > > > >>>>The maximum verbosity of logging is obtained by
> > specifying the
> > > > >>>>"openjpa.Log"
> > > > >>>>property to "DefaultLevel=TRACE".
> > > > >>>>
> > > > >>>>What is the full exception stack trace? We might be
> > > able to help
> > > > >>>>identify the problem. In any case OpenJPA should never be
> > > > >>>
> > > > >>>throwing an
> > > > >>>
> > > > >>>>NPE, so we should at least probably fix the error message.
> > > > >>>>
> > > > >>>>
> > > > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > > > >>>>
> > > > >>>>
> > > > >>>>>Community,
> > > > >>>>>
> > > > >>>>>How does one go about debugging object retrieval/creation.
> > > > >>>>
> > > > >>>>I continue
> > > > >>>>
> > > > >>>>>to have exceptions and little to go on as far as the cause.
> > > > >>>>>The named JPQL is good since I know it generates a good sql
> > > > >>>>
> > > > >>>>(can trace
> > > > >>>>
> > > > >>>>>code and see it) . I know the sql is good as I can
> > > > >>>>
> > > > >>>>copy/paste it into
> > > > >>>>
> > > > >>>>>mysql query browser, execute and get the correct data
> > > back. The
> > > > >>>>>problem is that these lines result in an NPE.
> > > > >>>>>
> > > > >>>>> Query q =
> > > > >>>>>
> > > > >>
> > > >
> > >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > > >>
> > > > >>>>> q.setParameter("storeName",
> > > > >>
> > > > >>storeName.toUpperCase());
> > > > >>
> > > > >>>>> q.setParameter("loginName",
> > > > >>
> > > > >>loginName.toUpperCase());
> > > > >>
> > > > >>>>> List<Person> results = null;
> > > > >>>>> try {
> > > > >>>>> results = (List<Person>) q.getResultList();
> > > > >>>>> System.out.println(results.size());
> > > > >>>>> }
> > > > >>>>> catch(Exception e) {
> > > > >>>>> e.printStackTrace();
> > > > >>>>> }
> > > > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > > > >>>>> throw new UserNotFoundException("No
> > > > >>>>
> > > > >>>>user found");
> > > > >>>>
> > > > >>>>> }
> > > > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > > > >>
> > > > >>course how
> > > > >>
> > > > >>>>>would I know since I can find no description of what a good
> > > > >>>>
> > > > >>>>one looks
> > > > >>>>
> > > > >>>>>like but reading it (no
> > > > >>>>>exceptions) seem to make sense.
> > > > >>>>>
> > > > >>>>>Any help would be much appreciated.
> > > > >>>>>
> > > > >>>>>Phill
> > > > >>>>>
> > > > >>>>
> > > > >>>>
> > > > >>>Notice: This email message, together with any
> > attachments, may
> > > > >>>contain information of BEA Systems, Inc., its
> > > > subsidiaries and
> > > > >>>affiliated entities, that may be confidential,
> proprietary,
> > > > >>>copyrighted and/or legally privileged, and is intended
> > > > >>
> > > > >>solely for the
> > > > >>
> > > > >>>use of the individual or entity named in this message. If
> > > > >>
> > > > >>you are not
> > > > >>
> > > > >>>the intended recipient, and have received this message
> > in error,
> > > > >>>please immediately return this by email and then delete it.
> > > > >>>
> > > > >>>
> > > > >>
> > > > >>Notice: This email message, together with any
> attachments, may
> > > > >>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > >>affiliated entities, that may be confidential, proprietary,
> > > > >>copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > >>use of the individual or entity named in this message. If
> > > > you are not
> > > > >>the intended recipient, and have received this message
> > in error,
> > > > >>please immediately return this by email and then delete it.
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > > Notice: This email message, together with any
> attachments, may
> > > > > contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > > > affiliated entities, that may be confidential, proprietary,
> > > > > copyrighted and/or legally privileged, and is intended
> > > > solely for the
> > > > > use of the individual or entity named in this message. If
> > > > you are not
> > > > > the intended recipient, and have received this message
> > in error,
> > > > > please
> > > > immediately return this by email and then delete it.
> > > > >
> > > >
> > > >
> > >
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please immediately return this by email and then delete it.
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
Sure here it is and the sql it generates. BTW the SQL works as I can execute it
in MySQL query browser and get the record back I am after. Does it matter that I
am after a single record? I don't specify the single records expected response
(since it could be larger but currently in test it is only 1)
@NamedQuery(name = "PersonFXStoreAndLogin", query = "SELECT p FROM Person p
WHERE UPPER(p.store.name) = :storeName and UPPER(p.loginName) = :loginName ORDER
BY p.lastName, p.firstName") })
SQL:
37391 BidSpecPersistenceUnit TRACE [main] openjpa.jdbc.SQL - <t 2860004, conn
24859001> executing prepstmnt 31775072 SELECT t0.id, t0.version, t0.lastUpdated,
t0.active, t0.activeFrom, t0.activeUntil, t0.created, t0.displayName,
t0.firstName, t0.lastLogin, t0.lastName, t0.locale, t0.loginName, t0.middleName,
t2.id, t2.version, t2.lastUpdated, t2.description, t3.id, t3.version,
t3.lastUpdated, t3.description, t2.value, t4.id, t4.version, t4.lastUpdated,
t4.description, t4.categoryTypeFK, t4.value, t1.id, t1.version, t1.lastUpdated,
t1.created, t1.description, t1.displayName, t1.name, t5.id, t5.version,
t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value, t0.title,
t0.visible FROM person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK = t5.id
LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id WHERE
(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName ASC,
t0.firstName ASC [params=(String) BIDSPEC, (String) PMORAN]
The initial excpetion is :
Error Exception occurred: com.sun.jdi.InvocationException occurred invoking
method..
Here is the method that causes the problem
public Person getLoginPersonValueObject(String storeName, String
loginName)
throws PersonValueObjectNotFoundException,
UserNotActiveException,
UserNotFoundException {
Query q =
this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
q.setParameter("storeName", storeName.toUpperCase());
q.setParameter("loginName", loginName.toUpperCase());
List<Person> results = null;
try {
results = (List<Person>) q.getResultList();
System.out.println(results.get(0));
}
catch(Exception e) {
e.printStackTrace();
}
if (results.isEmpty()) {
throw new UserNotFoundException("No user found");
}
if (results.size() > 1) {
throw new PersonValueObjectNotFoundException(
"returned multiple login name for same
store. StoreName=" + storeName
+ ", loginName=" +
loginName);
}
Person person = results.iterator().next();
if (!person.isActive()) {
throw new UserNotActiveException();
}
return person;
}
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 30, 2007 2:01 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
Odd indeed. Can you post your named query definition?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 10:55 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Hard to pull this little piece (of a much larger one) and package it.
> Let me tool around some more and see if I can uncover more. What is
> odd is not all my JPA classes have this problem but all inherit from
> the same base and are fairly similar. I will try commenting out parts
> of it and see if it clears. IF not I will have to package and send
> along
>
> Phill
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 1:45 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Odd. Any chance of packaging it up and attaching it to a JIRA issue?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 10:37 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > I upgraded and result stayed the same. Also this is in a spring
> > transaction. In fact these are all part of JUnit tests.
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 30, 2007 12:05 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > It looks like this exception is different than the others; it looks
> > like this exception is actually being thrown, rather than being put
> > into your result list.
> > Is that correct?
> >
> > Is this something that you could package up as a test case?
> > Also, I seem to remember some sort of issue with
> overly-eager result
> > list closing in non-transactional environments in 0.9.6,
> but I can't
> > find a related JIRA issue.
> > It's possible that moving up to 0.9.7 (released Friday;
> > http://cwiki.apache.org/openjpa/downloads.html) might get
> around the
> > problem.
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Monday, April 30, 2007 7:28 AM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > Anyone have any more suggestions on how to debug this?
> > >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: April 26, 2007 11:20 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > I don't close it in anyway directly
> > >
> > > -----Original Message-----
> > > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > > Sent: April 26, 2007 11:16 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: Re: How to debug object retrieveal in JPA?
> > >
> > > Can it be that there is a glue code that closes EM in
> > between? Just a
> > > thought...
> > >
> > > -marina
> > >
> > > Phill Moran wrote:
> > > > I had suspected the Locale so I made a set/getLocale that
> > > communicate
> > > > in
> > > String.
> > > > I figured that openJPA does not actually care how I implement.
> > > >
> > > > But for this run I removed it completely and did a clean
> > > rebuild. Good
> > > > news and bad the exception changed:
> > > >
> > > >
> > > > java.util.NoSuchElementException: The result list has
> been closed.
> > > > at
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > > tList.java
> > > > :91)
> > > > at
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > > tNonSequen
> > > > tialResultList.java:68)
> > > > at
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > > t.java:241
> > > > )
> > > > at
> > > >
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > > onFactoryI
> > > > mpl.java:99)
> > > > at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > orImpl.java:39)
> > > > at
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > orImpl.jav
> > > > a:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > n(AopUtils
> > > > .java:304)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > npoint(Ref
> > > > lectiveMethodInvocation.java:172)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:139)
> > > > at
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > oke(Transa
> > > > ctionInterceptor.java:107)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:161)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > AopProxy.j
> > > > ava:203)
> > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > orImpl.java:39)
> > > > at
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > orImpl.jav
> > > > a:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > n(AopUtils
> > > > .java:304)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > npoint(Ref
> > > > lectiveMethodInvocation.java:172)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:139)
> > > > at
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > oke(Transa
> > > > ctionInterceptor.java:107)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:161)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > AopProxy.j
> > > > ava:203)
> > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > at
> > > >
> > > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > yTest.java:119)
> > > > at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > orImpl.java:39)
> > > > at
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > orImpl.jav
> > > > a:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > at
> > > >
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > > se.java:69
> > > > )
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ac
> > > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > at
> > > >
> > > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > nsactionalTests$1.
> > > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ru
> > > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ru
> > > > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ru
> > > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > at
> > > >
> > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > JpaTests.java:159)
> > > > at
> > > >
> > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > JpaTests.java:239)
> > > > at
> junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > at
> junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > at junit.framework.TestResult.run(TestResult.java:113)
> > > > at junit.framework.TestCase.run(TestCase.java:124)
> > > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > at
> > > >
> > > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > Runner.java:35)
> > > > at
> > > >
> > > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > .java:29)
> > > > at
> > > >
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > > unner.java
> > > > :42)
> > > > at
> > > >
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > > AfterRunne
> > > > r.java:34)
> > > > at
> > > >
> > > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > .java:52)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > > estReferen
> > > > ce.java:38)
> > > > at
> > > >
> > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > ecution.java:38)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > TestRunner
> > > > .java:460)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > TestRunner
> > > > .java:673)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > > unner.java
> > > > :386)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > > Runner.jav
> > > > a:196)
> > > >
> > > > -----Original Message-----
> > > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > Sent: April 26, 2007 9:59 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > >
> > > >>Caused by: java.lang.NullPointerException
> > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > >> at java.util.Locale.<init>(Locale.java:272)
> > > >> at java.util.Locale.<init>(Locale.java:302)
> > > >> at
> ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > >> at
> ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > >> at
> ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > >> at
> > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > .java:117)
> > > >
> > > >
> > > > Now we're getting somewhere.... what happens if you remove
> > > the Locale
> > > > field from the Person class?
> > > >
> > > > -Patrick
> > > >
> > > > --
> > > > Patrick Linskey
> > > > BEA Systems, Inc.
> > > >
> > >
> >
> ______________________________________________________________________
> > > > _
> > > > Notice: This email message, together with any attachments, may
> > > > contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > > affiliated entities, that may be confidential, proprietary,
> > > > copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > > use of the individual or entity named in this message. If
> > > you are not
> > > > the intended recipient, and have received this message
> in error,
> > > > please
> > > immediately return this by email and then delete it.
> > > >
> > > >
> > > >>-----Original Message-----
> > > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>Sent: Thursday, April 26, 2007 6:32 PM
> > > >>To: open-jpa-dev@incubator.apache.org
> > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > >>
> > > >>Run that config gives us this lovely message:
> > > >>
> > > >><0|false|0.9.6-incubating>
> > > >>org.apache.openjpa.persistence.PersistenceException:
> > > >>null
> > > >> at
> > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > > >> at
> > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > > >>Manager.java:773)
> > > >> at
> > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > >>.java:254)
> > > >> at
> > > >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > > >>tImpl.java:2115)
> > > >> at
> > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > >>.java:248)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > > >>tResultObject(Inst
> > > >>anceResultObjectProvider.java:56)
> > > >> at
> > > >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > > >>ResultList.java:12
> > > >>8)
> > > >> at
> > > >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > > >>(AbstractNonSequen
> > > >>tialResultList.java:69)
> > > >> at
> > > >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > > >>esultList.java:241
> > > >>)
> > > >> at
> > > >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > > >>ect(PersonFactoryI
> > > >>mpl.java:99)
> > > >> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >> at
> > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > >>orImpl.java:39)
> > > >> at
> > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > >>odAccessorImpl.jav
> > > >>a:25)
> > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > >> at
> > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > >>eflection(AopUtils
> > > >>.java:304)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > >>nvokeJoinpoint(Ref
> > > >>lectiveMethodInvocation.java:172)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:139)
> > > >> at
> > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > >>ptor.invoke(Transa
> > > >>ctionInterceptor.java:107)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:161)
> > > >> at
> > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > >>kDynamicAopProxy.j
> > > >>ava:203)
> > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > >> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >> at
> > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > >>orImpl.java:39)
> > > >> at
> > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > >>odAccessorImpl.jav
> > > >>a:25)
> > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > >> at
> > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > >>eflection(AopUtils
> > > >>.java:304)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > >>nvokeJoinpoint(Ref
> > > >>lectiveMethodInvocation.java:172)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:139)
> > > >> at
> > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > >>ptor.invoke(Transa
> > > >>ctionInterceptor.java:107)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:161)
> > > >> at
> > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > >>kDynamicAopProxy.j
> > > >>ava:203)
> > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > >> at
> > > >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > >>yTest.java:119)
> > > >> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >> at
> > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > >>orImpl.java:39)
> > > >> at
> > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > >>odAccessorImpl.jav
> > > >>a:25)
> > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > > >> at
> > > >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > > >>alTestCase.java:69
> > > >>)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ac
> > > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests$1.
> > > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ru
> > > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ru
> > > >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ru
> > > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > >> at
> > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > >>JpaTests.java:159)
> > > >> at
> > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > >>JpaTests.java:239)
> > > >> at
> junit.framework.TestResult$1.protect(TestResult.java:110)
> > > >> at
> junit.framework.TestResult.runProtected(TestResult.java:128)
> > > >> at junit.framework.TestResult.run(TestResult.java:113)
> > > >> at junit.framework.TestCase.run(TestCase.java:124)
> > > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > > >> at
> > > >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > >>Runner.java:35)
> > > >> at
> > > >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > >>.java:29)
> > > >> at
> > > >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > > >>stClassRunner.java
> > > >>:42)
> > > >> at
> > > >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > > >>eforeAndAfterRunne
> > > >>r.java:34)
> > > >> at
> > > >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > >>.java:52)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > > >>(JUnit4TestReferen
> > > >>ce.java:38)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > >>ecution.java:38)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > >>s(RemoteTestRunner
> > > >>.java:460)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > >>s(RemoteTestRunner
> > > >>.java:673)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > > >>oteTestRunner.java
> > > >>:386)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > > >>moteTestRunner.jav
> > > >>a:196)
> > > >>Caused by: java.lang.NullPointerException
> > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > >> at java.util.Locale.<init>(Locale.java:272)
> > > >> at java.util.Locale.<init>(Locale.java:302)
> > > >> at
> ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > >> at
> ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > >> at
> ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > >> at
> > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > .java:117)
> > > >> at
> > > >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > > >>agerImpl.java:247)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > > >>e(JDBCStoreManager
> > > >>.java:327)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > > >>CStoreManager.java
> > > >>:252)
> > > >> at
> > > >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > > >>legatingStoreManag
> > > >>er.java:108)
> > > >> at
> > > >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > > >>anager.java:54)
> > > >> at
> > >
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > > >> at
> > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > > >> ... 64 more
> > > >>
> > > >>-----Original Message-----
> > > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > >>Sent: April 26, 2007 5:40 PM
> > > >>To: open-jpa-dev@incubator.apache.org
> > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > >>
> > > >>
> > > >>>Can you post what you get if you do '((Exception)
> > > >>>results.get(0)).printStackTrace()'?
> > > >>
> > > >>... so results.get(0) is returning a List? That's very odd.
> > > >>What if you
> > > >>do:
> > > >>
> > > >>System.out.println(results.get(0))?
> > > >>
> > > >>If it is a List of Exceptions, what if you print out the
> > > stacks of the
> > > >>exceptions in the list?
> > > >>
> > > >>-Patrick
> > > >>
> > > >>--
> > > >>Patrick Linskey
> > > >>BEA Systems, Inc.
> > > >>______________________________________________________________
> > > >>_________
> > > >>Notice: This email message, together with any attachments, may
> > > >>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > >>affiliated entities, that may be confidential, proprietary,
> > > >>copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > >>use of the individual or entity named in this message. If
> > > you are not
> > > >>the intended recipient, and have received this message
> in error,
> > > >>please immediately return this by email and then delete it.
> > > >>
> > > >>
> > > >>>-----Original Message-----
> > > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > > >>>To: open-jpa-dev@incubator.apache.org
> > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>
> > > >>>Can't cast List to Exception
> > > >>>
> > > >>>-----Original Message-----
> > > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > >>>Sent: April 26, 2007 5:00 PM
> > > >>>To: open-jpa-dev@incubator.apache.org
> > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>
> > > >>>So you're saying that the ResultList contains an Exception?
> > > >>>Can you post what you get if you do '((Exception)
> > > >>>results.get(0)).printStackTrace()'?
> > > >>>
> > > >>>-Patrick
> > > >>>
> > > >>>--
> > > >>>Patrick Linskey
> > > >>>BEA Systems, Inc.
> > > >>>______________________________________________________________
> > > >>>_________
> > > >>>Notice: This email message, together with any
> attachments, may
> > > >>>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > >>>affiliated entities, that may be confidential, proprietary,
> > > >>>copyrighted and/or legally privileged, and is intended
> > > >>
> > > >>solely for the
> > > >>
> > > >>>use of the individual or entity named in this message. If
> > > >>
> > > >>you are not
> > > >>
> > > >>>the intended recipient, and have received this message
> in error,
> > > >>>please immediately return this by email and then delete it.
> > > >>>
> > > >>>
> > > >>>>-----Original Message-----
> > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > > >>>>To: open-jpa-dev@incubator.apache.org
> > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>>
> > > >>>>Some more information on this exception
> > > >>>>
> > > >>>>Right after the execution the exception held inside the
> > result is
> > > >>>>"com.sun.jdi.InvocationException occurred invoking
> > > >>
> > > >>method..." Can't
> > > >>
> > > >>>>seem to get more data out of it
> > > >>>>
> > > >>>>Once the system.out is executed the exception changes to
> > > >>>
> > > >>>"The result
> > > >>>
> > > >>>>list has been closed"
> > > >>>>
> > > >>>>-----Original Message-----
> > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>>>Sent: April 26, 2007 4:18 PM
> > > >>>>To: open-jpa-dev@incubator.apache.org
> > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>>
> > > >>>>I did not mean it threw an NPE but I was left with a null
> > > >>>
> > > >>>result list.
> > > >>>
> > > >>>>I have setup trace already and I actually get nothing back.
> > > >>>>Here is the trace across the execution point
> > > >>>>
> > > >>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
> > > >>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > > >>>>Ignoring.
> > > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > > >>>
> > > >>>t0.created,
> > > >>>
> > > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > > >>
> > > >>t0.locale,
> > > >>
> > > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > > >>
> > > >>t2.description,
> > > >>
> > > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > > >>
> > > >>t4.value, t1.id,
> > > >>
> > > >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > > >>>
> > > >>>t1.name,
> > > >>>
> > > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > > >>
> > > >>t5.value,
> > > >>
> > > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> > manufacturer t1 ON
> > > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > > >>>
> > > >>>t0.roleFK =
> > > >>>
> > > >>>>t2.id LEFT OUTER JOIN category
> > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > >>>
> > > >>>ON t1.typeFK
> > > >>>
> > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > >>>
> > > >>>t2.categoryTypeFK = t3.id
> > > >>>
> > > >>>>WHERE
> > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > > >>>
> > > >>>t0.lastName
> > > >>>
> > > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > >>>>(String) PMORAN]
> > > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> [15 ms] spent
> > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > > >>>
> > > >>>t1.id LEFT
> > > >>>
> > > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > > >>
> > > >>JOIN category
> > > >>
> > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > >>>
> > > >>>ON t1.typeFK
> > > >>>
> > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > >>>
> > > >>>t2.categoryTypeFK = t3.id
> > > >>>
> > > >>>>WHERE
> > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > >>>>[params=(String) BIDSPEC,
> > > >>>>(String) PMORAN]
> > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> [0 ms] spent
> > > >>>>1
> > > >>>>[2007-04-26 16:07:36,125] INFO
> > > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > > >>>
> > > >>>transaction after
> > > >>>
> > > >>>>test execution
> > > >>>>
> > > >>>>What is interesting is the line with a "1" (from
> > > >>>>System.out.println(results.size())). What this
> > represents is the
> > > >>>>message that the "result list is closed" nothing else in
> > > >>
> > > >>the trace.
> > > >>
> > > >>>>So what causes the result list to be closed?
> > > >>>>
> > > >>>>Phill
> > > >>>>
> > > >>>>-----Original Message-----
> > > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > > >>>
> > > >>>On Behalf
> > > >>>
> > > >>>>Of Marc Prud'hommeaux
> > > >>>>Sent: April 26, 2007 3:54 PM
> > > >>>>To: open-jpa-dev@incubator.apache.org
> > > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > > >>>>
> > > >>>>Phill-
> > > >>>>
> > > >>>>The maximum verbosity of logging is obtained by
> specifying the
> > > >>>>"openjpa.Log"
> > > >>>>property to "DefaultLevel=TRACE".
> > > >>>>
> > > >>>>What is the full exception stack trace? We might be
> > able to help
> > > >>>>identify the problem. In any case OpenJPA should never be
> > > >>>
> > > >>>throwing an
> > > >>>
> > > >>>>NPE, so we should at least probably fix the error message.
> > > >>>>
> > > >>>>
> > > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > > >>>>
> > > >>>>
> > > >>>>>Community,
> > > >>>>>
> > > >>>>>How does one go about debugging object retrieval/creation.
> > > >>>>
> > > >>>>I continue
> > > >>>>
> > > >>>>>to have exceptions and little to go on as far as the cause.
> > > >>>>>The named JPQL is good since I know it generates a good sql
> > > >>>>
> > > >>>>(can trace
> > > >>>>
> > > >>>>>code and see it) . I know the sql is good as I can
> > > >>>>
> > > >>>>copy/paste it into
> > > >>>>
> > > >>>>>mysql query browser, execute and get the correct data
> > back. The
> > > >>>>>problem is that these lines result in an NPE.
> > > >>>>>
> > > >>>>> Query q =
> > > >>>>>
> > > >>
> > >
> >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > >>
> > > >>>>> q.setParameter("storeName",
> > > >>
> > > >>storeName.toUpperCase());
> > > >>
> > > >>>>> q.setParameter("loginName",
> > > >>
> > > >>loginName.toUpperCase());
> > > >>
> > > >>>>> List<Person> results = null;
> > > >>>>> try {
> > > >>>>> results = (List<Person>) q.getResultList();
> > > >>>>> System.out.println(results.size());
> > > >>>>> }
> > > >>>>> catch(Exception e) {
> > > >>>>> e.printStackTrace();
> > > >>>>> }
> > > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > > >>>>> throw new UserNotFoundException("No
> > > >>>>
> > > >>>>user found");
> > > >>>>
> > > >>>>> }
> > > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > > >>
> > > >>course how
> > > >>
> > > >>>>>would I know since I can find no description of what a good
> > > >>>>
> > > >>>>one looks
> > > >>>>
> > > >>>>>like but reading it (no
> > > >>>>>exceptions) seem to make sense.
> > > >>>>>
> > > >>>>>Any help would be much appreciated.
> > > >>>>>
> > > >>>>>Phill
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>Notice: This email message, together with any
> attachments, may
> > > >>>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > >>>affiliated entities, that may be confidential, proprietary,
> > > >>>copyrighted and/or legally privileged, and is intended
> > > >>
> > > >>solely for the
> > > >>
> > > >>>use of the individual or entity named in this message. If
> > > >>
> > > >>you are not
> > > >>
> > > >>>the intended recipient, and have received this message
> in error,
> > > >>>please immediately return this by email and then delete it.
> > > >>>
> > > >>>
> > > >>
> > > >>Notice: This email message, together with any attachments, may
> > > >>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > >>affiliated entities, that may be confidential, proprietary,
> > > >>copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > >>use of the individual or entity named in this message. If
> > > you are not
> > > >>the intended recipient, and have received this message
> in error,
> > > >>please immediately return this by email and then delete it.
> > > >>
> > > >>
> > > >
> > > >
> > > > Notice: This email message, together with any attachments, may
> > > > contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > > affiliated entities, that may be confidential, proprietary,
> > > > copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > > use of the individual or entity named in this message. If
> > > you are not
> > > > the intended recipient, and have received this message
> in error,
> > > > please
> > > immediately return this by email and then delete it.
> > > >
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
Odd indeed. Can you post your named query definition?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 10:55 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Hard to pull this little piece (of a much larger one) and
> package it. Let me tool around some more and see if I can
> uncover more. What is odd is not all my JPA classes have this
> problem but all inherit from the same base and are fairly
> similar. I will try commenting out parts of it and see if it
> clears. IF not I will have to package and send along
>
> Phill
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 1:45 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Odd. Any chance of packaging it up and attaching it to a JIRA issue?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 10:37 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > I upgraded and result stayed the same. Also this is in a spring
> > transaction. In fact these are all part of JUnit tests.
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 30, 2007 12:05 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > It looks like this exception is different than the others; it looks
> > like this exception is actually being thrown, rather than being put
> > into your result list.
> > Is that correct?
> >
> > Is this something that you could package up as a test case?
> > Also, I seem to remember some sort of issue with
> overly-eager result
> > list closing in non-transactional environments in 0.9.6,
> but I can't
> > find a related JIRA issue.
> > It's possible that moving up to 0.9.7 (released Friday;
> > http://cwiki.apache.org/openjpa/downloads.html) might get
> around the
> > problem.
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Monday, April 30, 2007 7:28 AM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > Anyone have any more suggestions on how to debug this?
> > >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: April 26, 2007 11:20 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > I don't close it in anyway directly
> > >
> > > -----Original Message-----
> > > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > > Sent: April 26, 2007 11:16 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: Re: How to debug object retrieveal in JPA?
> > >
> > > Can it be that there is a glue code that closes EM in
> > between? Just a
> > > thought...
> > >
> > > -marina
> > >
> > > Phill Moran wrote:
> > > > I had suspected the Locale so I made a set/getLocale that
> > > communicate
> > > > in
> > > String.
> > > > I figured that openJPA does not actually care how I implement.
> > > >
> > > > But for this run I removed it completely and did a clean
> > > rebuild. Good
> > > > news and bad the exception changed:
> > > >
> > > >
> > > > java.util.NoSuchElementException: The result list has
> been closed.
> > > > at
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > > tList.java
> > > > :91)
> > > > at
> > > >
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > > tNonSequen
> > > > tialResultList.java:68)
> > > > at
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > > t.java:241
> > > > )
> > > > at
> > > >
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > > onFactoryI
> > > > mpl.java:99)
> > > > at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > orImpl.java:39)
> > > > at
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > orImpl.jav
> > > > a:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > n(AopUtils
> > > > .java:304)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > npoint(Ref
> > > > lectiveMethodInvocation.java:172)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:139)
> > > > at
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > oke(Transa
> > > > ctionInterceptor.java:107)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:161)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > AopProxy.j
> > > > ava:203)
> > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > orImpl.java:39)
> > > > at
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > orImpl.jav
> > > > a:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > > n(AopUtils
> > > > .java:304)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > > npoint(Ref
> > > > lectiveMethodInvocation.java:172)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:139)
> > > > at
> > > >
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > > oke(Transa
> > > > ctionInterceptor.java:107)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > > eflectiveM
> > > > ethodInvocation.java:161)
> > > > at
> > > >
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > > AopProxy.j
> > > > ava:203)
> > > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > > at
> > > >
> > > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > yTest.java:119)
> > > > at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > orImpl.java:39)
> > > > at
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > > orImpl.jav
> > > > a:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > > at
> > > >
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > > se.java:69
> > > > )
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ac
> > > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > > at
> > > >
> > > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > nsactionalTests$1.
> > > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ru
> > > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ru
> > > > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > > at
> > > >
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > > alTests.ru
> > > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > > at
> > > >
> > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > JpaTests.java:159)
> > > > at
> > > >
> > > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > JpaTests.java:239)
> > > > at
> junit.framework.TestResult$1.protect(TestResult.java:110)
> > > > at
> junit.framework.TestResult.runProtected(TestResult.java:128)
> > > > at junit.framework.TestResult.run(TestResult.java:113)
> > > > at junit.framework.TestCase.run(TestCase.java:124)
> > > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > > at
> > > >
> > > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > Runner.java:35)
> > > > at
> > > >
> > > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > .java:29)
> > > > at
> > > >
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > > unner.java
> > > > :42)
> > > > at
> > > >
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > > AfterRunne
> > > > r.java:34)
> > > > at
> > > >
> > > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > .java:52)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > > estReferen
> > > > ce.java:38)
> > > > at
> > > >
> > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > ecution.java:38)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > TestRunner
> > > > .java:460)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > > TestRunner
> > > > .java:673)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > > unner.java
> > > > :386)
> > > > at
> > > >
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > > Runner.jav
> > > > a:196)
> > > >
> > > > -----Original Message-----
> > > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > > Sent: April 26, 2007 9:59 PM
> > > > To: open-jpa-dev@incubator.apache.org
> > > > Subject: RE: How to debug object retrieveal in JPA?
> > > >
> > > >
> > > >>Caused by: java.lang.NullPointerException
> > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > >> at java.util.Locale.<init>(Locale.java:272)
> > > >> at java.util.Locale.<init>(Locale.java:302)
> > > >> at
> ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > >> at
> ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > >> at
> ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > >> at
> > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > .java:117)
> > > >
> > > >
> > > > Now we're getting somewhere.... what happens if you remove
> > > the Locale
> > > > field from the Person class?
> > > >
> > > > -Patrick
> > > >
> > > > --
> > > > Patrick Linskey
> > > > BEA Systems, Inc.
> > > >
> > >
> >
> ______________________________________________________________________
> > > > _
> > > > Notice: This email message, together with any attachments, may
> > > > contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > > affiliated entities, that may be confidential, proprietary,
> > > > copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > > use of the individual or entity named in this message. If
> > > you are not
> > > > the intended recipient, and have received this message
> in error,
> > > > please
> > > immediately return this by email and then delete it.
> > > >
> > > >
> > > >>-----Original Message-----
> > > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>Sent: Thursday, April 26, 2007 6:32 PM
> > > >>To: open-jpa-dev@incubator.apache.org
> > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > >>
> > > >>Run that config gives us this lovely message:
> > > >>
> > > >><0|false|0.9.6-incubating>
> > > >>org.apache.openjpa.persistence.PersistenceException:
> > > >>null
> > > >> at
> > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > > >> at
> > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > > >>Manager.java:773)
> > > >> at
> > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > >>.java:254)
> > > >> at
> > > >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > > >>tImpl.java:2115)
> > > >> at
> > > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > > >>.java:248)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > > >>tResultObject(Inst
> > > >>anceResultObjectProvider.java:56)
> > > >> at
> > > >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > > >>ResultList.java:12
> > > >>8)
> > > >> at
> > > >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > > >>(AbstractNonSequen
> > > >>tialResultList.java:69)
> > > >> at
> > > >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > > >>esultList.java:241
> > > >>)
> > > >> at
> > > >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > > >>ect(PersonFactoryI
> > > >>mpl.java:99)
> > > >> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >> at
> > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > >>orImpl.java:39)
> > > >> at
> > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > >>odAccessorImpl.jav
> > > >>a:25)
> > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > >> at
> > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > >>eflection(AopUtils
> > > >>.java:304)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > >>nvokeJoinpoint(Ref
> > > >>lectiveMethodInvocation.java:172)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:139)
> > > >> at
> > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > >>ptor.invoke(Transa
> > > >>ctionInterceptor.java:107)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:161)
> > > >> at
> > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > >>kDynamicAopProxy.j
> > > >>ava:203)
> > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > >> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >> at
> > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > >>orImpl.java:39)
> > > >> at
> > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > >>odAccessorImpl.jav
> > > >>a:25)
> > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > >> at
> > > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > > >>eflection(AopUtils
> > > >>.java:304)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > > >>nvokeJoinpoint(Ref
> > > >>lectiveMethodInvocation.java:172)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:139)
> > > >> at
> > > >>org.springframework.transaction.interceptor.TransactionInterce
> > > >>ptor.invoke(Transa
> > > >>ctionInterceptor.java:107)
> > > >> at
> > > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > > >>roceed(ReflectiveM
> > > >>ethodInvocation.java:161)
> > > >> at
> > > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > > >>kDynamicAopProxy.j
> > > >>ava:203)
> > > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > >> at
> > > >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > > >>yTest.java:119)
> > > >> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >> at
> > > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > > >>orImpl.java:39)
> > > >> at
> > > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > >>odAccessorImpl.jav
> > > >>a:25)
> > > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > > >> at
> > > >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > > >>alTestCase.java:69
> > > >>)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ac
> > > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests$1.
> > > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ru
> > > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ru
> > > >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > >> at
> > > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > > >>nsactionalTests.ru
> > > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > >> at
> > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > >>JpaTests.java:159)
> > > >> at
> > > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > > >>JpaTests.java:239)
> > > >> at
> junit.framework.TestResult$1.protect(TestResult.java:110)
> > > >> at
> junit.framework.TestResult.runProtected(TestResult.java:128)
> > > >> at junit.framework.TestResult.run(TestResult.java:113)
> > > >> at junit.framework.TestCase.run(TestCase.java:124)
> > > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > > >> at
> > > >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > > >>Runner.java:35)
> > > >> at
> > > >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > > >>.java:29)
> > > >> at
> > > >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > > >>stClassRunner.java
> > > >>:42)
> > > >> at
> > > >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > > >>eforeAndAfterRunne
> > > >>r.java:34)
> > > >> at
> > > >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > > >>.java:52)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > > >>(JUnit4TestReferen
> > > >>ce.java:38)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > > >>ecution.java:38)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > >>s(RemoteTestRunner
> > > >>.java:460)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > > >>s(RemoteTestRunner
> > > >>.java:673)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > > >>oteTestRunner.java
> > > >>:386)
> > > >> at
> > > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > > >>moteTestRunner.jav
> > > >>a:196)
> > > >>Caused by: java.lang.NullPointerException
> > > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > > >> at java.util.Locale.<init>(Locale.java:272)
> > > >> at java.util.Locale.<init>(Locale.java:302)
> > > >> at
> ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > > >> at
> ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > > >> at
> ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > > >> at
> > > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > > .java:117)
> > > >> at
> > > >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > > >>agerImpl.java:247)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > > >>e(JDBCStoreManager
> > > >>.java:327)
> > > >> at
> > > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > > >>CStoreManager.java
> > > >>:252)
> > > >> at
> > > >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > > >>legatingStoreManag
> > > >>er.java:108)
> > > >> at
> > > >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > > >>anager.java:54)
> > > >> at
> > >
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > > >> at
> > > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > > >> ... 64 more
> > > >>
> > > >>-----Original Message-----
> > > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > >>Sent: April 26, 2007 5:40 PM
> > > >>To: open-jpa-dev@incubator.apache.org
> > > >>Subject: RE: How to debug object retrieveal in JPA?
> > > >>
> > > >>
> > > >>>Can you post what you get if you do '((Exception)
> > > >>>results.get(0)).printStackTrace()'?
> > > >>
> > > >>... so results.get(0) is returning a List? That's very odd.
> > > >>What if you
> > > >>do:
> > > >>
> > > >>System.out.println(results.get(0))?
> > > >>
> > > >>If it is a List of Exceptions, what if you print out the
> > > stacks of the
> > > >>exceptions in the list?
> > > >>
> > > >>-Patrick
> > > >>
> > > >>--
> > > >>Patrick Linskey
> > > >>BEA Systems, Inc.
> > > >>______________________________________________________________
> > > >>_________
> > > >>Notice: This email message, together with any attachments, may
> > > >>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > >>affiliated entities, that may be confidential, proprietary,
> > > >>copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > >>use of the individual or entity named in this message. If
> > > you are not
> > > >>the intended recipient, and have received this message
> in error,
> > > >>please immediately return this by email and then delete it.
> > > >>
> > > >>
> > > >>>-----Original Message-----
> > > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > > >>>To: open-jpa-dev@incubator.apache.org
> > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>
> > > >>>Can't cast List to Exception
> > > >>>
> > > >>>-----Original Message-----
> > > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > > >>>Sent: April 26, 2007 5:00 PM
> > > >>>To: open-jpa-dev@incubator.apache.org
> > > >>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>
> > > >>>So you're saying that the ResultList contains an Exception?
> > > >>>Can you post what you get if you do '((Exception)
> > > >>>results.get(0)).printStackTrace()'?
> > > >>>
> > > >>>-Patrick
> > > >>>
> > > >>>--
> > > >>>Patrick Linskey
> > > >>>BEA Systems, Inc.
> > > >>>______________________________________________________________
> > > >>>_________
> > > >>>Notice: This email message, together with any
> attachments, may
> > > >>>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > >>>affiliated entities, that may be confidential, proprietary,
> > > >>>copyrighted and/or legally privileged, and is intended
> > > >>
> > > >>solely for the
> > > >>
> > > >>>use of the individual or entity named in this message. If
> > > >>
> > > >>you are not
> > > >>
> > > >>>the intended recipient, and have received this message
> in error,
> > > >>>please immediately return this by email and then delete it.
> > > >>>
> > > >>>
> > > >>>>-----Original Message-----
> > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > > >>>>To: open-jpa-dev@incubator.apache.org
> > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>>
> > > >>>>Some more information on this exception
> > > >>>>
> > > >>>>Right after the execution the exception held inside the
> > result is
> > > >>>>"com.sun.jdi.InvocationException occurred invoking
> > > >>
> > > >>method..." Can't
> > > >>
> > > >>>>seem to get more data out of it
> > > >>>>
> > > >>>>Once the system.out is executed the exception changes to
> > > >>>
> > > >>>"The result
> > > >>>
> > > >>>>list has been closed"
> > > >>>>
> > > >>>>-----Original Message-----
> > > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > > >>>>Sent: April 26, 2007 4:18 PM
> > > >>>>To: open-jpa-dev@incubator.apache.org
> > > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > > >>>>
> > > >>>>I did not mean it threw an NPE but I was left with a null
> > > >>>
> > > >>>result list.
> > > >>>
> > > >>>>I have setup trace already and I actually get nothing back.
> > > >>>>Here is the trace across the execution point
> > > >>>>
> > > >>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
> > > >>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > > >>>>Ignoring.
> > > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > > >>>
> > > >>>t0.created,
> > > >>>
> > > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > > >>
> > > >>t0.locale,
> > > >>
> > > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > > >>
> > > >>t2.description,
> > > >>
> > > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > > >>
> > > >>t4.value, t1.id,
> > > >>
> > > >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > > >>>
> > > >>>t1.name,
> > > >>>
> > > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > > >>
> > > >>t5.value,
> > > >>
> > > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> > manufacturer t1 ON
> > > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > > >>>
> > > >>>t0.roleFK =
> > > >>>
> > > >>>>t2.id LEFT OUTER JOIN category
> > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > >>>
> > > >>>ON t1.typeFK
> > > >>>
> > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > >>>
> > > >>>t2.categoryTypeFK = t3.id
> > > >>>
> > > >>>>WHERE
> > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > > >>>
> > > >>>t0.lastName
> > > >>>
> > > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > >>>>(String) PMORAN]
> > > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> [15 ms] spent
> > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > > >>>
> > > >>>t1.id LEFT
> > > >>>
> > > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > > >>
> > > >>JOIN category
> > > >>
> > > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > > >>>
> > > >>>ON t1.typeFK
> > > >>>
> > > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > > >>>
> > > >>>t2.categoryTypeFK = t3.id
> > > >>>
> > > >>>>WHERE
> > > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > >>>>[params=(String) BIDSPEC,
> > > >>>>(String) PMORAN]
> > > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > >>>>9575056> [0 ms] spent
> > > >>>>1
> > > >>>>[2007-04-26 16:07:36,125] INFO
> > > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > > >>>
> > > >>>transaction after
> > > >>>
> > > >>>>test execution
> > > >>>>
> > > >>>>What is interesting is the line with a "1" (from
> > > >>>>System.out.println(results.size())). What this
> > represents is the
> > > >>>>message that the "result list is closed" nothing else in
> > > >>
> > > >>the trace.
> > > >>
> > > >>>>So what causes the result list to be closed?
> > > >>>>
> > > >>>>Phill
> > > >>>>
> > > >>>>-----Original Message-----
> > > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > > >>>
> > > >>>On Behalf
> > > >>>
> > > >>>>Of Marc Prud'hommeaux
> > > >>>>Sent: April 26, 2007 3:54 PM
> > > >>>>To: open-jpa-dev@incubator.apache.org
> > > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > > >>>>
> > > >>>>Phill-
> > > >>>>
> > > >>>>The maximum verbosity of logging is obtained by
> specifying the
> > > >>>>"openjpa.Log"
> > > >>>>property to "DefaultLevel=TRACE".
> > > >>>>
> > > >>>>What is the full exception stack trace? We might be
> > able to help
> > > >>>>identify the problem. In any case OpenJPA should never be
> > > >>>
> > > >>>throwing an
> > > >>>
> > > >>>>NPE, so we should at least probably fix the error message.
> > > >>>>
> > > >>>>
> > > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > > >>>>
> > > >>>>
> > > >>>>>Community,
> > > >>>>>
> > > >>>>>How does one go about debugging object retrieval/creation.
> > > >>>>
> > > >>>>I continue
> > > >>>>
> > > >>>>>to have exceptions and little to go on as far as the cause.
> > > >>>>>The named JPQL is good since I know it generates a good sql
> > > >>>>
> > > >>>>(can trace
> > > >>>>
> > > >>>>>code and see it) . I know the sql is good as I can
> > > >>>>
> > > >>>>copy/paste it into
> > > >>>>
> > > >>>>>mysql query browser, execute and get the correct data
> > back. The
> > > >>>>>problem is that these lines result in an NPE.
> > > >>>>>
> > > >>>>> Query q =
> > > >>>>>
> > > >>
> > >
> >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > >>
> > > >>>>> q.setParameter("storeName",
> > > >>
> > > >>storeName.toUpperCase());
> > > >>
> > > >>>>> q.setParameter("loginName",
> > > >>
> > > >>loginName.toUpperCase());
> > > >>
> > > >>>>> List<Person> results = null;
> > > >>>>> try {
> > > >>>>> results = (List<Person>) q.getResultList();
> > > >>>>> System.out.println(results.size());
> > > >>>>> }
> > > >>>>> catch(Exception e) {
> > > >>>>> e.printStackTrace();
> > > >>>>> }
> > > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > > >>>>> throw new UserNotFoundException("No
> > > >>>>
> > > >>>>user found");
> > > >>>>
> > > >>>>> }
> > > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > > >>
> > > >>course how
> > > >>
> > > >>>>>would I know since I can find no description of what a good
> > > >>>>
> > > >>>>one looks
> > > >>>>
> > > >>>>>like but reading it (no
> > > >>>>>exceptions) seem to make sense.
> > > >>>>>
> > > >>>>>Any help would be much appreciated.
> > > >>>>>
> > > >>>>>Phill
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>Notice: This email message, together with any
> attachments, may
> > > >>>contain information of BEA Systems, Inc., its
> > > subsidiaries and
> > > >>>affiliated entities, that may be confidential, proprietary,
> > > >>>copyrighted and/or legally privileged, and is intended
> > > >>
> > > >>solely for the
> > > >>
> > > >>>use of the individual or entity named in this message. If
> > > >>
> > > >>you are not
> > > >>
> > > >>>the intended recipient, and have received this message
> in error,
> > > >>>please immediately return this by email and then delete it.
> > > >>>
> > > >>>
> > > >>
> > > >>Notice: This email message, together with any attachments, may
> > > >>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > >>affiliated entities, that may be confidential, proprietary,
> > > >>copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > >>use of the individual or entity named in this message. If
> > > you are not
> > > >>the intended recipient, and have received this message
> in error,
> > > >>please immediately return this by email and then delete it.
> > > >>
> > > >>
> > > >
> > > >
> > > > Notice: This email message, together with any attachments, may
> > > > contain information of BEA Systems, Inc., its
> > subsidiaries and
> > > > affiliated entities, that may be confidential, proprietary,
> > > > copyrighted and/or legally privileged, and is intended
> > > solely for the
> > > > use of the individual or entity named in this message. If
> > > you are not
> > > > the intended recipient, and have received this message
> in error,
> > > > please
> > > immediately return this by email and then delete it.
> > > >
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
Hard to pull this little piece (of a much larger one) and package it. Let me
tool around some more and see if I can uncover more. What is odd is not all my
JPA classes have this problem but all inherit from the same base and are fairly
similar. I will try commenting out parts of it and see if it clears. IF not I
will have to package and send along
Phill
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 30, 2007 1:45 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
Odd. Any chance of packaging it up and attaching it to a JIRA issue?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 10:37 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I upgraded and result stayed the same. Also this is in a spring
> transaction. In fact these are all part of JUnit tests.
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 12:05 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> It looks like this exception is different than the others; it looks
> like this exception is actually being thrown, rather than being put
> into your result list.
> Is that correct?
>
> Is this something that you could package up as a test case?
> Also, I seem to remember some sort of issue with overly-eager result
> list closing in non-transactional environments in 0.9.6, but I can't
> find a related JIRA issue.
> It's possible that moving up to 0.9.7 (released Friday;
> http://cwiki.apache.org/openjpa/downloads.html) might get around the
> problem.
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 7:28 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Anyone have any more suggestions on how to debug this?
> >
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: April 26, 2007 11:20 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > I don't close it in anyway directly
> >
> > -----Original Message-----
> > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > Sent: April 26, 2007 11:16 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Re: How to debug object retrieveal in JPA?
> >
> > Can it be that there is a glue code that closes EM in
> between? Just a
> > thought...
> >
> > -marina
> >
> > Phill Moran wrote:
> > > I had suspected the Locale so I made a set/getLocale that
> > communicate
> > > in
> > String.
> > > I figured that openJPA does not actually care how I implement.
> > >
> > > But for this run I removed it completely and did a clean
> > rebuild. Good
> > > news and bad the exception changed:
> > >
> > >
> > > java.util.NoSuchElementException: The result list has been closed.
> > > at
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > tList.java
> > > :91)
> > > at
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > tNonSequen
> > > tialResultList.java:68)
> > > at
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > t.java:241
> > > )
> > > at
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > onFactoryI
> > > mpl.java:99)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39)
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > orImpl.jav
> > > a:25)
> > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > at
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > n(AopUtils
> > > .java:304)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > npoint(Ref
> > > lectiveMethodInvocation.java:172)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:139)
> > > at
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > oke(Transa
> > > ctionInterceptor.java:107)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:161)
> > > at
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > AopProxy.j
> > > ava:203)
> > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39)
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > orImpl.jav
> > > a:25)
> > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > at
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > n(AopUtils
> > > .java:304)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > npoint(Ref
> > > lectiveMethodInvocation.java:172)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:139)
> > > at
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > oke(Transa
> > > ctionInterceptor.java:107)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:161)
> > > at
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > AopProxy.j
> > > ava:203)
> > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > at
> > >
> > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > yTest.java:119)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39)
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > orImpl.jav
> > > a:25)
> > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > at
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > se.java:69
> > > )
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ac
> > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > at
> > >
> > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > nsactionalTests$1.
> > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ru
> > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ru
> > > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ru
> > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > at
> > >
> > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > JpaTests.java:159)
> > > at
> > >
> > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > JpaTests.java:239)
> > > at junit.framework.TestResult$1.protect(TestResult.java:110)
> > > at junit.framework.TestResult.runProtected(TestResult.java:128)
> > > at junit.framework.TestResult.run(TestResult.java:113)
> > > at junit.framework.TestCase.run(TestCase.java:124)
> > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > at
> > >
> > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > Runner.java:35)
> > > at
> > >
> > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > .java:29)
> > > at
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > unner.java
> > > :42)
> > > at
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > AfterRunne
> > > r.java:34)
> > > at
> > >
> > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > .java:52)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > estReferen
> > > ce.java:38)
> > > at
> > >
> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > ecution.java:38)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > TestRunner
> > > .java:460)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > TestRunner
> > > .java:673)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > unner.java
> > > :386)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > Runner.jav
> > > a:196)
> > >
> > > -----Original Message-----
> > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > Sent: April 26, 2007 9:59 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > >
> > >>Caused by: java.lang.NullPointerException
> > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > >> at java.util.Locale.<init>(Locale.java:272)
> > >> at java.util.Locale.<init>(Locale.java:302)
> > >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > >> at
> > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > .java:117)
> > >
> > >
> > > Now we're getting somewhere.... what happens if you remove
> > the Locale
> > > field from the Person class?
> > >
> > > -Patrick
> > >
> > > --
> > > Patrick Linskey
> > > BEA Systems, Inc.
> > >
> >
> ______________________________________________________________________
> > > _
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please
> > immediately return this by email and then delete it.
> > >
> > >
> > >>-----Original Message-----
> > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>Sent: Thursday, April 26, 2007 6:32 PM
> > >>To: open-jpa-dev@incubator.apache.org
> > >>Subject: RE: How to debug object retrieveal in JPA?
> > >>
> > >>Run that config gives us this lovely message:
> > >>
> > >><0|false|0.9.6-incubating>
> > >>org.apache.openjpa.persistence.PersistenceException:
> > >>null
> > >> at
> > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > >> at
> > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > >>Manager.java:773)
> > >> at
> > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > >>.java:254)
> > >> at
> > >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > >>tImpl.java:2115)
> > >> at
> > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > >>.java:248)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > >>tResultObject(Inst
> > >>anceResultObjectProvider.java:56)
> > >> at
> > >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > >>ResultList.java:12
> > >>8)
> > >> at
> > >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > >>(AbstractNonSequen
> > >>tialResultList.java:69)
> > >> at
> > >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > >>esultList.java:241
> > >>)
> > >> at
> > >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > >>ect(PersonFactoryI
> > >>mpl.java:99)
> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >> at
> > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > >>orImpl.java:39)
> > >> at
> > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > >>odAccessorImpl.jav
> > >>a:25)
> > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > >> at
> > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > >>eflection(AopUtils
> > >>.java:304)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > >>nvokeJoinpoint(Ref
> > >>lectiveMethodInvocation.java:172)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:139)
> > >> at
> > >>org.springframework.transaction.interceptor.TransactionInterce
> > >>ptor.invoke(Transa
> > >>ctionInterceptor.java:107)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:161)
> > >> at
> > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > >>kDynamicAopProxy.j
> > >>ava:203)
> > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >> at
> > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > >>orImpl.java:39)
> > >> at
> > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > >>odAccessorImpl.jav
> > >>a:25)
> > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > >> at
> > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > >>eflection(AopUtils
> > >>.java:304)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > >>nvokeJoinpoint(Ref
> > >>lectiveMethodInvocation.java:172)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:139)
> > >> at
> > >>org.springframework.transaction.interceptor.TransactionInterce
> > >>ptor.invoke(Transa
> > >>ctionInterceptor.java:107)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:161)
> > >> at
> > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > >>kDynamicAopProxy.j
> > >>ava:203)
> > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > >> at
> > >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > >>yTest.java:119)
> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >> at
> > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > >>orImpl.java:39)
> > >> at
> > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > >>odAccessorImpl.jav
> > >>a:25)
> > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > >> at
> > >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > >>alTestCase.java:69
> > >>)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ac
> > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests$1.
> > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ru
> > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ru
> > >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ru
> > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > >> at
> > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > >>JpaTests.java:159)
> > >> at
> > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > >>JpaTests.java:239)
> > >> at junit.framework.TestResult$1.protect(TestResult.java:110)
> > >> at junit.framework.TestResult.runProtected(TestResult.java:128)
> > >> at junit.framework.TestResult.run(TestResult.java:113)
> > >> at junit.framework.TestCase.run(TestCase.java:124)
> > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > >> at
> > >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > >>Runner.java:35)
> > >> at
> > >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > >>.java:29)
> > >> at
> > >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > >>stClassRunner.java
> > >>:42)
> > >> at
> > >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > >>eforeAndAfterRunne
> > >>r.java:34)
> > >> at
> > >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > >>.java:52)
> > >> at
> > >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > >>(JUnit4TestReferen
> > >>ce.java:38)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > >>ecution.java:38)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > >>s(RemoteTestRunner
> > >>.java:460)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > >>s(RemoteTestRunner
> > >>.java:673)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > >>oteTestRunner.java
> > >>:386)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > >>moteTestRunner.jav
> > >>a:196)
> > >>Caused by: java.lang.NullPointerException
> > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > >> at java.util.Locale.<init>(Locale.java:272)
> > >> at java.util.Locale.<init>(Locale.java:302)
> > >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > >> at
> > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > .java:117)
> > >> at
> > >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > >>agerImpl.java:247)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > >>e(JDBCStoreManager
> > >>.java:327)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > >>CStoreManager.java
> > >>:252)
> > >> at
> > >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > >>legatingStoreManag
> > >>er.java:108)
> > >> at
> > >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > >>anager.java:54)
> > >> at
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > >> at
> > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > >> ... 64 more
> > >>
> > >>-----Original Message-----
> > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > >>Sent: April 26, 2007 5:40 PM
> > >>To: open-jpa-dev@incubator.apache.org
> > >>Subject: RE: How to debug object retrieveal in JPA?
> > >>
> > >>
> > >>>Can you post what you get if you do '((Exception)
> > >>>results.get(0)).printStackTrace()'?
> > >>
> > >>... so results.get(0) is returning a List? That's very odd.
> > >>What if you
> > >>do:
> > >>
> > >>System.out.println(results.get(0))?
> > >>
> > >>If it is a List of Exceptions, what if you print out the
> > stacks of the
> > >>exceptions in the list?
> > >>
> > >>-Patrick
> > >>
> > >>--
> > >>Patrick Linskey
> > >>BEA Systems, Inc.
> > >>______________________________________________________________
> > >>_________
> > >>Notice: This email message, together with any attachments, may
> > >>contain information of BEA Systems, Inc., its
> subsidiaries and
> > >>affiliated entities, that may be confidential, proprietary,
> > >>copyrighted and/or legally privileged, and is intended
> > solely for the
> > >>use of the individual or entity named in this message. If
> > you are not
> > >>the intended recipient, and have received this message in error,
> > >>please immediately return this by email and then delete it.
> > >>
> > >>
> > >>>-----Original Message-----
> > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > >>>To: open-jpa-dev@incubator.apache.org
> > >>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>
> > >>>Can't cast List to Exception
> > >>>
> > >>>-----Original Message-----
> > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > >>>Sent: April 26, 2007 5:00 PM
> > >>>To: open-jpa-dev@incubator.apache.org
> > >>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>
> > >>>So you're saying that the ResultList contains an Exception?
> > >>>Can you post what you get if you do '((Exception)
> > >>>results.get(0)).printStackTrace()'?
> > >>>
> > >>>-Patrick
> > >>>
> > >>>--
> > >>>Patrick Linskey
> > >>>BEA Systems, Inc.
> > >>>______________________________________________________________
> > >>>_________
> > >>>Notice: This email message, together with any attachments, may
> > >>>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > >>>affiliated entities, that may be confidential, proprietary,
> > >>>copyrighted and/or legally privileged, and is intended
> > >>
> > >>solely for the
> > >>
> > >>>use of the individual or entity named in this message. If
> > >>
> > >>you are not
> > >>
> > >>>the intended recipient, and have received this message in error,
> > >>>please immediately return this by email and then delete it.
> > >>>
> > >>>
> > >>>>-----Original Message-----
> > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > >>>>To: open-jpa-dev@incubator.apache.org
> > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>>
> > >>>>Some more information on this exception
> > >>>>
> > >>>>Right after the execution the exception held inside the
> result is
> > >>>>"com.sun.jdi.InvocationException occurred invoking
> > >>
> > >>method..." Can't
> > >>
> > >>>>seem to get more data out of it
> > >>>>
> > >>>>Once the system.out is executed the exception changes to
> > >>>
> > >>>"The result
> > >>>
> > >>>>list has been closed"
> > >>>>
> > >>>>-----Original Message-----
> > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>>>Sent: April 26, 2007 4:18 PM
> > >>>>To: open-jpa-dev@incubator.apache.org
> > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>>
> > >>>>I did not mean it threw an NPE but I was left with a null
> > >>>
> > >>>result list.
> > >>>
> > >>>>I have setup trace already and I actually get nothing back.
> > >>>>Here is the trace across the execution point
> > >>>>
> > >>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
> > >>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > >>>>Ignoring.
> > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > >>>
> > >>>t0.created,
> > >>>
> > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > >>
> > >>t0.locale,
> > >>
> > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > >>
> > >>t2.description,
> > >>
> > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > >>
> > >>t4.value, t1.id,
> > >>
> > >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > >>>
> > >>>t1.name,
> > >>>
> > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > >>
> > >>t5.value,
> > >>
> > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> manufacturer t1 ON
> > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > >>>
> > >>>t0.roleFK =
> > >>>
> > >>>>t2.id LEFT OUTER JOIN category
> > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > >>>
> > >>>ON t1.typeFK
> > >>>
> > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > >>>
> > >>>t2.categoryTypeFK = t3.id
> > >>>
> > >>>>WHERE
> > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > >>>
> > >>>t0.lastName
> > >>>
> > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > >>>>(String) PMORAN]
> > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> [15 ms] spent
> > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > >>>
> > >>>t1.id LEFT
> > >>>
> > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > >>
> > >>JOIN category
> > >>
> > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > >>>
> > >>>ON t1.typeFK
> > >>>
> > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > >>>
> > >>>t2.categoryTypeFK = t3.id
> > >>>
> > >>>>WHERE
> > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > >>>>[params=(String) BIDSPEC,
> > >>>>(String) PMORAN]
> > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> [0 ms] spent
> > >>>>1
> > >>>>[2007-04-26 16:07:36,125] INFO
> > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > >>>
> > >>>transaction after
> > >>>
> > >>>>test execution
> > >>>>
> > >>>>What is interesting is the line with a "1" (from
> > >>>>System.out.println(results.size())). What this
> represents is the
> > >>>>message that the "result list is closed" nothing else in
> > >>
> > >>the trace.
> > >>
> > >>>>So what causes the result list to be closed?
> > >>>>
> > >>>>Phill
> > >>>>
> > >>>>-----Original Message-----
> > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > >>>
> > >>>On Behalf
> > >>>
> > >>>>Of Marc Prud'hommeaux
> > >>>>Sent: April 26, 2007 3:54 PM
> > >>>>To: open-jpa-dev@incubator.apache.org
> > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > >>>>
> > >>>>Phill-
> > >>>>
> > >>>>The maximum verbosity of logging is obtained by specifying the
> > >>>>"openjpa.Log"
> > >>>>property to "DefaultLevel=TRACE".
> > >>>>
> > >>>>What is the full exception stack trace? We might be
> able to help
> > >>>>identify the problem. In any case OpenJPA should never be
> > >>>
> > >>>throwing an
> > >>>
> > >>>>NPE, so we should at least probably fix the error message.
> > >>>>
> > >>>>
> > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > >>>>
> > >>>>
> > >>>>>Community,
> > >>>>>
> > >>>>>How does one go about debugging object retrieval/creation.
> > >>>>
> > >>>>I continue
> > >>>>
> > >>>>>to have exceptions and little to go on as far as the cause.
> > >>>>>The named JPQL is good since I know it generates a good sql
> > >>>>
> > >>>>(can trace
> > >>>>
> > >>>>>code and see it) . I know the sql is good as I can
> > >>>>
> > >>>>copy/paste it into
> > >>>>
> > >>>>>mysql query browser, execute and get the correct data
> back. The
> > >>>>>problem is that these lines result in an NPE.
> > >>>>>
> > >>>>> Query q =
> > >>>>>
> > >>
> > >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > >>
> > >>>>> q.setParameter("storeName",
> > >>
> > >>storeName.toUpperCase());
> > >>
> > >>>>> q.setParameter("loginName",
> > >>
> > >>loginName.toUpperCase());
> > >>
> > >>>>> List<Person> results = null;
> > >>>>> try {
> > >>>>> results = (List<Person>) q.getResultList();
> > >>>>> System.out.println(results.size());
> > >>>>> }
> > >>>>> catch(Exception e) {
> > >>>>> e.printStackTrace();
> > >>>>> }
> > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > >>>>> throw new UserNotFoundException("No
> > >>>>
> > >>>>user found");
> > >>>>
> > >>>>> }
> > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > >>
> > >>course how
> > >>
> > >>>>>would I know since I can find no description of what a good
> > >>>>
> > >>>>one looks
> > >>>>
> > >>>>>like but reading it (no
> > >>>>>exceptions) seem to make sense.
> > >>>>>
> > >>>>>Any help would be much appreciated.
> > >>>>>
> > >>>>>Phill
> > >>>>>
> > >>>>
> > >>>>
> > >>>Notice: This email message, together with any attachments, may
> > >>>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > >>>affiliated entities, that may be confidential, proprietary,
> > >>>copyrighted and/or legally privileged, and is intended
> > >>
> > >>solely for the
> > >>
> > >>>use of the individual or entity named in this message. If
> > >>
> > >>you are not
> > >>
> > >>>the intended recipient, and have received this message in error,
> > >>>please immediately return this by email and then delete it.
> > >>>
> > >>>
> > >>
> > >>Notice: This email message, together with any attachments, may
> > >>contain information of BEA Systems, Inc., its
> subsidiaries and
> > >>affiliated entities, that may be confidential, proprietary,
> > >>copyrighted and/or legally privileged, and is intended
> > solely for the
> > >>use of the individual or entity named in this message. If
> > you are not
> > >>the intended recipient, and have received this message in error,
> > >>please immediately return this by email and then delete it.
> > >>
> > >>
> > >
> > >
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please
> > immediately return this by email and then delete it.
> > >
> >
> >
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
Odd. Any chance of packaging it up and attaching it to a JIRA issue?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 10:37 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I upgraded and result stayed the same. Also this is in a
> spring transaction. In fact these are all part of JUnit tests.
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 30, 2007 12:05 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> It looks like this exception is different than the others; it
> looks like this exception is actually being thrown, rather
> than being put into your result list.
> Is that correct?
>
> Is this something that you could package up as a test case?
> Also, I seem to remember some sort of issue with overly-eager
> result list closing in non-transactional environments in
> 0.9.6, but I can't find a related JIRA issue.
> It's possible that moving up to 0.9.7 (released Friday;
> http://cwiki.apache.org/openjpa/downloads.html) might get
> around the problem.
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Monday, April 30, 2007 7:28 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Anyone have any more suggestions on how to debug this?
> >
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: April 26, 2007 11:20 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > I don't close it in anyway directly
> >
> > -----Original Message-----
> > From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> > Sent: April 26, 2007 11:16 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Re: How to debug object retrieveal in JPA?
> >
> > Can it be that there is a glue code that closes EM in
> between? Just a
> > thought...
> >
> > -marina
> >
> > Phill Moran wrote:
> > > I had suspected the Locale so I made a set/getLocale that
> > communicate
> > > in
> > String.
> > > I figured that openJPA does not actually care how I implement.
> > >
> > > But for this run I removed it completely and did a clean
> > rebuild. Good
> > > news and bad the exception changed:
> > >
> > >
> > > java.util.NoSuchElementException: The result list has been closed.
> > > at
> > >
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > > tList.java
> > > :91)
> > > at
> > >
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > > tNonSequen
> > > tialResultList.java:68)
> > > at
> > >
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > > t.java:241
> > > )
> > > at
> > >
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > > onFactoryI
> > > mpl.java:99)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39)
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > orImpl.jav
> > > a:25)
> > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > at
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > n(AopUtils
> > > .java:304)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > npoint(Ref
> > > lectiveMethodInvocation.java:172)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:139)
> > > at
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > oke(Transa
> > > ctionInterceptor.java:107)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:161)
> > > at
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > AopProxy.j
> > > ava:203)
> > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39)
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > orImpl.jav
> > > a:25)
> > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > at
> > >
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > > n(AopUtils
> > > .java:304)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > > npoint(Ref
> > > lectiveMethodInvocation.java:172)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:139)
> > > at
> > >
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > > oke(Transa
> > > ctionInterceptor.java:107)
> > > at
> > >
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > > eflectiveM
> > > ethodInvocation.java:161)
> > > at
> > >
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > > AopProxy.j
> > > ava:203)
> > > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > > at
> > >
> > ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > yTest.java:119)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39)
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > > orImpl.jav
> > > a:25)
> > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > at junit.framework.TestCase.runTest(TestCase.java:168)
> > > at junit.framework.TestCase.runBare(TestCase.java:134)
> > > at
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > > se.java:69
> > > )
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ac
> > > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > > at
> > >
> > org.springframework.test.annotation.AbstractAnnotationAwareTra
> > nsactionalTests$1.
> > > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ru
> > > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ru
> > > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > > at
> > >
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > > alTests.ru
> > > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > > at
> > >
> > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > JpaTests.java:159)
> > > at
> > >
> > org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > JpaTests.java:239)
> > > at junit.framework.TestResult$1.protect(TestResult.java:110)
> > > at junit.framework.TestResult.runProtected(TestResult.java:128)
> > > at junit.framework.TestResult.run(TestResult.java:113)
> > > at junit.framework.TestCase.run(TestCase.java:124)
> > > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > > at junit.framework.TestSuite.run(TestSuite.java:227)
> > > at
> > >
> > org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > Runner.java:35)
> > > at
> > >
> > org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > .java:29)
> > > at
> > >
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > > unner.java
> > > :42)
> > > at
> > >
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > > AfterRunne
> > > r.java:34)
> > > at
> > >
> > org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > .java:52)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > > estReferen
> > > ce.java:38)
> > > at
> > >
> > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > ecution.java:38)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > TestRunner
> > > .java:460)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > > TestRunner
> > > .java:673)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > > unner.java
> > > :386)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > > Runner.jav
> > > a:196)
> > >
> > > -----Original Message-----
> > > From: Patrick Linskey [mailto:plinskey@bea.com]
> > > Sent: April 26, 2007 9:59 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > >
> > >>Caused by: java.lang.NullPointerException
> > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > >> at java.util.Locale.<init>(Locale.java:272)
> > >> at java.util.Locale.<init>(Locale.java:302)
> > >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > >> at
> > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > .java:117)
> > >
> > >
> > > Now we're getting somewhere.... what happens if you remove
> > the Locale
> > > field from the Person class?
> > >
> > > -Patrick
> > >
> > > --
> > > Patrick Linskey
> > > BEA Systems, Inc.
> > >
> >
> ______________________________________________________________________
> > > _
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please
> > immediately return this by email and then delete it.
> > >
> > >
> > >>-----Original Message-----
> > >>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>Sent: Thursday, April 26, 2007 6:32 PM
> > >>To: open-jpa-dev@incubator.apache.org
> > >>Subject: RE: How to debug object retrieveal in JPA?
> > >>
> > >>Run that config gives us this lovely message:
> > >>
> > >><0|false|0.9.6-incubating>
> > >>org.apache.openjpa.persistence.PersistenceException:
> > >>null
> > >> at
> > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> > >> at
> > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> > >>Manager.java:773)
> > >> at
> > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > >>.java:254)
> > >> at
> > >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> > >>tImpl.java:2115)
> > >> at
> > >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> > >>.java:248)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> > >>tResultObject(Inst
> > >>anceResultObjectProvider.java:56)
> > >> at
> > >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> > >>ResultList.java:12
> > >>8)
> > >> at
> > >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> > >>(AbstractNonSequen
> > >>tialResultList.java:69)
> > >> at
> > >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> > >>esultList.java:241
> > >>)
> > >> at
> > >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> > >>ect(PersonFactoryI
> > >>mpl.java:99)
> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >> at
> > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > >>orImpl.java:39)
> > >> at
> > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > >>odAccessorImpl.jav
> > >>a:25)
> > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > >> at
> > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > >>eflection(AopUtils
> > >>.java:304)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > >>nvokeJoinpoint(Ref
> > >>lectiveMethodInvocation.java:172)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:139)
> > >> at
> > >>org.springframework.transaction.interceptor.TransactionInterce
> > >>ptor.invoke(Transa
> > >>ctionInterceptor.java:107)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:161)
> > >> at
> > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > >>kDynamicAopProxy.j
> > >>ava:203)
> > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >> at
> > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > >>orImpl.java:39)
> > >> at
> > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > >>odAccessorImpl.jav
> > >>a:25)
> > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > >> at
> > >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> > >>eflection(AopUtils
> > >>.java:304)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> > >>nvokeJoinpoint(Ref
> > >>lectiveMethodInvocation.java:172)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:139)
> > >> at
> > >>org.springframework.transaction.interceptor.TransactionInterce
> > >>ptor.invoke(Transa
> > >>ctionInterceptor.java:107)
> > >> at
> > >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> > >>roceed(ReflectiveM
> > >>ethodInvocation.java:161)
> > >> at
> > >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> > >>kDynamicAopProxy.j
> > >>ava:203)
> > >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > >> at
> > >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> > >>yTest.java:119)
> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >> at
> > >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > >>orImpl.java:39)
> > >> at
> > >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > >>odAccessorImpl.jav
> > >>a:25)
> > >> at java.lang.reflect.Method.invoke(Method.java:597)
> > >> at junit.framework.TestCase.runTest(TestCase.java:168)
> > >> at junit.framework.TestCase.runBare(TestCase.java:134)
> > >> at
> > >>org.springframework.test.ConditionalTestCase.runBare(Condition
> > >>alTestCase.java:69
> > >>)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ac
> > >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests$1.
> > >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ru
> > >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ru
> > >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > >> at
> > >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> > >>nsactionalTests.ru
> > >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > >> at
> > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > >>JpaTests.java:159)
> > >> at
> > >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> > >>JpaTests.java:239)
> > >> at junit.framework.TestResult$1.protect(TestResult.java:110)
> > >> at junit.framework.TestResult.runProtected(TestResult.java:128)
> > >> at junit.framework.TestResult.run(TestResult.java:113)
> > >> at junit.framework.TestCase.run(TestCase.java:124)
> > >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > >> at junit.framework.TestSuite.run(TestSuite.java:227)
> > >> at
> > >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> > >>Runner.java:35)
> > >> at
> > >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> > >>.java:29)
> > >> at
> > >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> > >>stClassRunner.java
> > >>:42)
> > >> at
> > >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> > >>eforeAndAfterRunne
> > >>r.java:34)
> > >> at
> > >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> > >>.java:52)
> > >> at
> > >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> > >>(JUnit4TestReferen
> > >>ce.java:38)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> > >>ecution.java:38)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > >>s(RemoteTestRunner
> > >>.java:460)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> > >>s(RemoteTestRunner
> > >>.java:673)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> > >>oteTestRunner.java
> > >>:386)
> > >> at
> > >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> > >>moteTestRunner.jav
> > >>a:196)
> > >>Caused by: java.lang.NullPointerException
> > >> at java.util.Locale.toLowerCase(Locale.java:1060)
> > >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> > >> at java.util.Locale.<init>(Locale.java:272)
> > >> at java.util.Locale.<init>(Locale.java:302)
> > >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> > >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> > >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> > >> at
> > >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> > .java:117)
> > >> at
> > >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> > >>agerImpl.java:247)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> > >>e(JDBCStoreManager
> > >>.java:327)
> > >> at
> > >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> > >>CStoreManager.java
> > >>:252)
> > >> at
> > >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> > >>legatingStoreManag
> > >>er.java:108)
> > >> at
> > >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> > >>anager.java:54)
> > >> at
> >
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> > >> at
> > >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> > >> ... 64 more
> > >>
> > >>-----Original Message-----
> > >>From: Patrick Linskey [mailto:plinskey@bea.com]
> > >>Sent: April 26, 2007 5:40 PM
> > >>To: open-jpa-dev@incubator.apache.org
> > >>Subject: RE: How to debug object retrieveal in JPA?
> > >>
> > >>
> > >>>Can you post what you get if you do '((Exception)
> > >>>results.get(0)).printStackTrace()'?
> > >>
> > >>... so results.get(0) is returning a List? That's very odd.
> > >>What if you
> > >>do:
> > >>
> > >>System.out.println(results.get(0))?
> > >>
> > >>If it is a List of Exceptions, what if you print out the
> > stacks of the
> > >>exceptions in the list?
> > >>
> > >>-Patrick
> > >>
> > >>--
> > >>Patrick Linskey
> > >>BEA Systems, Inc.
> > >>______________________________________________________________
> > >>_________
> > >>Notice: This email message, together with any attachments, may
> > >>contain information of BEA Systems, Inc., its
> subsidiaries and
> > >>affiliated entities, that may be confidential, proprietary,
> > >>copyrighted and/or legally privileged, and is intended
> > solely for the
> > >>use of the individual or entity named in this message. If
> > you are not
> > >>the intended recipient, and have received this message in error,
> > >>please immediately return this by email and then delete it.
> > >>
> > >>
> > >>>-----Original Message-----
> > >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>>Sent: Thursday, April 26, 2007 2:36 PM
> > >>>To: open-jpa-dev@incubator.apache.org
> > >>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>
> > >>>Can't cast List to Exception
> > >>>
> > >>>-----Original Message-----
> > >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> > >>>Sent: April 26, 2007 5:00 PM
> > >>>To: open-jpa-dev@incubator.apache.org
> > >>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>
> > >>>So you're saying that the ResultList contains an Exception?
> > >>>Can you post what you get if you do '((Exception)
> > >>>results.get(0)).printStackTrace()'?
> > >>>
> > >>>-Patrick
> > >>>
> > >>>--
> > >>>Patrick Linskey
> > >>>BEA Systems, Inc.
> > >>>______________________________________________________________
> > >>>_________
> > >>>Notice: This email message, together with any attachments, may
> > >>>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > >>>affiliated entities, that may be confidential, proprietary,
> > >>>copyrighted and/or legally privileged, and is intended
> > >>
> > >>solely for the
> > >>
> > >>>use of the individual or entity named in this message. If
> > >>
> > >>you are not
> > >>
> > >>>the intended recipient, and have received this message in error,
> > >>>please immediately return this by email and then delete it.
> > >>>
> > >>>
> > >>>>-----Original Message-----
> > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>>>Sent: Thursday, April 26, 2007 1:44 PM
> > >>>>To: open-jpa-dev@incubator.apache.org
> > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>>
> > >>>>Some more information on this exception
> > >>>>
> > >>>>Right after the execution the exception held inside the
> result is
> > >>>>"com.sun.jdi.InvocationException occurred invoking
> > >>
> > >>method..." Can't
> > >>
> > >>>>seem to get more data out of it
> > >>>>
> > >>>>Once the system.out is executed the exception changes to
> > >>>
> > >>>"The result
> > >>>
> > >>>>list has been closed"
> > >>>>
> > >>>>-----Original Message-----
> > >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> > >>>>Sent: April 26, 2007 4:18 PM
> > >>>>To: open-jpa-dev@incubator.apache.org
> > >>>>Subject: RE: How to debug object retrieveal in JPA?
> > >>>>
> > >>>>I did not mean it threw an NPE but I was left with a null
> > >>>
> > >>>result list.
> > >>>
> > >>>>I have setup trace already and I actually get nothing back.
> > >>>>Here is the trace across the execution point
> > >>>>
> > >>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
> > >>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > >>>>Ignoring.
> > >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> > >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > >>>
> > >>>t0.created,
> > >>>
> > >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> > >>
> > >>t0.locale,
> > >>
> > >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> > >>
> > >>t2.description,
> > >>
> > >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> > >>
> > >>t4.value, t1.id,
> > >>
> > >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > >>>
> > >>>t1.name,
> > >>>
> > >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> > >>
> > >>t5.value,
> > >>
> > >>>>t0.title, t0.visible FROM person t0 INNER JOIN
> manufacturer t1 ON
> > >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > >>>
> > >>>t0.roleFK =
> > >>>
> > >>>>t2.id LEFT OUTER JOIN category
> > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > >>>
> > >>>ON t1.typeFK
> > >>>
> > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > >>>
> > >>>t2.categoryTypeFK = t3.id
> > >>>
> > >>>>WHERE
> > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > >>>
> > >>>t0.lastName
> > >>>
> > >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > >>>>(String) PMORAN]
> > >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> [15 ms] spent
> > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > >>>
> > >>>t1.id LEFT
> > >>>
> > >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> > >>
> > >>JOIN category
> > >>
> > >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > >>>
> > >>>ON t1.typeFK
> > >>>
> > >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> > >>>
> > >>>t2.categoryTypeFK = t3.id
> > >>>
> > >>>>WHERE
> > >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > >>>>[params=(String) BIDSPEC,
> > >>>>(String) PMORAN]
> > >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > >>>>9575056> [0 ms] spent
> > >>>>1
> > >>>>[2007-04-26 16:07:36,125] INFO
> > >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > >>>
> > >>>transaction after
> > >>>
> > >>>>test execution
> > >>>>
> > >>>>What is interesting is the line with a "1" (from
> > >>>>System.out.println(results.size())). What this
> represents is the
> > >>>>message that the "result list is closed" nothing else in
> > >>
> > >>the trace.
> > >>
> > >>>>So what causes the result list to be closed?
> > >>>>
> > >>>>Phill
> > >>>>
> > >>>>-----Original Message-----
> > >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > >>>
> > >>>On Behalf
> > >>>
> > >>>>Of Marc Prud'hommeaux
> > >>>>Sent: April 26, 2007 3:54 PM
> > >>>>To: open-jpa-dev@incubator.apache.org
> > >>>>Subject: Re: How to debug object retrieveal in JPA?
> > >>>>
> > >>>>Phill-
> > >>>>
> > >>>>The maximum verbosity of logging is obtained by specifying the
> > >>>>"openjpa.Log"
> > >>>>property to "DefaultLevel=TRACE".
> > >>>>
> > >>>>What is the full exception stack trace? We might be
> able to help
> > >>>>identify the problem. In any case OpenJPA should never be
> > >>>
> > >>>throwing an
> > >>>
> > >>>>NPE, so we should at least probably fix the error message.
> > >>>>
> > >>>>
> > >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > >>>>
> > >>>>
> > >>>>>Community,
> > >>>>>
> > >>>>>How does one go about debugging object retrieval/creation.
> > >>>>
> > >>>>I continue
> > >>>>
> > >>>>>to have exceptions and little to go on as far as the cause.
> > >>>>>The named JPQL is good since I know it generates a good sql
> > >>>>
> > >>>>(can trace
> > >>>>
> > >>>>>code and see it) . I know the sql is good as I can
> > >>>>
> > >>>>copy/paste it into
> > >>>>
> > >>>>>mysql query browser, execute and get the correct data
> back. The
> > >>>>>problem is that these lines result in an NPE.
> > >>>>>
> > >>>>> Query q =
> > >>>>>
> > >>
> > >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > >>
> > >>>>> q.setParameter("storeName",
> > >>
> > >>storeName.toUpperCase());
> > >>
> > >>>>> q.setParameter("loginName",
> > >>
> > >>loginName.toUpperCase());
> > >>
> > >>>>> List<Person> results = null;
> > >>>>> try {
> > >>>>> results = (List<Person>) q.getResultList();
> > >>>>> System.out.println(results.size());
> > >>>>> }
> > >>>>> catch(Exception e) {
> > >>>>> e.printStackTrace();
> > >>>>> }
> > >>>>> if (results.isEmpty()) { <- NPE thrown here
> > >>>>> throw new UserNotFoundException("No
> > >>>>
> > >>>>user found");
> > >>>>
> > >>>>> }
> > >>>>>Also the "mappingTool validate" seems to work fine. Of
> > >>
> > >>course how
> > >>
> > >>>>>would I know since I can find no description of what a good
> > >>>>
> > >>>>one looks
> > >>>>
> > >>>>>like but reading it (no
> > >>>>>exceptions) seem to make sense.
> > >>>>>
> > >>>>>Any help would be much appreciated.
> > >>>>>
> > >>>>>Phill
> > >>>>>
> > >>>>
> > >>>>
> > >>>Notice: This email message, together with any attachments, may
> > >>>contain information of BEA Systems, Inc., its
> > subsidiaries and
> > >>>affiliated entities, that may be confidential, proprietary,
> > >>>copyrighted and/or legally privileged, and is intended
> > >>
> > >>solely for the
> > >>
> > >>>use of the individual or entity named in this message. If
> > >>
> > >>you are not
> > >>
> > >>>the intended recipient, and have received this message in error,
> > >>>please immediately return this by email and then delete it.
> > >>>
> > >>>
> > >>
> > >>Notice: This email message, together with any attachments, may
> > >>contain information of BEA Systems, Inc., its
> subsidiaries and
> > >>affiliated entities, that may be confidential, proprietary,
> > >>copyrighted and/or legally privileged, and is intended
> > solely for the
> > >>use of the individual or entity named in this message. If
> > you are not
> > >>the intended recipient, and have received this message in error,
> > >>please immediately return this by email and then delete it.
> > >>
> > >>
> > >
> > >
> > > Notice: This email message, together with any attachments, may
> > > contain information of BEA Systems, Inc., its
> subsidiaries and
> > > affiliated entities, that may be confidential, proprietary,
> > > copyrighted and/or legally privileged, and is intended
> > solely for the
> > > use of the individual or entity named in this message. If
> > you are not
> > > the intended recipient, and have received this message in error,
> > > please
> > immediately return this by email and then delete it.
> > >
> >
> >
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
I upgraded and result stayed the same. Also this is in a spring transaction. In
fact these are all part of JUnit tests.
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 30, 2007 12:05 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
It looks like this exception is different than the others; it looks like this
exception is actually being thrown, rather than being put into your result list.
Is that correct?
Is this something that you could package up as a test case? Also, I seem to
remember some sort of issue with overly-eager result list closing in
non-transactional environments in 0.9.6, but I can't find a related JIRA issue.
It's possible that moving up to 0.9.7 (released Friday;
http://cwiki.apache.org/openjpa/downloads.html) might get around the problem.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 7:28 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Anyone have any more suggestions on how to debug this?
>
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: April 26, 2007 11:20 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I don't close it in anyway directly
>
> -----Original Message-----
> From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> Sent: April 26, 2007 11:16 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> Can it be that there is a glue code that closes EM in between? Just a
> thought...
>
> -marina
>
> Phill Moran wrote:
> > I had suspected the Locale so I made a set/getLocale that
> communicate
> > in
> String.
> > I figured that openJPA does not actually care how I implement.
> >
> > But for this run I removed it completely and did a clean
> rebuild. Good
> > news and bad the exception changed:
> >
> >
> > java.util.NoSuchElementException: The result list has been closed.
> > at
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > tList.java
> > :91)
> > at
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > tNonSequen
> > tialResultList.java:68)
> > at
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > t.java:241
> > )
> > at
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > onFactoryI
> > mpl.java:99)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.jav
> > a:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > n(AopUtils
> > .java:304)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > npoint(Ref
> > lectiveMethodInvocation.java:172)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:139)
> > at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > oke(Transa
> > ctionInterceptor.java:107)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:161)
> > at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > AopProxy.j
> > ava:203)
> > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.jav
> > a:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > n(AopUtils
> > .java:304)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > npoint(Ref
> > lectiveMethodInvocation.java:172)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:139)
> > at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > oke(Transa
> > ctionInterceptor.java:107)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:161)
> > at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > AopProxy.j
> > ava:203)
> > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > at
> >
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> yTest.java:119)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.jav
> > a:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at junit.framework.TestCase.runTest(TestCase.java:168)
> > at junit.framework.TestCase.runBare(TestCase.java:134)
> > at
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > se.java:69
> > )
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ac
> > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests$1.
> > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ru
> > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ru
> > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ru
> > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > at
> >
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:159)
> > at
> >
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:239)
> > at junit.framework.TestResult$1.protect(TestResult.java:110)
> > at junit.framework.TestResult.runProtected(TestResult.java:128)
> > at junit.framework.TestResult.run(TestResult.java:113)
> > at junit.framework.TestCase.run(TestCase.java:124)
> > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > at junit.framework.TestSuite.run(TestSuite.java:227)
> > at
> >
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> Runner.java:35)
> > at
> >
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> .java:29)
> > at
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > unner.java
> > :42)
> > at
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > AfterRunne
> > r.java:34)
> > at
> >
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> .java:52)
> > at
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > estReferen
> > ce.java:38)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> ecution.java:38)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > TestRunner
> > .java:460)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > TestRunner
> > .java:673)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > unner.java
> > :386)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > Runner.jav
> > a:196)
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 26, 2007 9:59 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> >
> >>Caused by: java.lang.NullPointerException
> >> at java.util.Locale.toLowerCase(Locale.java:1060)
> >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> >> at java.util.Locale.<init>(Locale.java:272)
> >> at java.util.Locale.<init>(Locale.java:302)
> >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> >> at
> >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> .java:117)
> >
> >
> > Now we're getting somewhere.... what happens if you remove
> the Locale
> > field from the Person class?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> >
> ______________________________________________________________________
> > _
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please
> immediately return this by email and then delete it.
> >
> >
> >>-----Original Message-----
> >>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>Sent: Thursday, April 26, 2007 6:32 PM
> >>To: open-jpa-dev@incubator.apache.org
> >>Subject: RE: How to debug object retrieveal in JPA?
> >>
> >>Run that config gives us this lovely message:
> >>
> >><0|false|0.9.6-incubating>
> >>org.apache.openjpa.persistence.PersistenceException:
> >>null
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> >> at
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> >>Manager.java:773)
> >> at
> >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> >>.java:254)
> >> at
> >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> >>tImpl.java:2115)
> >> at
> >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> >>.java:248)
> >> at
> >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> >>tResultObject(Inst
> >>anceResultObjectProvider.java:56)
> >> at
> >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> >>ResultList.java:12
> >>8)
> >> at
> >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> >>(AbstractNonSequen
> >>tialResultList.java:69)
> >> at
> >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> >>esultList.java:241
> >>)
> >> at
> >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> >>ect(PersonFactoryI
> >>mpl.java:99)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> >>orImpl.java:39)
> >> at
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> >>odAccessorImpl.jav
> >>a:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at
> >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> >>eflection(AopUtils
> >>.java:304)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> >>nvokeJoinpoint(Ref
> >>lectiveMethodInvocation.java:172)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:139)
> >> at
> >>org.springframework.transaction.interceptor.TransactionInterce
> >>ptor.invoke(Transa
> >>ctionInterceptor.java:107)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:161)
> >> at
> >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> >>kDynamicAopProxy.j
> >>ava:203)
> >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> >>orImpl.java:39)
> >> at
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> >>odAccessorImpl.jav
> >>a:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at
> >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> >>eflection(AopUtils
> >>.java:304)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> >>nvokeJoinpoint(Ref
> >>lectiveMethodInvocation.java:172)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:139)
> >> at
> >>org.springframework.transaction.interceptor.TransactionInterce
> >>ptor.invoke(Transa
> >>ctionInterceptor.java:107)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:161)
> >> at
> >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> >>kDynamicAopProxy.j
> >>ava:203)
> >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> >> at
> >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> >>yTest.java:119)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> >>orImpl.java:39)
> >> at
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> >>odAccessorImpl.jav
> >>a:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at junit.framework.TestCase.runTest(TestCase.java:168)
> >> at junit.framework.TestCase.runBare(TestCase.java:134)
> >> at
> >>org.springframework.test.ConditionalTestCase.runBare(Condition
> >>alTestCase.java:69
> >>)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ac
> >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests$1.
> >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ru
> >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ru
> >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ru
> >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> >> at
> >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> >>JpaTests.java:159)
> >> at
> >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> >>JpaTests.java:239)
> >> at junit.framework.TestResult$1.protect(TestResult.java:110)
> >> at junit.framework.TestResult.runProtected(TestResult.java:128)
> >> at junit.framework.TestResult.run(TestResult.java:113)
> >> at junit.framework.TestCase.run(TestCase.java:124)
> >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> >> at junit.framework.TestSuite.run(TestSuite.java:227)
> >> at
> >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> >>Runner.java:35)
> >> at
> >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> >>.java:29)
> >> at
> >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> >>stClassRunner.java
> >>:42)
> >> at
> >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> >>eforeAndAfterRunne
> >>r.java:34)
> >> at
> >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> >>.java:52)
> >> at
> >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> >>(JUnit4TestReferen
> >>ce.java:38)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> >>ecution.java:38)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> >>s(RemoteTestRunner
> >>.java:460)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> >>s(RemoteTestRunner
> >>.java:673)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> >>oteTestRunner.java
> >>:386)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> >>moteTestRunner.jav
> >>a:196)
> >>Caused by: java.lang.NullPointerException
> >> at java.util.Locale.toLowerCase(Locale.java:1060)
> >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> >> at java.util.Locale.<init>(Locale.java:272)
> >> at java.util.Locale.<init>(Locale.java:302)
> >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> >> at
> >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> .java:117)
> >> at
> >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> >>agerImpl.java:247)
> >> at
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> >>e(JDBCStoreManager
> >>.java:327)
> >> at
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> >>CStoreManager.java
> >>:252)
> >> at
> >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> >>legatingStoreManag
> >>er.java:108)
> >> at
> >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> >>anager.java:54)
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> >> ... 64 more
> >>
> >>-----Original Message-----
> >>From: Patrick Linskey [mailto:plinskey@bea.com]
> >>Sent: April 26, 2007 5:40 PM
> >>To: open-jpa-dev@incubator.apache.org
> >>Subject: RE: How to debug object retrieveal in JPA?
> >>
> >>
> >>>Can you post what you get if you do '((Exception)
> >>>results.get(0)).printStackTrace()'?
> >>
> >>... so results.get(0) is returning a List? That's very odd.
> >>What if you
> >>do:
> >>
> >>System.out.println(results.get(0))?
> >>
> >>If it is a List of Exceptions, what if you print out the
> stacks of the
> >>exceptions in the list?
> >>
> >>-Patrick
> >>
> >>--
> >>Patrick Linskey
> >>BEA Systems, Inc.
> >>______________________________________________________________
> >>_________
> >>Notice: This email message, together with any attachments, may
> >>contain information of BEA Systems, Inc., its subsidiaries and
> >>affiliated entities, that may be confidential, proprietary,
> >>copyrighted and/or legally privileged, and is intended
> solely for the
> >>use of the individual or entity named in this message. If
> you are not
> >>the intended recipient, and have received this message in error,
> >>please immediately return this by email and then delete it.
> >>
> >>
> >>>-----Original Message-----
> >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>>Sent: Thursday, April 26, 2007 2:36 PM
> >>>To: open-jpa-dev@incubator.apache.org
> >>>Subject: RE: How to debug object retrieveal in JPA?
> >>>
> >>>Can't cast List to Exception
> >>>
> >>>-----Original Message-----
> >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> >>>Sent: April 26, 2007 5:00 PM
> >>>To: open-jpa-dev@incubator.apache.org
> >>>Subject: RE: How to debug object retrieveal in JPA?
> >>>
> >>>So you're saying that the ResultList contains an Exception?
> >>>Can you post what you get if you do '((Exception)
> >>>results.get(0)).printStackTrace()'?
> >>>
> >>>-Patrick
> >>>
> >>>--
> >>>Patrick Linskey
> >>>BEA Systems, Inc.
> >>>______________________________________________________________
> >>>_________
> >>>Notice: This email message, together with any attachments, may
> >>>contain information of BEA Systems, Inc., its
> subsidiaries and
> >>>affiliated entities, that may be confidential, proprietary,
> >>>copyrighted and/or legally privileged, and is intended
> >>
> >>solely for the
> >>
> >>>use of the individual or entity named in this message. If
> >>
> >>you are not
> >>
> >>>the intended recipient, and have received this message in error,
> >>>please immediately return this by email and then delete it.
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>>>Sent: Thursday, April 26, 2007 1:44 PM
> >>>>To: open-jpa-dev@incubator.apache.org
> >>>>Subject: RE: How to debug object retrieveal in JPA?
> >>>>
> >>>>Some more information on this exception
> >>>>
> >>>>Right after the execution the exception held inside the result is
> >>>>"com.sun.jdi.InvocationException occurred invoking
> >>
> >>method..." Can't
> >>
> >>>>seem to get more data out of it
> >>>>
> >>>>Once the system.out is executed the exception changes to
> >>>
> >>>"The result
> >>>
> >>>>list has been closed"
> >>>>
> >>>>-----Original Message-----
> >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>>>Sent: April 26, 2007 4:18 PM
> >>>>To: open-jpa-dev@incubator.apache.org
> >>>>Subject: RE: How to debug object retrieveal in JPA?
> >>>>
> >>>>I did not mean it threw an NPE but I was left with a null
> >>>
> >>>result list.
> >>>
> >>>>I have setup trace already and I actually get nothing back.
> >>>>Here is the trace across the execution point
> >>>>
> >>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
> >>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> >>>>Ignoring.
> >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> >>>
> >>>t0.created,
> >>>
> >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> >>
> >>t0.locale,
> >>
> >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> >>
> >>t2.description,
> >>
> >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> >>
> >>t4.value, t1.id,
> >>
> >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> >>>
> >>>t1.name,
> >>>
> >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> >>
> >>t5.value,
> >>
> >>>>t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> >>>
> >>>t0.roleFK =
> >>>
> >>>>t2.id LEFT OUTER JOIN category
> >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> >>>
> >>>ON t1.typeFK
> >>>
> >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> >>>
> >>>t2.categoryTypeFK = t3.id
> >>>
> >>>>WHERE
> >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> >>>
> >>>t0.lastName
> >>>
> >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> >>>>(String) PMORAN]
> >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> [15 ms] spent
> >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> >>>
> >>>t1.id LEFT
> >>>
> >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> >>
> >>JOIN category
> >>
> >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> >>>
> >>>ON t1.typeFK
> >>>
> >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> >>>
> >>>t2.categoryTypeFK = t3.id
> >>>
> >>>>WHERE
> >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> >>>>[params=(String) BIDSPEC,
> >>>>(String) PMORAN]
> >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> [0 ms] spent
> >>>>1
> >>>>[2007-04-26 16:07:36,125] INFO
> >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> >>>
> >>>transaction after
> >>>
> >>>>test execution
> >>>>
> >>>>What is interesting is the line with a "1" (from
> >>>>System.out.println(results.size())). What this represents is the
> >>>>message that the "result list is closed" nothing else in
> >>
> >>the trace.
> >>
> >>>>So what causes the result list to be closed?
> >>>>
> >>>>Phill
> >>>>
> >>>>-----Original Message-----
> >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> >>>
> >>>On Behalf
> >>>
> >>>>Of Marc Prud'hommeaux
> >>>>Sent: April 26, 2007 3:54 PM
> >>>>To: open-jpa-dev@incubator.apache.org
> >>>>Subject: Re: How to debug object retrieveal in JPA?
> >>>>
> >>>>Phill-
> >>>>
> >>>>The maximum verbosity of logging is obtained by specifying the
> >>>>"openjpa.Log"
> >>>>property to "DefaultLevel=TRACE".
> >>>>
> >>>>What is the full exception stack trace? We might be able to help
> >>>>identify the problem. In any case OpenJPA should never be
> >>>
> >>>throwing an
> >>>
> >>>>NPE, so we should at least probably fix the error message.
> >>>>
> >>>>
> >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> >>>>
> >>>>
> >>>>>Community,
> >>>>>
> >>>>>How does one go about debugging object retrieval/creation.
> >>>>
> >>>>I continue
> >>>>
> >>>>>to have exceptions and little to go on as far as the cause.
> >>>>>The named JPQL is good since I know it generates a good sql
> >>>>
> >>>>(can trace
> >>>>
> >>>>>code and see it) . I know the sql is good as I can
> >>>>
> >>>>copy/paste it into
> >>>>
> >>>>>mysql query browser, execute and get the correct data back. The
> >>>>>problem is that these lines result in an NPE.
> >>>>>
> >>>>> Query q =
> >>>>>
> >>
> >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> >>
> >>>>> q.setParameter("storeName",
> >>
> >>storeName.toUpperCase());
> >>
> >>>>> q.setParameter("loginName",
> >>
> >>loginName.toUpperCase());
> >>
> >>>>> List<Person> results = null;
> >>>>> try {
> >>>>> results = (List<Person>) q.getResultList();
> >>>>> System.out.println(results.size());
> >>>>> }
> >>>>> catch(Exception e) {
> >>>>> e.printStackTrace();
> >>>>> }
> >>>>> if (results.isEmpty()) { <- NPE thrown here
> >>>>> throw new UserNotFoundException("No
> >>>>
> >>>>user found");
> >>>>
> >>>>> }
> >>>>>Also the "mappingTool validate" seems to work fine. Of
> >>
> >>course how
> >>
> >>>>>would I know since I can find no description of what a good
> >>>>
> >>>>one looks
> >>>>
> >>>>>like but reading it (no
> >>>>>exceptions) seem to make sense.
> >>>>>
> >>>>>Any help would be much appreciated.
> >>>>>
> >>>>>Phill
> >>>>>
> >>>>
> >>>>
> >>>Notice: This email message, together with any attachments, may
> >>>contain information of BEA Systems, Inc., its
> subsidiaries and
> >>>affiliated entities, that may be confidential, proprietary,
> >>>copyrighted and/or legally privileged, and is intended
> >>
> >>solely for the
> >>
> >>>use of the individual or entity named in this message. If
> >>
> >>you are not
> >>
> >>>the intended recipient, and have received this message in error,
> >>>please immediately return this by email and then delete it.
> >>>
> >>>
> >>
> >>Notice: This email message, together with any attachments, may
> >>contain information of BEA Systems, Inc., its subsidiaries and
> >>affiliated entities, that may be confidential, proprietary,
> >>copyrighted and/or legally privileged, and is intended
> solely for the
> >>use of the individual or entity named in this message. If
> you are not
> >>the intended recipient, and have received this message in error,
> >>please immediately return this by email and then delete it.
> >>
> >>
> >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please
> immediately return this by email and then delete it.
> >
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
It looks like this exception is different than the others; it looks like
this exception is actually being thrown, rather than being put into your
result list. Is that correct?
Is this something that you could package up as a test case? Also, I seem
to remember some sort of issue with overly-eager result list closing in
non-transactional environments in 0.9.6, but I can't find a related JIRA
issue. It's possible that moving up to 0.9.7 (released Friday;
http://cwiki.apache.org/openjpa/downloads.html) might get around the
problem.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Monday, April 30, 2007 7:28 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Anyone have any more suggestions on how to debug this?
>
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: April 26, 2007 11:20 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I don't close it in anyway directly
>
> -----Original Message-----
> From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
> Sent: April 26, 2007 11:16 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> Can it be that there is a glue code that closes EM in
> between? Just a thought...
>
> -marina
>
> Phill Moran wrote:
> > I had suspected the Locale so I made a set/getLocale that
> communicate
> > in
> String.
> > I figured that openJPA does not actually care how I implement.
> >
> > But for this run I removed it completely and did a clean
> rebuild. Good
> > news and bad the exception changed:
> >
> >
> > java.util.NoSuchElementException: The result list has been closed.
> > at
> >
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> > tList.java
> > :91)
> > at
> >
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> > tNonSequen
> > tialResultList.java:68)
> > at
> >
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> > t.java:241
> > )
> > at
> >
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> > onFactoryI
> > mpl.java:99)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.jav
> > a:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > n(AopUtils
> > .java:304)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > npoint(Ref
> > lectiveMethodInvocation.java:172)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:139)
> > at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > oke(Transa
> > ctionInterceptor.java:107)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:161)
> > at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > AopProxy.j
> > ava:203)
> > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.jav
> > a:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> > n(AopUtils
> > .java:304)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> > npoint(Ref
> > lectiveMethodInvocation.java:172)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:139)
> > at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> > oke(Transa
> > ctionInterceptor.java:107)
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> > eflectiveM
> > ethodInvocation.java:161)
> > at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> > AopProxy.j
> > ava:203)
> > at $Proxy34.getLoginPersonValueObject(Unknown Source)
> > at
> >
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> yTest.java:119)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.jav
> > a:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at junit.framework.TestCase.runTest(TestCase.java:168)
> > at junit.framework.TestCase.runBare(TestCase.java:134)
> > at
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> > se.java:69
> > )
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ac
> > cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests$1.
> > run(AbstractAnnotationAwareTransactionalTests.java:115)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ru
> > nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ru
> > nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> > at
> >
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> > alTests.ru
> > nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> > at
> >
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:159)
> > at
> >
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:239)
> > at junit.framework.TestResult$1.protect(TestResult.java:110)
> > at junit.framework.TestResult.runProtected(TestResult.java:128)
> > at junit.framework.TestResult.run(TestResult.java:113)
> > at junit.framework.TestCase.run(TestCase.java:124)
> > at junit.framework.TestSuite.runTest(TestSuite.java:232)
> > at junit.framework.TestSuite.run(TestSuite.java:227)
> > at
> >
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> Runner.java:35)
> > at
> >
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> .java:29)
> > at
> >
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> > unner.java
> > :42)
> > at
> >
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> > AfterRunne
> > r.java:34)
> > at
> >
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> .java:52)
> > at
> >
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> > estReferen
> > ce.java:38)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> ecution.java:38)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > TestRunner
> > .java:460)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> > TestRunner
> > .java:673)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> > unner.java
> > :386)
> > at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> > Runner.jav
> > a:196)
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 26, 2007 9:59 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> >
> >>Caused by: java.lang.NullPointerException
> >> at java.util.Locale.toLowerCase(Locale.java:1060)
> >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> >> at java.util.Locale.<init>(Locale.java:272)
> >> at java.util.Locale.<init>(Locale.java:302)
> >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> >> at
> >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> .java:117)
> >
> >
> > Now we're getting somewhere.... what happens if you remove
> the Locale
> > field from the Person class?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> >
> ______________________________________________________________________
> > _
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please
> immediately return this by email and then delete it.
> >
> >
> >>-----Original Message-----
> >>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>Sent: Thursday, April 26, 2007 6:32 PM
> >>To: open-jpa-dev@incubator.apache.org
> >>Subject: RE: How to debug object retrieveal in JPA?
> >>
> >>Run that config gives us this lovely message:
> >>
> >><0|false|0.9.6-incubating>
> >>org.apache.openjpa.persistence.PersistenceException:
> >>null
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> >> at
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> >>Manager.java:773)
> >> at
> >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> >>.java:254)
> >> at
> >>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> >>tImpl.java:2115)
> >> at
> >>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> >>.java:248)
> >> at
> >>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> >>tResultObject(Inst
> >>anceResultObjectProvider.java:56)
> >> at
> >>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> >>ResultList.java:12
> >>8)
> >> at
> >>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> >>(AbstractNonSequen
> >>tialResultList.java:69)
> >> at
> >>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> >>esultList.java:241
> >>)
> >> at
> >>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> >>ect(PersonFactoryI
> >>mpl.java:99)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> >>orImpl.java:39)
> >> at
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> >>odAccessorImpl.jav
> >>a:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at
> >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> >>eflection(AopUtils
> >>.java:304)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> >>nvokeJoinpoint(Ref
> >>lectiveMethodInvocation.java:172)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:139)
> >> at
> >>org.springframework.transaction.interceptor.TransactionInterce
> >>ptor.invoke(Transa
> >>ctionInterceptor.java:107)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:161)
> >> at
> >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> >>kDynamicAopProxy.j
> >>ava:203)
> >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> >>orImpl.java:39)
> >> at
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> >>odAccessorImpl.jav
> >>a:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at
> >>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> >>eflection(AopUtils
> >>.java:304)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.i
> >>nvokeJoinpoint(Ref
> >>lectiveMethodInvocation.java:172)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:139)
> >> at
> >>org.springframework.transaction.interceptor.TransactionInterce
> >>ptor.invoke(Transa
> >>ctionInterceptor.java:107)
> >> at
> >>org.springframework.aop.framework.ReflectiveMethodInvocation.p
> >>roceed(ReflectiveM
> >>ethodInvocation.java:161)
> >> at
> >>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> >>kDynamicAopProxy.j
> >>ava:203)
> >> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> >> at
> >>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> >>yTest.java:119)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> >>orImpl.java:39)
> >> at
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> >>odAccessorImpl.jav
> >>a:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at junit.framework.TestCase.runTest(TestCase.java:168)
> >> at junit.framework.TestCase.runBare(TestCase.java:134)
> >> at
> >>org.springframework.test.ConditionalTestCase.runBare(Condition
> >>alTestCase.java:69
> >>)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ac
> >>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests$1.
> >>run(AbstractAnnotationAwareTransactionalTests.java:115)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ru
> >>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ru
> >>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> >> at
> >>org.springframework.test.annotation.AbstractAnnotationAwareTra
> >>nsactionalTests.ru
> >>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> >> at
> >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> >>JpaTests.java:159)
> >> at
> >>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> >>JpaTests.java:239)
> >> at junit.framework.TestResult$1.protect(TestResult.java:110)
> >> at junit.framework.TestResult.runProtected(TestResult.java:128)
> >> at junit.framework.TestResult.run(TestResult.java:113)
> >> at junit.framework.TestCase.run(TestCase.java:124)
> >> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> >> at junit.framework.TestSuite.run(TestSuite.java:227)
> >> at
> >>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> >>Runner.java:35)
> >> at
> >>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> >>.java:29)
> >> at
> >>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> >>stClassRunner.java
> >>:42)
> >> at
> >>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> >>eforeAndAfterRunne
> >>r.java:34)
> >> at
> >>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> >>.java:52)
> >> at
> >>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> >>(JUnit4TestReferen
> >>ce.java:38)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> >>ecution.java:38)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> >>s(RemoteTestRunner
> >>.java:460)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> >>s(RemoteTestRunner
> >>.java:673)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> >>oteTestRunner.java
> >>:386)
> >> at
> >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> >>moteTestRunner.jav
> >>a:196)
> >>Caused by: java.lang.NullPointerException
> >> at java.util.Locale.toLowerCase(Locale.java:1060)
> >> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> >> at java.util.Locale.<init>(Locale.java:272)
> >> at java.util.Locale.<init>(Locale.java:302)
> >> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> >> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> >> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> >> at
> >>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry
> .java:117)
> >> at
> >>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> >>agerImpl.java:247)
> >> at
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> >>e(JDBCStoreManager
> >>.java:327)
> >> at
> >>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> >>CStoreManager.java
> >>:252)
> >> at
> >>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> >>legatingStoreManag
> >>er.java:108)
> >> at
> >>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> >>anager.java:54)
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> >> at
> >>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> >> ... 64 more
> >>
> >>-----Original Message-----
> >>From: Patrick Linskey [mailto:plinskey@bea.com]
> >>Sent: April 26, 2007 5:40 PM
> >>To: open-jpa-dev@incubator.apache.org
> >>Subject: RE: How to debug object retrieveal in JPA?
> >>
> >>
> >>>Can you post what you get if you do '((Exception)
> >>>results.get(0)).printStackTrace()'?
> >>
> >>... so results.get(0) is returning a List? That's very odd.
> >>What if you
> >>do:
> >>
> >>System.out.println(results.get(0))?
> >>
> >>If it is a List of Exceptions, what if you print out the
> stacks of the
> >>exceptions in the list?
> >>
> >>-Patrick
> >>
> >>--
> >>Patrick Linskey
> >>BEA Systems, Inc.
> >>______________________________________________________________
> >>_________
> >>Notice: This email message, together with any attachments, may
> >>contain information of BEA Systems, Inc., its subsidiaries and
> >>affiliated entities, that may be confidential, proprietary,
> >>copyrighted and/or legally privileged, and is intended
> solely for the
> >>use of the individual or entity named in this message. If
> you are not
> >>the intended recipient, and have received this message in error,
> >>please immediately return this by email and then delete it.
> >>
> >>
> >>>-----Original Message-----
> >>>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>>Sent: Thursday, April 26, 2007 2:36 PM
> >>>To: open-jpa-dev@incubator.apache.org
> >>>Subject: RE: How to debug object retrieveal in JPA?
> >>>
> >>>Can't cast List to Exception
> >>>
> >>>-----Original Message-----
> >>>From: Patrick Linskey [mailto:plinskey@bea.com]
> >>>Sent: April 26, 2007 5:00 PM
> >>>To: open-jpa-dev@incubator.apache.org
> >>>Subject: RE: How to debug object retrieveal in JPA?
> >>>
> >>>So you're saying that the ResultList contains an Exception?
> >>>Can you post what you get if you do '((Exception)
> >>>results.get(0)).printStackTrace()'?
> >>>
> >>>-Patrick
> >>>
> >>>--
> >>>Patrick Linskey
> >>>BEA Systems, Inc.
> >>>______________________________________________________________
> >>>_________
> >>>Notice: This email message, together with any attachments, may
> >>>contain information of BEA Systems, Inc., its
> subsidiaries and
> >>>affiliated entities, that may be confidential, proprietary,
> >>>copyrighted and/or legally privileged, and is intended
> >>
> >>solely for the
> >>
> >>>use of the individual or entity named in this message. If
> >>
> >>you are not
> >>
> >>>the intended recipient, and have received this message in error,
> >>>please immediately return this by email and then delete it.
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>>>Sent: Thursday, April 26, 2007 1:44 PM
> >>>>To: open-jpa-dev@incubator.apache.org
> >>>>Subject: RE: How to debug object retrieveal in JPA?
> >>>>
> >>>>Some more information on this exception
> >>>>
> >>>>Right after the execution the exception held inside the result is
> >>>>"com.sun.jdi.InvocationException occurred invoking
> >>
> >>method..." Can't
> >>
> >>>>seem to get more data out of it
> >>>>
> >>>>Once the system.out is executed the exception changes to
> >>>
> >>>"The result
> >>>
> >>>>list has been closed"
> >>>>
> >>>>-----Original Message-----
> >>>>From: Phill Moran [mailto:pjmoran@rogers.com]
> >>>>Sent: April 26, 2007 4:18 PM
> >>>>To: open-jpa-dev@incubator.apache.org
> >>>>Subject: RE: How to debug object retrieveal in JPA?
> >>>>
> >>>>I did not mean it threw an NPE but I was left with a null
> >>>
> >>>result list.
> >>>
> >>>>I have setup trace already and I actually get nothing back.
> >>>>Here is the trace across the execution point
> >>>>
> >>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
> >>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> >>>>Ignoring.
> >>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
> >>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> >>>
> >>>t0.created,
> >>>
> >>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> >>
> >>t0.locale,
> >>
> >>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> >>
> >>t2.description,
> >>
> >>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> >>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
> >>
> >>t4.value, t1.id,
> >>
> >>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
> >>>
> >>>t1.name,
> >>>
> >>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> >>
> >>t5.value,
> >>
> >>>>t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> >>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> >>>
> >>>t0.roleFK =
> >>>
> >>>>t2.id LEFT OUTER JOIN category
> >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> >>>
> >>>ON t1.typeFK
> >>>
> >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> >>>
> >>>t2.categoryTypeFK = t3.id
> >>>
> >>>>WHERE
> >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> >>>
> >>>t0.lastName
> >>>
> >>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
> >>>>(String) PMORAN]
> >>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> [15 ms] spent
> >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> >>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> >>>
> >>>t1.id LEFT
> >>>
> >>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> >>
> >>JOIN category
> >>
> >>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> >>>
> >>>ON t1.typeFK
> >>>
> >>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
> >>>
> >>>t2.categoryTypeFK = t3.id
> >>>
> >>>>WHERE
> >>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> >>>>[params=(String) BIDSPEC,
> >>>>(String) PMORAN]
> >>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> >>>>9575056> [0 ms] spent
> >>>>1
> >>>>[2007-04-26 16:07:36,125] INFO
> >>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> >>>
> >>>transaction after
> >>>
> >>>>test execution
> >>>>
> >>>>What is interesting is the line with a "1" (from
> >>>>System.out.println(results.size())). What this represents is the
> >>>>message that the "result list is closed" nothing else in
> >>
> >>the trace.
> >>
> >>>>So what causes the result list to be closed?
> >>>>
> >>>>Phill
> >>>>
> >>>>-----Original Message-----
> >>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> >>>
> >>>On Behalf
> >>>
> >>>>Of Marc Prud'hommeaux
> >>>>Sent: April 26, 2007 3:54 PM
> >>>>To: open-jpa-dev@incubator.apache.org
> >>>>Subject: Re: How to debug object retrieveal in JPA?
> >>>>
> >>>>Phill-
> >>>>
> >>>>The maximum verbosity of logging is obtained by specifying the
> >>>>"openjpa.Log"
> >>>>property to "DefaultLevel=TRACE".
> >>>>
> >>>>What is the full exception stack trace? We might be able to help
> >>>>identify the problem. In any case OpenJPA should never be
> >>>
> >>>throwing an
> >>>
> >>>>NPE, so we should at least probably fix the error message.
> >>>>
> >>>>
> >>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> >>>>
> >>>>
> >>>>>Community,
> >>>>>
> >>>>>How does one go about debugging object retrieval/creation.
> >>>>
> >>>>I continue
> >>>>
> >>>>>to have exceptions and little to go on as far as the cause.
> >>>>>The named JPQL is good since I know it generates a good sql
> >>>>
> >>>>(can trace
> >>>>
> >>>>>code and see it) . I know the sql is good as I can
> >>>>
> >>>>copy/paste it into
> >>>>
> >>>>>mysql query browser, execute and get the correct data back. The
> >>>>>problem is that these lines result in an NPE.
> >>>>>
> >>>>> Query q =
> >>>>>
> >>
> >>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> >>
> >>>>> q.setParameter("storeName",
> >>
> >>storeName.toUpperCase());
> >>
> >>>>> q.setParameter("loginName",
> >>
> >>loginName.toUpperCase());
> >>
> >>>>> List<Person> results = null;
> >>>>> try {
> >>>>> results = (List<Person>) q.getResultList();
> >>>>> System.out.println(results.size());
> >>>>> }
> >>>>> catch(Exception e) {
> >>>>> e.printStackTrace();
> >>>>> }
> >>>>> if (results.isEmpty()) { <- NPE thrown here
> >>>>> throw new UserNotFoundException("No
> >>>>
> >>>>user found");
> >>>>
> >>>>> }
> >>>>>Also the "mappingTool validate" seems to work fine. Of
> >>
> >>course how
> >>
> >>>>>would I know since I can find no description of what a good
> >>>>
> >>>>one looks
> >>>>
> >>>>>like but reading it (no
> >>>>>exceptions) seem to make sense.
> >>>>>
> >>>>>Any help would be much appreciated.
> >>>>>
> >>>>>Phill
> >>>>>
> >>>>
> >>>>
> >>>Notice: This email message, together with any attachments, may
> >>>contain information of BEA Systems, Inc., its
> subsidiaries and
> >>>affiliated entities, that may be confidential, proprietary,
> >>>copyrighted and/or legally privileged, and is intended
> >>
> >>solely for the
> >>
> >>>use of the individual or entity named in this message. If
> >>
> >>you are not
> >>
> >>>the intended recipient, and have received this message in error,
> >>>please immediately return this by email and then delete it.
> >>>
> >>>
> >>
> >>Notice: This email message, together with any attachments, may
> >>contain information of BEA Systems, Inc., its subsidiaries and
> >>affiliated entities, that may be confidential, proprietary,
> >>copyrighted and/or legally privileged, and is intended
> solely for the
> >>use of the individual or entity named in this message. If
> you are not
> >>the intended recipient, and have received this message in error,
> >>please immediately return this by email and then delete it.
> >>
> >>
> >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please
> immediately return this by email and then delete it.
> >
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
Anyone have any more suggestions on how to debug this?
-----Original Message-----
From: Phill Moran [mailto:pjmoran@rogers.com]
Sent: April 26, 2007 11:20 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
I don't close it in anyway directly
-----Original Message-----
From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
Sent: April 26, 2007 11:16 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: How to debug object retrieveal in JPA?
Can it be that there is a glue code that closes EM in between? Just a thought...
-marina
Phill Moran wrote:
> I had suspected the Locale so I made a set/getLocale that communicate
> in
String.
> I figured that openJPA does not actually care how I implement.
>
> But for this run I removed it completely and did a clean rebuild. Good
> news and bad the exception changed:
>
>
> java.util.NoSuchElementException: The result list has been closed.
> at
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> tList.java
> :91)
> at
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> tNonSequen
> tialResultList.java:68)
> at
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> t.java:241
> )
> at
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> onFactoryI
> mpl.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> n(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> npoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> oke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> AopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> n(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> npoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> oke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> AopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactoryTest.java:119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> se.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
>
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
>
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159)
> at
>
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
> at
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> unner.java
> :42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> AfterRunne
> r.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> estReferen
> ce.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> TestRunner
> .java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> TestRunner
> .java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> unner.java
> :386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> Runner.jav
> a:196)
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 9:59 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
>
>>Caused by: java.lang.NullPointerException
>> at java.util.Locale.toLowerCase(Locale.java:1060)
>> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
>> at java.util.Locale.<init>(Locale.java:272)
>> at java.util.Locale.<init>(Locale.java:302)
>> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
>> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>> at
>>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
>
>
> Now we're getting somewhere.... what happens if you remove the Locale
> field from the Person class?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________________
> _
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please
immediately return this by email and then delete it.
>
>
>>-----Original Message-----
>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>Sent: Thursday, April 26, 2007 6:32 PM
>>To: open-jpa-dev@incubator.apache.org
>>Subject: RE: How to debug object retrieveal in JPA?
>>
>>Run that config gives us this lovely message:
>>
>><0|false|0.9.6-incubating>
>>org.apache.openjpa.persistence.PersistenceException:
>>null
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
>>Manager.java:773)
>> at
>>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
>>.java:254)
>> at
>>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
>>tImpl.java:2115)
>> at
>>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
>>.java:248)
>> at
>>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
>>tResultObject(Inst
>>anceResultObjectProvider.java:56)
>> at
>>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
>>ResultList.java:12
>>8)
>> at
>>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
>>(AbstractNonSequen
>>tialResultList.java:69)
>> at
>>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
>>esultList.java:241
>>)
>> at
>>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
>>ect(PersonFactoryI
>>mpl.java:99)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
>>eflection(AopUtils
>>.java:304)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.i
>>nvokeJoinpoint(Ref
>>lectiveMethodInvocation.java:172)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:139)
>> at
>>org.springframework.transaction.interceptor.TransactionInterce
>>ptor.invoke(Transa
>>ctionInterceptor.java:107)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:161)
>> at
>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
>>kDynamicAopProxy.j
>>ava:203)
>> at $Proxy34.getLoginPersonValueObject(Unknown Source)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
>>eflection(AopUtils
>>.java:304)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.i
>>nvokeJoinpoint(Ref
>>lectiveMethodInvocation.java:172)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:139)
>> at
>>org.springframework.transaction.interceptor.TransactionInterce
>>ptor.invoke(Transa
>>ctionInterceptor.java:107)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:161)
>> at
>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
>>kDynamicAopProxy.j
>>ava:203)
>> at $Proxy34.getLoginPersonValueObject(Unknown Source)
>> at
>>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
>>yTest.java:119)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at junit.framework.TestCase.runTest(TestCase.java:168)
>> at junit.framework.TestCase.runBare(TestCase.java:134)
>> at
>>org.springframework.test.ConditionalTestCase.runBare(Condition
>>alTestCase.java:69
>>)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ac
>>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests$1.
>>run(AbstractAnnotationAwareTransactionalTests.java:115)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
>> at
>>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
>>JpaTests.java:159)
>> at
>>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
>>JpaTests.java:239)
>> at junit.framework.TestResult$1.protect(TestResult.java:110)
>> at junit.framework.TestResult.runProtected(TestResult.java:128)
>> at junit.framework.TestResult.run(TestResult.java:113)
>> at junit.framework.TestCase.run(TestCase.java:124)
>> at junit.framework.TestSuite.runTest(TestSuite.java:232)
>> at junit.framework.TestSuite.run(TestSuite.java:227)
>> at
>>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
>>Runner.java:35)
>> at
>>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
>>.java:29)
>> at
>>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
>>stClassRunner.java
>>:42)
>> at
>>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
>>eforeAndAfterRunne
>>r.java:34)
>> at
>>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
>>.java:52)
>> at
>>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
>>(JUnit4TestReferen
>>ce.java:38)
>> at
>>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
>>ecution.java:38)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
>>s(RemoteTestRunner
>>.java:460)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
>>s(RemoteTestRunner
>>.java:673)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
>>oteTestRunner.java
>>:386)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
>>moteTestRunner.jav
>>a:196)
>>Caused by: java.lang.NullPointerException
>> at java.util.Locale.toLowerCase(Locale.java:1060)
>> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
>> at java.util.Locale.<init>(Locale.java:272)
>> at java.util.Locale.<init>(Locale.java:302)
>> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
>> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>> at
>>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
>> at
>>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
>>agerImpl.java:247)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
>>e(JDBCStoreManager
>>.java:327)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
>>CStoreManager.java
>>:252)
>> at
>>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
>>legatingStoreManag
>>er.java:108)
>> at
>>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
>>anager.java:54)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
>> ... 64 more
>>
>>-----Original Message-----
>>From: Patrick Linskey [mailto:plinskey@bea.com]
>>Sent: April 26, 2007 5:40 PM
>>To: open-jpa-dev@incubator.apache.org
>>Subject: RE: How to debug object retrieveal in JPA?
>>
>>
>>>Can you post what you get if you do '((Exception)
>>>results.get(0)).printStackTrace()'?
>>
>>... so results.get(0) is returning a List? That's very odd.
>>What if you
>>do:
>>
>>System.out.println(results.get(0))?
>>
>>If it is a List of Exceptions, what if you print out the stacks of the
>>exceptions in the list?
>>
>>-Patrick
>>
>>--
>>Patrick Linskey
>>BEA Systems, Inc.
>>______________________________________________________________
>>_________
>>Notice: This email message, together with any attachments, may
>>contain information of BEA Systems, Inc., its subsidiaries and
>>affiliated entities, that may be confidential, proprietary,
>>copyrighted and/or legally privileged, and is intended solely for the
>>use of the individual or entity named in this message. If you are not
>>the intended recipient, and have received this message in error,
>>please immediately return this by email and then delete it.
>>
>>
>>>-----Original Message-----
>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>Sent: Thursday, April 26, 2007 2:36 PM
>>>To: open-jpa-dev@incubator.apache.org
>>>Subject: RE: How to debug object retrieveal in JPA?
>>>
>>>Can't cast List to Exception
>>>
>>>-----Original Message-----
>>>From: Patrick Linskey [mailto:plinskey@bea.com]
>>>Sent: April 26, 2007 5:00 PM
>>>To: open-jpa-dev@incubator.apache.org
>>>Subject: RE: How to debug object retrieveal in JPA?
>>>
>>>So you're saying that the ResultList contains an Exception?
>>>Can you post what you get if you do '((Exception)
>>>results.get(0)).printStackTrace()'?
>>>
>>>-Patrick
>>>
>>>--
>>>Patrick Linskey
>>>BEA Systems, Inc.
>>>______________________________________________________________
>>>_________
>>>Notice: This email message, together with any attachments, may
>>>contain information of BEA Systems, Inc., its subsidiaries and
>>>affiliated entities, that may be confidential, proprietary,
>>>copyrighted and/or legally privileged, and is intended
>>
>>solely for the
>>
>>>use of the individual or entity named in this message. If
>>
>>you are not
>>
>>>the intended recipient, and have received this message in error,
>>>please immediately return this by email and then delete it.
>>>
>>>
>>>>-----Original Message-----
>>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>>Sent: Thursday, April 26, 2007 1:44 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: RE: How to debug object retrieveal in JPA?
>>>>
>>>>Some more information on this exception
>>>>
>>>>Right after the execution the exception held inside the result is
>>>>"com.sun.jdi.InvocationException occurred invoking
>>
>>method..." Can't
>>
>>>>seem to get more data out of it
>>>>
>>>>Once the system.out is executed the exception changes to
>>>
>>>"The result
>>>
>>>>list has been closed"
>>>>
>>>>-----Original Message-----
>>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>>Sent: April 26, 2007 4:18 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: RE: How to debug object retrieveal in JPA?
>>>>
>>>>I did not mean it threw an NPE but I was left with a null
>>>
>>>result list.
>>>
>>>>I have setup trace already and I actually get nothing back.
>>>>Here is the trace across the execution point
>>>>
>>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
>>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
>>>>Ignoring.
>>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
>>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
>>>
>>>t0.created,
>>>
>>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
>>
>>t0.locale,
>>
>>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
>>
>>t2.description,
>>
>>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
>>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
>>
>>t4.value, t1.id,
>>
>>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
>>>
>>>t1.name,
>>>
>>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
>>
>>t5.value,
>>
>>>>t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
>>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
>>>
>>>t0.roleFK =
>>>
>>>>t2.id LEFT OUTER JOIN category
>>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
>>>
>>>ON t1.typeFK
>>>
>>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
>>>
>>>t2.categoryTypeFK = t3.id
>>>
>>>>WHERE
>>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
>>>
>>>t0.lastName
>>>
>>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
>>>>(String) PMORAN]
>>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> [15 ms] spent
>>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
>>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
>>>
>>>t1.id LEFT
>>>
>>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
>>
>>JOIN category
>>
>>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
>>>
>>>ON t1.typeFK
>>>
>>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
>>>
>>>t2.categoryTypeFK = t3.id
>>>
>>>>WHERE
>>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
>>>>[params=(String) BIDSPEC,
>>>>(String) PMORAN]
>>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> [0 ms] spent
>>>>1
>>>>[2007-04-26 16:07:36,125] INFO
>>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
>>>
>>>transaction after
>>>
>>>>test execution
>>>>
>>>>What is interesting is the line with a "1" (from
>>>>System.out.println(results.size())). What this represents is the
>>>>message that the "result list is closed" nothing else in
>>
>>the trace.
>>
>>>>So what causes the result list to be closed?
>>>>
>>>>Phill
>>>>
>>>>-----Original Message-----
>>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
>>>
>>>On Behalf
>>>
>>>>Of Marc Prud'hommeaux
>>>>Sent: April 26, 2007 3:54 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: Re: How to debug object retrieveal in JPA?
>>>>
>>>>Phill-
>>>>
>>>>The maximum verbosity of logging is obtained by specifying the
>>>>"openjpa.Log"
>>>>property to "DefaultLevel=TRACE".
>>>>
>>>>What is the full exception stack trace? We might be able to help
>>>>identify the problem. In any case OpenJPA should never be
>>>
>>>throwing an
>>>
>>>>NPE, so we should at least probably fix the error message.
>>>>
>>>>
>>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>>>>
>>>>
>>>>>Community,
>>>>>
>>>>>How does one go about debugging object retrieval/creation.
>>>>
>>>>I continue
>>>>
>>>>>to have exceptions and little to go on as far as the cause.
>>>>>The named JPQL is good since I know it generates a good sql
>>>>
>>>>(can trace
>>>>
>>>>>code and see it) . I know the sql is good as I can
>>>>
>>>>copy/paste it into
>>>>
>>>>>mysql query browser, execute and get the correct data back. The
>>>>>problem is that these lines result in an NPE.
>>>>>
>>>>> Query q =
>>>>>
>>
>>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
>>
>>>>> q.setParameter("storeName",
>>
>>storeName.toUpperCase());
>>
>>>>> q.setParameter("loginName",
>>
>>loginName.toUpperCase());
>>
>>>>> List<Person> results = null;
>>>>> try {
>>>>> results = (List<Person>) q.getResultList();
>>>>> System.out.println(results.size());
>>>>> }
>>>>> catch(Exception e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>> if (results.isEmpty()) { <- NPE thrown here
>>>>> throw new UserNotFoundException("No
>>>>
>>>>user found");
>>>>
>>>>> }
>>>>>Also the "mappingTool validate" seems to work fine. Of
>>
>>course how
>>
>>>>>would I know since I can find no description of what a good
>>>>
>>>>one looks
>>>>
>>>>>like but reading it (no
>>>>>exceptions) seem to make sense.
>>>>>
>>>>>Any help would be much appreciated.
>>>>>
>>>>>Phill
>>>>>
>>>>
>>>>
>>>Notice: This email message, together with any attachments, may
>>>contain information of BEA Systems, Inc., its subsidiaries and
>>>affiliated entities, that may be confidential, proprietary,
>>>copyrighted and/or legally privileged, and is intended
>>
>>solely for the
>>
>>>use of the individual or entity named in this message. If
>>
>>you are not
>>
>>>the intended recipient, and have received this message in error,
>>>please immediately return this by email and then delete it.
>>>
>>>
>>
>>Notice: This email message, together with any attachments, may
>>contain information of BEA Systems, Inc., its subsidiaries and
>>affiliated entities, that may be confidential, proprietary,
>>copyrighted and/or legally privileged, and is intended solely for the
>>use of the individual or entity named in this message. If you are not
>>the intended recipient, and have received this message in error,
>>please immediately return this by email and then delete it.
>>
>>
>
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please
immediately return this by email and then delete it.
>
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
I don't close it in anyway directly
-----Original Message-----
From: Marina.Vatkina@Sun.COM [mailto:Marina.Vatkina@Sun.COM]
Sent: April 26, 2007 11:16 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: How to debug object retrieveal in JPA?
Can it be that there is a glue code that closes EM in between? Just a thought...
-marina
Phill Moran wrote:
> I had suspected the Locale so I made a set/getLocale that communicate in
String.
> I figured that openJPA does not actually care how I implement.
>
> But for this run I removed it completely and did a clean rebuild. Good
> news and bad the exception changed:
>
>
> java.util.NoSuchElementException: The result list has been closed.
> at
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResul
> tList.java
> :91)
> at
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(Abstrac
> tNonSequen
> tialResultList.java:68)
> at
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultLis
> t.java:241
> )
> at
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(Pers
> onFactoryI
> mpl.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> n(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> npoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> oke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> AopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio
> n(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi
> npoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.inv
> oke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R
> eflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic
> AopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactoryTest.java:119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCa
> se.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
>
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
>
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159)
> at
>
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
> at
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassR
> unner.java
> :42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAnd
> AfterRunne
> r.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T
> estReferen
> ce.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> TestRunner
> .java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
> TestRunner
> .java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
> unner.java
> :386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
> Runner.jav
> a:196)
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 9:59 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
>
>>Caused by: java.lang.NullPointerException
>> at java.util.Locale.toLowerCase(Locale.java:1060)
>> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
>> at java.util.Locale.<init>(Locale.java:272)
>> at java.util.Locale.<init>(Locale.java:302)
>> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
>> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>> at
>>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
>
>
> Now we're getting somewhere.... what happens if you remove the Locale
> field from the Person class?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________________
> _
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error, please
immediately return this by email and then delete it.
>
>
>>-----Original Message-----
>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>Sent: Thursday, April 26, 2007 6:32 PM
>>To: open-jpa-dev@incubator.apache.org
>>Subject: RE: How to debug object retrieveal in JPA?
>>
>>Run that config gives us this lovely message:
>>
>><0|false|0.9.6-incubating>
>>org.apache.openjpa.persistence.PersistenceException:
>>null
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
>>Manager.java:773)
>> at
>>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
>>.java:254)
>> at
>>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
>>tImpl.java:2115)
>> at
>>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
>>.java:248)
>> at
>>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
>>tResultObject(Inst
>>anceResultObjectProvider.java:56)
>> at
>>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
>>ResultList.java:12
>>8)
>> at
>>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
>>(AbstractNonSequen
>>tialResultList.java:69)
>> at
>>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
>>esultList.java:241
>>)
>> at
>>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
>>ect(PersonFactoryI
>>mpl.java:99)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
>>eflection(AopUtils
>>.java:304)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.i
>>nvokeJoinpoint(Ref
>>lectiveMethodInvocation.java:172)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:139)
>> at
>>org.springframework.transaction.interceptor.TransactionInterce
>>ptor.invoke(Transa
>>ctionInterceptor.java:107)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:161)
>> at
>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
>>kDynamicAopProxy.j
>>ava:203)
>> at $Proxy34.getLoginPersonValueObject(Unknown Source)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
>>eflection(AopUtils
>>.java:304)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.i
>>nvokeJoinpoint(Ref
>>lectiveMethodInvocation.java:172)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:139)
>> at
>>org.springframework.transaction.interceptor.TransactionInterce
>>ptor.invoke(Transa
>>ctionInterceptor.java:107)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:161)
>> at
>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
>>kDynamicAopProxy.j
>>ava:203)
>> at $Proxy34.getLoginPersonValueObject(Unknown Source)
>> at
>>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
>>yTest.java:119)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at junit.framework.TestCase.runTest(TestCase.java:168)
>> at junit.framework.TestCase.runBare(TestCase.java:134)
>> at
>>org.springframework.test.ConditionalTestCase.runBare(Condition
>>alTestCase.java:69
>>)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ac
>>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests$1.
>>run(AbstractAnnotationAwareTransactionalTests.java:115)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
>> at
>>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
>>JpaTests.java:159)
>> at
>>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
>>JpaTests.java:239)
>> at junit.framework.TestResult$1.protect(TestResult.java:110)
>> at junit.framework.TestResult.runProtected(TestResult.java:128)
>> at junit.framework.TestResult.run(TestResult.java:113)
>> at junit.framework.TestCase.run(TestCase.java:124)
>> at junit.framework.TestSuite.runTest(TestSuite.java:232)
>> at junit.framework.TestSuite.run(TestSuite.java:227)
>> at
>>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
>>Runner.java:35)
>> at
>>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
>>.java:29)
>> at
>>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
>>stClassRunner.java
>>:42)
>> at
>>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
>>eforeAndAfterRunne
>>r.java:34)
>> at
>>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
>>.java:52)
>> at
>>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
>>(JUnit4TestReferen
>>ce.java:38)
>> at
>>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
>>ecution.java:38)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
>>s(RemoteTestRunner
>>.java:460)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
>>s(RemoteTestRunner
>>.java:673)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
>>oteTestRunner.java
>>:386)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
>>moteTestRunner.jav
>>a:196)
>>Caused by: java.lang.NullPointerException
>> at java.util.Locale.toLowerCase(Locale.java:1060)
>> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
>> at java.util.Locale.<init>(Locale.java:272)
>> at java.util.Locale.<init>(Locale.java:302)
>> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
>> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>> at
>>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
>> at
>>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
>>agerImpl.java:247)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
>>e(JDBCStoreManager
>>.java:327)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
>>CStoreManager.java
>>:252)
>> at
>>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
>>legatingStoreManag
>>er.java:108)
>> at
>>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
>>anager.java:54)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
>> ... 64 more
>>
>>-----Original Message-----
>>From: Patrick Linskey [mailto:plinskey@bea.com]
>>Sent: April 26, 2007 5:40 PM
>>To: open-jpa-dev@incubator.apache.org
>>Subject: RE: How to debug object retrieveal in JPA?
>>
>>
>>>Can you post what you get if you do '((Exception)
>>>results.get(0)).printStackTrace()'?
>>
>>... so results.get(0) is returning a List? That's very odd.
>>What if you
>>do:
>>
>>System.out.println(results.get(0))?
>>
>>If it is a List of Exceptions, what if you print out the stacks of the
>>exceptions in the list?
>>
>>-Patrick
>>
>>--
>>Patrick Linskey
>>BEA Systems, Inc.
>>______________________________________________________________
>>_________
>>Notice: This email message, together with any attachments, may
>>contain information of BEA Systems, Inc., its subsidiaries and
>>affiliated entities, that may be confidential, proprietary,
>>copyrighted and/or legally privileged, and is intended solely for the
>>use of the individual or entity named in this message. If you are not
>>the intended recipient, and have received this message in error,
>>please immediately return this by email and then delete it.
>>
>>
>>>-----Original Message-----
>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>Sent: Thursday, April 26, 2007 2:36 PM
>>>To: open-jpa-dev@incubator.apache.org
>>>Subject: RE: How to debug object retrieveal in JPA?
>>>
>>>Can't cast List to Exception
>>>
>>>-----Original Message-----
>>>From: Patrick Linskey [mailto:plinskey@bea.com]
>>>Sent: April 26, 2007 5:00 PM
>>>To: open-jpa-dev@incubator.apache.org
>>>Subject: RE: How to debug object retrieveal in JPA?
>>>
>>>So you're saying that the ResultList contains an Exception?
>>>Can you post what you get if you do '((Exception)
>>>results.get(0)).printStackTrace()'?
>>>
>>>-Patrick
>>>
>>>--
>>>Patrick Linskey
>>>BEA Systems, Inc.
>>>______________________________________________________________
>>>_________
>>>Notice: This email message, together with any attachments, may
>>>contain information of BEA Systems, Inc., its subsidiaries and
>>>affiliated entities, that may be confidential, proprietary,
>>>copyrighted and/or legally privileged, and is intended
>>
>>solely for the
>>
>>>use of the individual or entity named in this message. If
>>
>>you are not
>>
>>>the intended recipient, and have received this message in error,
>>>please immediately return this by email and then delete it.
>>>
>>>
>>>>-----Original Message-----
>>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>>Sent: Thursday, April 26, 2007 1:44 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: RE: How to debug object retrieveal in JPA?
>>>>
>>>>Some more information on this exception
>>>>
>>>>Right after the execution the exception held inside the result is
>>>>"com.sun.jdi.InvocationException occurred invoking
>>
>>method..." Can't
>>
>>>>seem to get more data out of it
>>>>
>>>>Once the system.out is executed the exception changes to
>>>
>>>"The result
>>>
>>>>list has been closed"
>>>>
>>>>-----Original Message-----
>>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>>Sent: April 26, 2007 4:18 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: RE: How to debug object retrieveal in JPA?
>>>>
>>>>I did not mean it threw an NPE but I was left with a null
>>>
>>>result list.
>>>
>>>>I have setup trace already and I actually get nothing back.
>>>>Here is the trace across the execution point
>>>>
>>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
>>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
>>>>Ignoring.
>>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
>>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
>>>
>>>t0.created,
>>>
>>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
>>
>>t0.locale,
>>
>>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
>>
>>t2.description,
>>
>>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
>>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
>>
>>t4.value, t1.id,
>>
>>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
>>>
>>>t1.name,
>>>
>>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
>>
>>t5.value,
>>
>>>>t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
>>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
>>>
>>>t0.roleFK =
>>>
>>>>t2.id LEFT OUTER JOIN category
>>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
>>>
>>>ON t1.typeFK
>>>
>>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
>>>
>>>t2.categoryTypeFK = t3.id
>>>
>>>>WHERE
>>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
>>>
>>>t0.lastName
>>>
>>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
>>>>(String) PMORAN]
>>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> [15 ms] spent
>>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
>>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
>>>
>>>t1.id LEFT
>>>
>>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
>>
>>JOIN category
>>
>>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
>>>
>>>ON t1.typeFK
>>>
>>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
>>>
>>>t2.categoryTypeFK = t3.id
>>>
>>>>WHERE
>>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
>>>>[params=(String) BIDSPEC,
>>>>(String) PMORAN]
>>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> [0 ms] spent
>>>>1
>>>>[2007-04-26 16:07:36,125] INFO
>>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
>>>
>>>transaction after
>>>
>>>>test execution
>>>>
>>>>What is interesting is the line with a "1" (from
>>>>System.out.println(results.size())). What this represents is the
>>>>message that the "result list is closed" nothing else in
>>
>>the trace.
>>
>>>>So what causes the result list to be closed?
>>>>
>>>>Phill
>>>>
>>>>-----Original Message-----
>>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
>>>
>>>On Behalf
>>>
>>>>Of Marc Prud'hommeaux
>>>>Sent: April 26, 2007 3:54 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: Re: How to debug object retrieveal in JPA?
>>>>
>>>>Phill-
>>>>
>>>>The maximum verbosity of logging is obtained by specifying the
>>>>"openjpa.Log"
>>>>property to "DefaultLevel=TRACE".
>>>>
>>>>What is the full exception stack trace? We might be able to help
>>>>identify the problem. In any case OpenJPA should never be
>>>
>>>throwing an
>>>
>>>>NPE, so we should at least probably fix the error message.
>>>>
>>>>
>>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>>>>
>>>>
>>>>>Community,
>>>>>
>>>>>How does one go about debugging object retrieval/creation.
>>>>
>>>>I continue
>>>>
>>>>>to have exceptions and little to go on as far as the cause.
>>>>>The named JPQL is good since I know it generates a good sql
>>>>
>>>>(can trace
>>>>
>>>>>code and see it) . I know the sql is good as I can
>>>>
>>>>copy/paste it into
>>>>
>>>>>mysql query browser, execute and get the correct data back. The
>>>>>problem is that these lines result in an NPE.
>>>>>
>>>>> Query q =
>>>>>
>>
>>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
>>
>>>>> q.setParameter("storeName",
>>
>>storeName.toUpperCase());
>>
>>>>> q.setParameter("loginName",
>>
>>loginName.toUpperCase());
>>
>>>>> List<Person> results = null;
>>>>> try {
>>>>> results = (List<Person>) q.getResultList();
>>>>> System.out.println(results.size());
>>>>> }
>>>>> catch(Exception e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>> if (results.isEmpty()) { <- NPE thrown here
>>>>> throw new UserNotFoundException("No
>>>>
>>>>user found");
>>>>
>>>>> }
>>>>>Also the "mappingTool validate" seems to work fine. Of
>>
>>course how
>>
>>>>>would I know since I can find no description of what a good
>>>>
>>>>one looks
>>>>
>>>>>like but reading it (no
>>>>>exceptions) seem to make sense.
>>>>>
>>>>>Any help would be much appreciated.
>>>>>
>>>>>Phill
>>>>>
>>>>
>>>>
>>>Notice: This email message, together with any attachments, may
>>>contain information of BEA Systems, Inc., its subsidiaries and
>>>affiliated entities, that may be confidential, proprietary,
>>>copyrighted and/or legally privileged, and is intended
>>
>>solely for the
>>
>>>use of the individual or entity named in this message. If
>>
>>you are not
>>
>>>the intended recipient, and have received this message in error,
>>>please immediately return this by email and then delete it.
>>>
>>>
>>
>>Notice: This email message, together with any attachments, may
>>contain information of BEA Systems, Inc., its subsidiaries and
>>affiliated entities, that may be confidential, proprietary,
>>copyrighted and/or legally privileged, and is intended solely for the
>>use of the individual or entity named in this message. If you are not
>>the intended recipient, and have received this message in error,
>>please immediately return this by email and then delete it.
>>
>>
>
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error, please
immediately return this by email and then delete it.
>
Re: How to debug object retrieveal in JPA?
Posted by Marina Vatkina <Ma...@Sun.COM>.
Can it be that there is a glue code that closes EM in between? Just a thought...
-marina
Phill Moran wrote:
> I had suspected the Locale so I made a set/getLocale that communicate in String.
> I figured that openJPA does not actually care how I implement.
>
> But for this run I removed it completely and did a clean rebuild. Good news and
> bad the exception changed:
>
>
> java.util.NoSuchElementException: The result list has been closed.
> at
> org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResultList.java
> :91)
> at
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(AbstractNonSequen
> tialResultList.java:68)
> at
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultList.java:241
> )
> at
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(PersonFactoryI
> mpl.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactoryTest.java:119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
> at
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java
> :42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunne
> r.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
> ce.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
> .java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
> .java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
> :386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
> a:196)
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 9:59 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
>
>>Caused by: java.lang.NullPointerException
>> at java.util.Locale.toLowerCase(Locale.java:1060)
>> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
>> at java.util.Locale.<init>(Locale.java:272)
>> at java.util.Locale.<init>(Locale.java:302)
>> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
>> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>> at
>>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
>
>
> Now we're getting somewhere.... what happens if you remove the Locale field from
> the Person class?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> _______________________________________________________________________
> Notice: This email message, together with any attachments, may contain
> information of BEA Systems, Inc., its subsidiaries and affiliated
> entities, that may be confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the individual or entity named
> in this message. If you are not the intended recipient, and have received this
> message in error, please immediately return this by email and then delete it.
>
>
>>-----Original Message-----
>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>Sent: Thursday, April 26, 2007 6:32 PM
>>To: open-jpa-dev@incubator.apache.org
>>Subject: RE: How to debug object retrieveal in JPA?
>>
>>Run that config gives us this lovely message:
>>
>><0|false|0.9.6-incubating>
>>org.apache.openjpa.persistence.PersistenceException:
>>null
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
>>Manager.java:773)
>> at
>>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
>>.java:254)
>> at
>>org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
>>tImpl.java:2115)
>> at
>>org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
>>.java:248)
>> at
>>org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
>>tResultObject(Inst
>>anceResultObjectProvider.java:56)
>> at
>>org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
>>ResultList.java:12
>>8)
>> at
>>org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
>>(AbstractNonSequen
>>tialResultList.java:69)
>> at
>>org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
>>esultList.java:241
>>)
>> at
>>ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
>>ect(PersonFactoryI
>>mpl.java:99)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
>>eflection(AopUtils
>>.java:304)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.i
>>nvokeJoinpoint(Ref
>>lectiveMethodInvocation.java:172)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:139)
>> at
>>org.springframework.transaction.interceptor.TransactionInterce
>>ptor.invoke(Transa
>>ctionInterceptor.java:107)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:161)
>> at
>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
>>kDynamicAopProxy.j
>>ava:203)
>> at $Proxy34.getLoginPersonValueObject(Unknown Source)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>>org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
>>eflection(AopUtils
>>.java:304)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.i
>>nvokeJoinpoint(Ref
>>lectiveMethodInvocation.java:172)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:139)
>> at
>>org.springframework.transaction.interceptor.TransactionInterce
>>ptor.invoke(Transa
>>ctionInterceptor.java:107)
>> at
>>org.springframework.aop.framework.ReflectiveMethodInvocation.p
>>roceed(ReflectiveM
>>ethodInvocation.java:161)
>> at
>>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
>>kDynamicAopProxy.j
>>ava:203)
>> at $Proxy34.getLoginPersonValueObject(Unknown Source)
>> at
>>ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
>>yTest.java:119)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
>>orImpl.java:39)
>> at
>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
>>odAccessorImpl.jav
>>a:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at junit.framework.TestCase.runTest(TestCase.java:168)
>> at junit.framework.TestCase.runBare(TestCase.java:134)
>> at
>>org.springframework.test.ConditionalTestCase.runBare(Condition
>>alTestCase.java:69
>>)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ac
>>cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests$1.
>>run(AbstractAnnotationAwareTransactionalTests.java:115)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nTest(AbstractAnnotationAwareTransactionalTests.java:180)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
>> at
>>org.springframework.test.annotation.AbstractAnnotationAwareTra
>>nsactionalTests.ru
>>nBare(AbstractAnnotationAwareTransactionalTests.java:111)
>> at
>>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
>>JpaTests.java:159)
>> at
>>org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
>>JpaTests.java:239)
>> at junit.framework.TestResult$1.protect(TestResult.java:110)
>> at junit.framework.TestResult.runProtected(TestResult.java:128)
>> at junit.framework.TestResult.run(TestResult.java:113)
>> at junit.framework.TestCase.run(TestCase.java:124)
>> at junit.framework.TestSuite.runTest(TestSuite.java:232)
>> at junit.framework.TestSuite.run(TestSuite.java:227)
>> at
>>org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
>>Runner.java:35)
>> at
>>org.junit.internal.runners.CompositeRunner.run(CompositeRunner
>>.java:29)
>> at
>>org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
>>stClassRunner.java
>>:42)
>> at
>>org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
>>eforeAndAfterRunne
>>r.java:34)
>> at
>>org.junit.internal.runners.TestClassRunner.run(TestClassRunner
>>.java:52)
>> at
>>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
>>(JUnit4TestReferen
>>ce.java:38)
>> at
>>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
>>ecution.java:38)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
>>s(RemoteTestRunner
>>.java:460)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
>>s(RemoteTestRunner
>>.java:673)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
>>oteTestRunner.java
>>:386)
>> at
>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
>>moteTestRunner.jav
>>a:196)
>>Caused by: java.lang.NullPointerException
>> at java.util.Locale.toLowerCase(Locale.java:1060)
>> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
>> at java.util.Locale.<init>(Locale.java:272)
>> at java.util.Locale.<init>(Locale.java:302)
>> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
>> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>> at
>>org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
>> at
>>org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
>>agerImpl.java:247)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
>>e(JDBCStoreManager
>>.java:327)
>> at
>>org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
>>CStoreManager.java
>>:252)
>> at
>>org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
>>legatingStoreManag
>>er.java:108)
>> at
>>org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
>>anager.java:54)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
>> at
>>org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
>> ... 64 more
>>
>>-----Original Message-----
>>From: Patrick Linskey [mailto:plinskey@bea.com]
>>Sent: April 26, 2007 5:40 PM
>>To: open-jpa-dev@incubator.apache.org
>>Subject: RE: How to debug object retrieveal in JPA?
>>
>>
>>>Can you post what you get if you do '((Exception)
>>>results.get(0)).printStackTrace()'?
>>
>>... so results.get(0) is returning a List? That's very odd.
>>What if you
>>do:
>>
>>System.out.println(results.get(0))?
>>
>>If it is a List of Exceptions, what if you print out the stacks of the
>>exceptions in the list?
>>
>>-Patrick
>>
>>--
>>Patrick Linskey
>>BEA Systems, Inc.
>>______________________________________________________________
>>_________
>>Notice: This email message, together with any attachments, may
>>contain information of BEA Systems, Inc., its subsidiaries and
>>affiliated entities, that may be confidential, proprietary,
>>copyrighted and/or legally privileged, and is intended solely for the
>>use of the individual or entity named in this message. If you are not
>>the intended recipient, and have received this message in error,
>>please immediately return this by email and then delete it.
>>
>>
>>>-----Original Message-----
>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>Sent: Thursday, April 26, 2007 2:36 PM
>>>To: open-jpa-dev@incubator.apache.org
>>>Subject: RE: How to debug object retrieveal in JPA?
>>>
>>>Can't cast List to Exception
>>>
>>>-----Original Message-----
>>>From: Patrick Linskey [mailto:plinskey@bea.com]
>>>Sent: April 26, 2007 5:00 PM
>>>To: open-jpa-dev@incubator.apache.org
>>>Subject: RE: How to debug object retrieveal in JPA?
>>>
>>>So you're saying that the ResultList contains an Exception?
>>>Can you post what you get if you do '((Exception)
>>>results.get(0)).printStackTrace()'?
>>>
>>>-Patrick
>>>
>>>--
>>>Patrick Linskey
>>>BEA Systems, Inc.
>>>______________________________________________________________
>>>_________
>>>Notice: This email message, together with any attachments, may
>>>contain information of BEA Systems, Inc., its subsidiaries and
>>>affiliated entities, that may be confidential, proprietary,
>>>copyrighted and/or legally privileged, and is intended
>>
>>solely for the
>>
>>>use of the individual or entity named in this message. If
>>
>>you are not
>>
>>>the intended recipient, and have received this message in error,
>>>please immediately return this by email and then delete it.
>>>
>>>
>>>>-----Original Message-----
>>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>>Sent: Thursday, April 26, 2007 1:44 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: RE: How to debug object retrieveal in JPA?
>>>>
>>>>Some more information on this exception
>>>>
>>>>Right after the execution the exception held inside the result is
>>>>"com.sun.jdi.InvocationException occurred invoking
>>
>>method..." Can't
>>
>>>>seem to get more data out of it
>>>>
>>>>Once the system.out is executed the exception changes to
>>>
>>>"The result
>>>
>>>>list has been closed"
>>>>
>>>>-----Original Message-----
>>>>From: Phill Moran [mailto:pjmoran@rogers.com]
>>>>Sent: April 26, 2007 4:18 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: RE: How to debug object retrieveal in JPA?
>>>>
>>>>I did not mean it threw an NPE but I was left with a null
>>>
>>>result list.
>>>
>>>>I have setup trace already and I actually get nothing back.
>>>>Here is the trace across the execution point
>>>>
>>>>13734 WARN [main] openjpa.MetaData - Found duplicate query
>>>>"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
>>>>Ignoring.
>>>>22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> executing prepstmnt 31103354 SELECT t0.id,
>>>>t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
>>>
>>>t0.created,
>>>
>>>>t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
>>
>>t0.locale,
>>
>>>>t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
>>
>>t2.description,
>>
>>>>t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
>>>>t4.lastUpdated, t4.description, t4.categoryTypeFK,
>>
>>t4.value, t1.id,
>>
>>>>t1.lastUpdated, t1.created, t1.description, t1.displayName,
>>>
>>>t1.name,
>>>
>>>>t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
>>
>>t5.value,
>>
>>>>t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
>>>>t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
>>>
>>>t0.roleFK =
>>>
>>>>t2.id LEFT OUTER JOIN category
>>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
>>>
>>>ON t1.typeFK
>>>
>>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
>>>
>>>t2.categoryTypeFK = t3.id
>>>
>>>>WHERE
>>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
>>>
>>>t0.lastName
>>>
>>>>ASC, t0.firstName ASC [params=(String) BIDSPEC,
>>>>(String) PMORAN]
>>>>22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> [15 ms] spent
>>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
>>>>person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
>>>
>>>t1.id LEFT
>>>
>>>>OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
>>
>>JOIN category
>>
>>>>t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
>>>
>>>ON t1.typeFK
>>>
>>>>= t5.id LEFT OUTER JOIN categorytype t3 ON
>>>
>>>t2.categoryTypeFK = t3.id
>>>
>>>>WHERE
>>>>(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
>>>>[params=(String) BIDSPEC,
>>>>(String) PMORAN]
>>>>27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
>>>>9575056> [0 ms] spent
>>>>1
>>>>[2007-04-26 16:07:36,125] INFO
>>>>ca.BidSpec.testing.emall.UserFactoryTest Rolled back
>>>
>>>transaction after
>>>
>>>>test execution
>>>>
>>>>What is interesting is the line with a "1" (from
>>>>System.out.println(results.size())). What this represents is the
>>>>message that the "result list is closed" nothing else in
>>
>>the trace.
>>
>>>>So what causes the result list to be closed?
>>>>
>>>>Phill
>>>>
>>>>-----Original Message-----
>>>>From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
>>>
>>>On Behalf
>>>
>>>>Of Marc Prud'hommeaux
>>>>Sent: April 26, 2007 3:54 PM
>>>>To: open-jpa-dev@incubator.apache.org
>>>>Subject: Re: How to debug object retrieveal in JPA?
>>>>
>>>>Phill-
>>>>
>>>>The maximum verbosity of logging is obtained by specifying the
>>>>"openjpa.Log"
>>>>property to "DefaultLevel=TRACE".
>>>>
>>>>What is the full exception stack trace? We might be able to help
>>>>identify the problem. In any case OpenJPA should never be
>>>
>>>throwing an
>>>
>>>>NPE, so we should at least probably fix the error message.
>>>>
>>>>
>>>>On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>>>>
>>>>
>>>>>Community,
>>>>>
>>>>>How does one go about debugging object retrieval/creation.
>>>>
>>>>I continue
>>>>
>>>>>to have exceptions and little to go on as far as the cause.
>>>>>The named JPQL is good since I know it generates a good sql
>>>>
>>>>(can trace
>>>>
>>>>>code and see it) . I know the sql is good as I can
>>>>
>>>>copy/paste it into
>>>>
>>>>>mysql query browser, execute and get the correct data back. The
>>>>>problem is that these lines result in an NPE.
>>>>>
>>>>> Query q =
>>>>>
>>
>>this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
>>
>>>>> q.setParameter("storeName",
>>
>>storeName.toUpperCase());
>>
>>>>> q.setParameter("loginName",
>>
>>loginName.toUpperCase());
>>
>>>>> List<Person> results = null;
>>>>> try {
>>>>> results = (List<Person>) q.getResultList();
>>>>> System.out.println(results.size());
>>>>> }
>>>>> catch(Exception e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>> if (results.isEmpty()) { <- NPE thrown here
>>>>> throw new UserNotFoundException("No
>>>>
>>>>user found");
>>>>
>>>>> }
>>>>>Also the "mappingTool validate" seems to work fine. Of
>>
>>course how
>>
>>>>>would I know since I can find no description of what a good
>>>>
>>>>one looks
>>>>
>>>>>like but reading it (no
>>>>>exceptions) seem to make sense.
>>>>>
>>>>>Any help would be much appreciated.
>>>>>
>>>>>Phill
>>>>>
>>>>
>>>>
>>>Notice: This email message, together with any attachments, may
>>>contain information of BEA Systems, Inc., its subsidiaries and
>>>affiliated entities, that may be confidential, proprietary,
>>>copyrighted and/or legally privileged, and is intended
>>
>>solely for the
>>
>>>use of the individual or entity named in this message. If
>>
>>you are not
>>
>>>the intended recipient, and have received this message in error,
>>>please immediately return this by email and then delete it.
>>>
>>>
>>
>>Notice: This email message, together with any attachments, may
>>contain information of BEA Systems, Inc., its subsidiaries and
>>affiliated entities, that may be confidential, proprietary,
>>copyrighted and/or legally privileged, and is intended solely for the
>>use of the individual or entity named in this message. If you are not
>>the intended recipient, and have received this message in error,
>>please immediately return this by email and then delete it.
>>
>>
>
>
> Notice: This email message, together with any attachments, may contain
> information of BEA Systems, Inc., its subsidiaries and affiliated
> entities, that may be confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the individual or entity named
> in this message. If you are not the intended recipient, and have received this
> message in error, please immediately return this by email and then delete it.
>
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
I had suspected the Locale so I made a set/getLocale that communicate in String.
I figured that openJPA does not actually care how I implement.
But for this run I removed it completely and did a clean rebuild. Good news and
bad the exception changed:
java.util.NoSuchElementException: The result list has been closed.
at
org.apache.openjpa.lib.rop.AbstractResultList.assertOpen(AbstractResultList.java
:91)
at
org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(AbstractNonSequen
tialResultList.java:68)
at
org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultList.java:241
)
at
ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(PersonFactoryI
mpl.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:304)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:139)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:107)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:161)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:203)
at $Proxy34.getLoginPersonValueObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:304)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:139)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:107)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:161)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:203)
at $Proxy34.getLoginPersonValueObject(Unknown Source)
at
ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactoryTest.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69
)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ac
cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.
run(AbstractAnnotationAwareTransactionalTests.java:115)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nTest(AbstractAnnotationAwareTransactionalTests.java:180)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nBare(AbstractAnnotationAwareTransactionalTests.java:111)
at
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159)
at
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at
org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java
:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunne
r.java:34)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
ce.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:196)
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 26, 2007 9:59 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
> Caused by: java.lang.NullPointerException
> at java.util.Locale.toLowerCase(Locale.java:1060)
> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> at java.util.Locale.<init>(Locale.java:272)
> at java.util.Locale.<init>(Locale.java:302)
> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
Now we're getting somewhere.... what happens if you remove the Locale field from
the Person class?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 6:32 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Run that config gives us this lovely message:
>
> <0|false|0.9.6-incubating>
> org.apache.openjpa.persistence.PersistenceException:
> null
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> Manager.java:773)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> .java:254)
> at
> org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> tImpl.java:2115)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> .java:248)
> at
> org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> tResultObject(Inst
> anceResultObjectProvider.java:56)
> at
> org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> ResultList.java:12
> 8)
> at
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> (AbstractNonSequen
> tialResultList.java:69)
> at
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> esultList.java:241
> )
> at
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> ect(PersonFactoryI
> mpl.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> eflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.i
> nvokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterce
> ptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> kDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> eflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.i
> nvokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterce
> ptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> kDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> yTest.java:119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at
> org.springframework.test.ConditionalTestCase.runBare(Condition
> alTestCase.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:159)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:239)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> Runner.java:35)
> at
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> .java:29)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> stClassRunner.java
> :42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> eforeAndAfterRunne
> r.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> .java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> (JUnit4TestReferen
> ce.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> ecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> s(RemoteTestRunner
> .java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> s(RemoteTestRunner
> .java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> oteTestRunner.java
> :386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> moteTestRunner.jav
> a:196)
> Caused by: java.lang.NullPointerException
> at java.util.Locale.toLowerCase(Locale.java:1060)
> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> at java.util.Locale.<init>(Locale.java:272)
> at java.util.Locale.<init>(Locale.java:302)
> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
> at
> org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> agerImpl.java:247)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> e(JDBCStoreManager
> .java:327)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> CStoreManager.java
> :252)
> at
> org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> legatingStoreManag
> er.java:108)
> at
> org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> anager.java:54)
> at
> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> ... 64 more
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 5:40 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> > Can you post what you get if you do '((Exception)
> > results.get(0)).printStackTrace()'?
>
> ... so results.get(0) is returning a List? That's very odd.
> What if you
> do:
>
> System.out.println(results.get(0))?
>
> If it is a List of Exceptions, what if you print out the stacks of the
> exceptions in the list?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Thursday, April 26, 2007 2:36 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Can't cast List to Exception
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 26, 2007 5:00 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > So you're saying that the ResultList contains an Exception?
> > Can you post what you get if you do '((Exception)
> > results.get(0)).printStackTrace()'?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Thursday, April 26, 2007 1:44 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > Some more information on this exception
> > >
> > > Right after the execution the exception held inside the result is
> > > "com.sun.jdi.InvocationException occurred invoking
> method..." Can't
> > > seem to get more data out of it
> > >
> > > Once the system.out is executed the exception changes to
> > "The result
> > > list has been closed"
> > >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: April 26, 2007 4:18 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > I did not mean it threw an NPE but I was left with a null
> > result list.
> > >
> > > I have setup trace already and I actually get nothing back.
> > > Here is the trace across the execution point
> > >
> > > 13734 WARN [main] openjpa.MetaData - Found duplicate query
> > > "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > > Ignoring.
> > > 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > t0.created,
> > > t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> t0.locale,
> > > t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> t2.description,
> > > t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > t4.lastUpdated, t4.description, t4.categoryTypeFK,
> t4.value, t1.id,
> > > t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > t1.name,
> > > t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> t5.value,
> > > t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> > > t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > t0.roleFK =
> > > t2.id LEFT OUTER JOIN category
> > > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > ON t1.typeFK
> > > = t5.id LEFT OUTER JOIN categorytype t3 ON
> > t2.categoryTypeFK = t3.id
> > > WHERE
> > > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > t0.lastName
> > > ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > (String) PMORAN]
> > > 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> [15 ms] spent
> > > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > t1.id LEFT
> > > OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> JOIN category
> > > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > ON t1.typeFK
> > > = t5.id LEFT OUTER JOIN categorytype t3 ON
> > t2.categoryTypeFK = t3.id
> > > WHERE
> > > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > [params=(String) BIDSPEC,
> > > (String) PMORAN]
> > > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> [0 ms] spent
> > > 1
> > > [2007-04-26 16:07:36,125] INFO
> > > ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > transaction after
> > > test execution
> > >
> > > What is interesting is the line with a "1" (from
> > > System.out.println(results.size())). What this represents is the
> > > message that the "result list is closed" nothing else in
> the trace.
> > >
> > > So what causes the result list to be closed?
> > >
> > > Phill
> > >
> > > -----Original Message-----
> > > From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > On Behalf
> > > Of Marc Prud'hommeaux
> > > Sent: April 26, 2007 3:54 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: Re: How to debug object retrieveal in JPA?
> > >
> > > Phill-
> > >
> > > The maximum verbosity of logging is obtained by specifying the
> > > "openjpa.Log"
> > > property to "DefaultLevel=TRACE".
> > >
> > > What is the full exception stack trace? We might be able to help
> > > identify the problem. In any case OpenJPA should never be
> > throwing an
> > > NPE, so we should at least probably fix the error message.
> > >
> > >
> > > On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > >
> > > > Community,
> > > >
> > > > How does one go about debugging object retrieval/creation.
> > > I continue
> > > > to have exceptions and little to go on as far as the cause.
> > > > The named JPQL is good since I know it generates a good sql
> > > (can trace
> > > > code and see it) . I know the sql is good as I can
> > > copy/paste it into
> > > > mysql query browser, execute and get the correct data back. The
> > > > problem is that these lines result in an NPE.
> > > >
> > > > Query q =
> > > >
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > > q.setParameter("storeName",
> storeName.toUpperCase());
> > > > q.setParameter("loginName",
> loginName.toUpperCase());
> > > > List<Person> results = null;
> > > > try {
> > > > results = (List<Person>) q.getResultList();
> > > > System.out.println(results.size());
> > > > }
> > > > catch(Exception e) {
> > > > e.printStackTrace();
> > > > }
> > > > if (results.isEmpty()) { <- NPE thrown here
> > > > throw new UserNotFoundException("No
> > > user found");
> > > > }
> > > > Also the "mappingTool validate" seems to work fine. Of
> course how
> > > > would I know since I can find no description of what a good
> > > one looks
> > > > like but reading it (no
> > > > exceptions) seem to make sense.
> > > >
> > > > Any help would be much appreciated.
> > > >
> > > > Phill
> > > >
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
> Caused by: java.lang.NullPointerException
> at java.util.Locale.toLowerCase(Locale.java:1060)
> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> at java.util.Locale.<init>(Locale.java:272)
> at java.util.Locale.<init>(Locale.java:302)
> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
Now we're getting somewhere.... what happens if you remove the Locale
field from the Person class?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 6:32 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Run that config gives us this lovely message:
>
> <0|false|0.9.6-incubating>
> org.apache.openjpa.persistence.PersistenceException:
> null
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStore
> Manager.java:773)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> .java:254)
> at
> org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(Selec
> tImpl.java:2115)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult
> .java:248)
> at
> org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.ge
> tResultObject(Inst
> anceResultObjectProvider.java:56)
> at
> org.apache.openjpa.lib.rop.WindowResultList.getInternal(Window
> ResultList.java:12
> 8)
> at
> org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get
> (AbstractNonSequen
> tialResultList.java:69)
> at
> org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingR
> esultList.java:241
> )
> at
> ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObj
> ect(PersonFactoryI
> mpl.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> eflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.i
> nvokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterce
> ptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> kDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingR
> eflection(AopUtils
> .java:304)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.i
> nvokeJoinpoint(Ref
> lectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:139)
> at
> org.springframework.transaction.interceptor.TransactionInterce
> ptor.invoke(Transa
> ctionInterceptor.java:107)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.p
> roceed(ReflectiveM
> ethodInvocation.java:161)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Jd
> kDynamicAopProxy.j
> ava:203)
> at $Proxy34.getLoginPersonValueObject(Unknown Source)
> at
> ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactor
> yTest.java:119)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at
> org.springframework.test.ConditionalTestCase.runBare(Condition
> alTestCase.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTra
> nsactionalTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:159)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare(Abstract
> JpaTests.java:239)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClass
> Runner.java:35)
> at
> org.junit.internal.runners.CompositeRunner.run(CompositeRunner
> .java:29)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(Te
> stClassRunner.java
> :42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(B
> eforeAndAfterRunne
> r.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner
> .java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
> (JUnit4TestReferen
> ce.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
> ecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> s(RemoteTestRunner
> .java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
> s(RemoteTestRunner
> .java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
> oteTestRunner.java
> :386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Re
> moteTestRunner.jav
> a:196)
> Caused by: java.lang.NullPointerException
> at java.util.Locale.toLowerCase(Locale.java:1060)
> at java.util.Locale.convertOldISOCodes(Locale.java:1083)
> at java.util.Locale.<init>(Locale.java:272)
> at java.util.Locale.<init>(Locale.java:302)
> at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
> at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
> at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
> at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
> at
> org.apache.openjpa.kernel.StateManagerImpl.initialize(StateMan
> agerImpl.java:247)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeStat
> e(JDBCStoreManager
> .java:327)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDB
> CStoreManager.java
> :252)
> at
> org.apache.openjpa.kernel.DelegatingStoreManager.initialize(De
> legatingStoreManag
> er.java:108)
> at
> org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreM
> anager.java:54)
> at
> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
> at
> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
> ... 64 more
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 5:40 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> > Can you post what you get if you do '((Exception)
> > results.get(0)).printStackTrace()'?
>
> ... so results.get(0) is returning a List? That's very odd.
> What if you
> do:
>
> System.out.println(results.get(0))?
>
> If it is a List of Exceptions, what if you print out the
> stacks of the exceptions in the list?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Thursday, April 26, 2007 2:36 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Can't cast List to Exception
> >
> > -----Original Message-----
> > From: Patrick Linskey [mailto:plinskey@bea.com]
> > Sent: April 26, 2007 5:00 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > So you're saying that the ResultList contains an Exception?
> > Can you post what you get if you do '((Exception)
> > results.get(0)).printStackTrace()'?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> > ______________________________________________________________
> > _________
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: Thursday, April 26, 2007 1:44 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > Some more information on this exception
> > >
> > > Right after the execution the exception held inside the result is
> > > "com.sun.jdi.InvocationException occurred invoking
> method..." Can't
> > > seem to get more data out of it
> > >
> > > Once the system.out is executed the exception changes to
> > "The result
> > > list has been closed"
> > >
> > > -----Original Message-----
> > > From: Phill Moran [mailto:pjmoran@rogers.com]
> > > Sent: April 26, 2007 4:18 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: RE: How to debug object retrieveal in JPA?
> > >
> > > I did not mean it threw an NPE but I was left with a null
> > result list.
> > >
> > > I have setup trace already and I actually get nothing back.
> > > Here is the trace across the execution point
> > >
> > > 13734 WARN [main] openjpa.MetaData - Found duplicate query
> > > "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > > Ignoring.
> > > 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> executing prepstmnt 31103354 SELECT t0.id,
> > > t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> > t0.created,
> > > t0.displayName, t0.firstName, t0.lastLogin, t0.lastName,
> t0.locale,
> > > t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
> t2.description,
> > > t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > > t4.lastUpdated, t4.description, t4.categoryTypeFK,
> t4.value, t1.id,
> > > t1.lastUpdated, t1.created, t1.description, t1.displayName,
> > t1.name,
> > > t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK,
> t5.value,
> > > t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> > > t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> > t0.roleFK =
> > > t2.id LEFT OUTER JOIN category
> > > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > ON t1.typeFK
> > > = t5.id LEFT OUTER JOIN categorytype t3 ON
> > t2.categoryTypeFK = t3.id
> > > WHERE
> > > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> > t0.lastName
> > > ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > > (String) PMORAN]
> > > 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> [15 ms] spent
> > > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > > person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> > t1.id LEFT
> > > OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> JOIN category
> > > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> > ON t1.typeFK
> > > = t5.id LEFT OUTER JOIN categorytype t3 ON
> > t2.categoryTypeFK = t3.id
> > > WHERE
> > > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > > [params=(String) BIDSPEC,
> > > (String) PMORAN]
> > > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > > 9575056> [0 ms] spent
> > > 1
> > > [2007-04-26 16:07:36,125] INFO
> > > ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> > transaction after
> > > test execution
> > >
> > > What is interesting is the line with a "1" (from
> > > System.out.println(results.size())). What this represents is the
> > > message that the "result list is closed" nothing else in
> the trace.
> > >
> > > So what causes the result list to be closed?
> > >
> > > Phill
> > >
> > > -----Original Message-----
> > > From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> > On Behalf
> > > Of Marc Prud'hommeaux
> > > Sent: April 26, 2007 3:54 PM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: Re: How to debug object retrieveal in JPA?
> > >
> > > Phill-
> > >
> > > The maximum verbosity of logging is obtained by specifying the
> > > "openjpa.Log"
> > > property to "DefaultLevel=TRACE".
> > >
> > > What is the full exception stack trace? We might be able to help
> > > identify the problem. In any case OpenJPA should never be
> > throwing an
> > > NPE, so we should at least probably fix the error message.
> > >
> > >
> > > On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> > >
> > > > Community,
> > > >
> > > > How does one go about debugging object retrieval/creation.
> > > I continue
> > > > to have exceptions and little to go on as far as the cause.
> > > > The named JPQL is good since I know it generates a good sql
> > > (can trace
> > > > code and see it) . I know the sql is good as I can
> > > copy/paste it into
> > > > mysql query browser, execute and get the correct data back. The
> > > > problem is that these lines result in an NPE.
> > > >
> > > > Query q =
> > > >
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > > q.setParameter("storeName",
> storeName.toUpperCase());
> > > > q.setParameter("loginName",
> loginName.toUpperCase());
> > > > List<Person> results = null;
> > > > try {
> > > > results = (List<Person>) q.getResultList();
> > > > System.out.println(results.size());
> > > > }
> > > > catch(Exception e) {
> > > > e.printStackTrace();
> > > > }
> > > > if (results.isEmpty()) { <- NPE thrown here
> > > > throw new UserNotFoundException("No
> > > user found");
> > > > }
> > > > Also the "mappingTool validate" seems to work fine. Of
> course how
> > > > would I know since I can find no description of what a good
> > > one looks
> > > > like but reading it (no
> > > > exceptions) seem to make sense.
> > > >
> > > > Any help would be much appreciated.
> > > >
> > > > Phill
> > > >
> > >
> > >
> >
> > Notice: This email message, together with any attachments, may
> > contain information of BEA Systems, Inc., its subsidiaries and
> > affiliated entities, that may be confidential, proprietary,
> > copyrighted and/or legally privileged, and is intended
> solely for the
> > use of the individual or entity named in this message. If
> you are not
> > the intended recipient, and have received this message in error,
> > please immediately return this by email and then delete it.
> >
> >
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
Run that config gives us this lovely message:
<0|false|0.9.6-incubating> org.apache.openjpa.persistence.PersistenceException:
null
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:748)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:773)
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:254)
at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2115)
at
org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:248)
at
org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(Inst
anceResultObjectProvider.java:56)
at
org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:12
8)
at
org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(AbstractNonSequen
tialResultList.java:69)
at
org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultList.java:241
)
at
ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(PersonFactoryI
mpl.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:304)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:139)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:107)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:161)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:203)
at $Proxy34.getLoginPersonValueObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils
.java:304)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(Ref
lectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:139)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa
ctionInterceptor.java:107)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:161)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:203)
at $Proxy34.getLoginPersonValueObject(Unknown Source)
at
ca.BidSpec.testing.emall.UserFactoryTest.testDelete(UserFactoryTest.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69
)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ac
cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.
run(AbstractAnnotationAwareTransactionalTests.java:115)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nTest(AbstractAnnotationAwareTransactionalTests.java:180)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru
nBare(AbstractAnnotationAwareTransactionalTests.java:111)
at
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159)
at
org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at
org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java
:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunne
r.java:34)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
ce.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:196)
Caused by: java.lang.NullPointerException
at java.util.Locale.toLowerCase(Locale.java:1060)
at java.util.Locale.convertOldISOCodes(Locale.java:1083)
at java.util.Locale.<init>(Locale.java:272)
at java.util.Locale.<init>(Locale.java:302)
at ca.BidSpec.emall.user.Person.pcsetLocale(Person.java:375)
at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
at
org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
at
org.apache.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:247)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager
.java:327)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java
:252)
at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManag
er.java:108)
at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:54)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:870)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:828)
... 64 more
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 26, 2007 5:40 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
> Can you post what you get if you do '((Exception)
> results.get(0)).printStackTrace()'?
... so results.get(0) is returning a List? That's very odd. What if you
do:
System.out.println(results.get(0))?
If it is a List of Exceptions, what if you print out the stacks of the
exceptions in the list?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 2:36 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Can't cast List to Exception
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 5:00 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> So you're saying that the ResultList contains an Exception?
> Can you post what you get if you do '((Exception)
> results.get(0)).printStackTrace()'?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Thursday, April 26, 2007 1:44 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Some more information on this exception
> >
> > Right after the execution the exception held inside the result is
> > "com.sun.jdi.InvocationException occurred invoking method..." Can't
> > seem to get more data out of it
> >
> > Once the system.out is executed the exception changes to
> "The result
> > list has been closed"
> >
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: April 26, 2007 4:18 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > I did not mean it threw an NPE but I was left with a null
> result list.
> >
> > I have setup trace already and I actually get nothing back.
> > Here is the trace across the execution point
> >
> > 13734 WARN [main] openjpa.MetaData - Found duplicate query
> > "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > Ignoring.
> > 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> executing prepstmnt 31103354 SELECT t0.id,
> > t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> t0.created,
> > t0.displayName, t0.firstName, t0.lastLogin, t0.lastName, t0.locale,
> > t0.loginName, t0.middleName, t2.id, t2.lastUpdated, t2.description,
> > t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value, t1.id,
> > t1.lastUpdated, t1.created, t1.description, t1.displayName,
> t1.name,
> > t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value,
> > t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> > t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> t0.roleFK =
> > t2.id LEFT OUTER JOIN category
> > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> ON t1.typeFK
> > = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id
> > WHERE
> > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> t0.lastName
> > ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > (String) PMORAN]
> > 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> [15 ms] spent
> > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> t1.id LEFT
> > OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
> > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> ON t1.typeFK
> > = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id
> > WHERE
> > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > [params=(String) BIDSPEC,
> > (String) PMORAN]
> > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> [0 ms] spent
> > 1
> > [2007-04-26 16:07:36,125] INFO
> > ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> transaction after
> > test execution
> >
> > What is interesting is the line with a "1" (from
> > System.out.println(results.size())). What this represents is the
> > message that the "result list is closed" nothing else in the trace.
> >
> > So what causes the result list to be closed?
> >
> > Phill
> >
> > -----Original Message-----
> > From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> On Behalf
> > Of Marc Prud'hommeaux
> > Sent: April 26, 2007 3:54 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Re: How to debug object retrieveal in JPA?
> >
> > Phill-
> >
> > The maximum verbosity of logging is obtained by specifying the
> > "openjpa.Log"
> > property to "DefaultLevel=TRACE".
> >
> > What is the full exception stack trace? We might be able to help
> > identify the problem. In any case OpenJPA should never be
> throwing an
> > NPE, so we should at least probably fix the error message.
> >
> >
> > On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> >
> > > Community,
> > >
> > > How does one go about debugging object retrieval/creation.
> > I continue
> > > to have exceptions and little to go on as far as the cause.
> > > The named JPQL is good since I know it generates a good sql
> > (can trace
> > > code and see it) . I know the sql is good as I can
> > copy/paste it into
> > > mysql query browser, execute and get the correct data back. The
> > > problem is that these lines result in an NPE.
> > >
> > > Query q =
> > > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > q.setParameter("storeName", storeName.toUpperCase());
> > > q.setParameter("loginName", loginName.toUpperCase());
> > > List<Person> results = null;
> > > try {
> > > results = (List<Person>) q.getResultList();
> > > System.out.println(results.size());
> > > }
> > > catch(Exception e) {
> > > e.printStackTrace();
> > > }
> > > if (results.isEmpty()) { <- NPE thrown here
> > > throw new UserNotFoundException("No
> > user found");
> > > }
> > > Also the "mappingTool validate" seems to work fine. Of course how
> > > would I know since I can find no description of what a good
> > one looks
> > > like but reading it (no
> > > exceptions) seem to make sense.
> > >
> > > Any help would be much appreciated.
> > >
> > > Phill
> > >
> >
> >
>
> Notice: This email message, together with any attachments, may
> contain information of BEA Systems, Inc., its subsidiaries and
> affiliated entities, that may be confidential, proprietary,
> copyrighted and/or legally privileged, and is intended solely for the
> use of the individual or entity named in this message. If you are not
> the intended recipient, and have received this message in error,
> please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
> Can you post what you get if you do '((Exception)
> results.get(0)).printStackTrace()'?
... so results.get(0) is returning a List? That's very odd. What if you
do:
System.out.println(results.get(0))?
If it is a List of Exceptions, what if you print out the stacks of the
exceptions in the list?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 2:36 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Can't cast List to Exception
>
> -----Original Message-----
> From: Patrick Linskey [mailto:plinskey@bea.com]
> Sent: April 26, 2007 5:00 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> So you're saying that the ResultList contains an Exception?
> Can you post what you get if you do '((Exception)
> results.get(0)).printStackTrace()'?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________
> _________
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: Thursday, April 26, 2007 1:44 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > Some more information on this exception
> >
> > Right after the execution the exception held inside the result is
> > "com.sun.jdi.InvocationException occurred invoking method..." Can't
> > seem to get more data out of it
> >
> > Once the system.out is executed the exception changes to
> "The result
> > list has been closed"
> >
> > -----Original Message-----
> > From: Phill Moran [mailto:pjmoran@rogers.com]
> > Sent: April 26, 2007 4:18 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: How to debug object retrieveal in JPA?
> >
> > I did not mean it threw an NPE but I was left with a null
> result list.
> >
> > I have setup trace already and I actually get nothing back.
> > Here is the trace across the execution point
> >
> > 13734 WARN [main] openjpa.MetaData - Found duplicate query
> > "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> > Ignoring.
> > 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> executing prepstmnt 31103354 SELECT t0.id,
> > t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> t0.created,
> > t0.displayName, t0.firstName, t0.lastLogin, t0.lastName, t0.locale,
> > t0.loginName, t0.middleName, t2.id, t2.lastUpdated, t2.description,
> > t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> > t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value, t1.id,
> > t1.lastUpdated, t1.created, t1.description, t1.displayName,
> t1.name,
> > t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value,
> > t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> > t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON
> t0.roleFK =
> > t2.id LEFT OUTER JOIN category
> > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> ON t1.typeFK
> > = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id
> > WHERE
> > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> t0.lastName
> > ASC, t0.firstName ASC [params=(String) BIDSPEC,
> > (String) PMORAN]
> > 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> [15 ms] spent
> > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> > person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> t1.id LEFT
> > OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
> > t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5
> ON t1.typeFK
> > = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id
> > WHERE
> > (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> > [params=(String) BIDSPEC,
> > (String) PMORAN]
> > 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> > 9575056> [0 ms] spent
> > 1
> > [2007-04-26 16:07:36,125] INFO
> > ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> transaction after
> > test execution
> >
> > What is interesting is the line with a "1" (from
> > System.out.println(results.size())). What this represents is the
> > message that the "result list is closed" nothing else in the trace.
> >
> > So what causes the result list to be closed?
> >
> > Phill
> >
> > -----Original Message-----
> > From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]
> On Behalf
> > Of Marc Prud'hommeaux
> > Sent: April 26, 2007 3:54 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Re: How to debug object retrieveal in JPA?
> >
> > Phill-
> >
> > The maximum verbosity of logging is obtained by specifying the
> > "openjpa.Log"
> > property to "DefaultLevel=TRACE".
> >
> > What is the full exception stack trace? We might be able to help
> > identify the problem. In any case OpenJPA should never be
> throwing an
> > NPE, so we should at least probably fix the error message.
> >
> >
> > On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> >
> > > Community,
> > >
> > > How does one go about debugging object retrieval/creation.
> > I continue
> > > to have exceptions and little to go on as far as the cause.
> > > The named JPQL is good since I know it generates a good sql
> > (can trace
> > > code and see it) . I know the sql is good as I can
> > copy/paste it into
> > > mysql query browser, execute and get the correct data back. The
> > > problem is that these lines result in an NPE.
> > >
> > > Query q =
> > > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > > q.setParameter("storeName", storeName.toUpperCase());
> > > q.setParameter("loginName", loginName.toUpperCase());
> > > List<Person> results = null;
> > > try {
> > > results = (List<Person>) q.getResultList();
> > > System.out.println(results.size());
> > > }
> > > catch(Exception e) {
> > > e.printStackTrace();
> > > }
> > > if (results.isEmpty()) { <- NPE thrown here
> > > throw new UserNotFoundException("No
> > user found");
> > > }
> > > Also the "mappingTool validate" seems to work fine. Of course how
> > > would I know since I can find no description of what a good
> > one looks
> > > like but reading it (no
> > > exceptions) seem to make sense.
> > >
> > > Any help would be much appreciated.
> > >
> > > Phill
> > >
> >
> >
>
> Notice: This email message, together with any attachments,
> may contain information of BEA Systems, Inc., its
> subsidiaries and affiliated entities, that may be
> confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the
> individual or entity named in this message. If you are not
> the intended recipient, and have received this message in
> error, please immediately return this by email and then delete it.
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
Can't cast List to Exception
-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com]
Sent: April 26, 2007 5:00 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
So you're saying that the ResultList contains an Exception? Can you post what
you get if you do '((Exception) results.get(0)).printStackTrace()'?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 1:44 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Some more information on this exception
>
> Right after the execution the exception held inside the result is
> "com.sun.jdi.InvocationException occurred invoking method..." Can't
> seem to get more data out of it
>
> Once the system.out is executed the exception changes to "The result
> list has been closed"
>
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: April 26, 2007 4:18 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I did not mean it threw an NPE but I was left with a null result list.
>
> I have setup trace already and I actually get nothing back.
> Here is the trace across the execution point
>
> 13734 WARN [main] openjpa.MetaData - Found duplicate query
> "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> Ignoring.
> 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 31103354 SELECT t0.id,
> t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil, t0.created,
> t0.displayName, t0.firstName, t0.lastLogin, t0.lastName, t0.locale,
> t0.loginName, t0.middleName, t2.id, t2.lastUpdated, t2.description,
> t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
> t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value, t1.id,
> t1.lastUpdated, t1.created, t1.description, t1.displayName, t1.name,
> t5.id, t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value,
> t0.title, t0.visible FROM person t0 INNER JOIN manufacturer t1 ON
> t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON t0.roleFK =
> t2.id LEFT OUTER JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK
> = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
> WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName
> ASC, t0.firstName ASC [params=(String) BIDSPEC,
> (String) PMORAN]
> 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [15 ms] spent
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK = t1.id LEFT
> OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK
> = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
> WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> [params=(String) BIDSPEC,
> (String) PMORAN]
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [0 ms] spent
> 1
> [2007-04-26 16:07:36,125] INFO
> ca.BidSpec.testing.emall.UserFactoryTest Rolled back transaction after
> test execution
>
> What is interesting is the line with a "1" (from
> System.out.println(results.size())). What this represents is the
> message that the "result list is closed" nothing else in the trace.
>
> So what causes the result list to be closed?
>
> Phill
>
> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On Behalf
> Of Marc Prud'hommeaux
> Sent: April 26, 2007 3:54 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> Phill-
>
> The maximum verbosity of logging is obtained by specifying the
> "openjpa.Log"
> property to "DefaultLevel=TRACE".
>
> What is the full exception stack trace? We might be able to help
> identify the problem. In any case OpenJPA should never be throwing an
> NPE, so we should at least probably fix the error message.
>
>
> On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>
> > Community,
> >
> > How does one go about debugging object retrieval/creation.
> I continue
> > to have exceptions and little to go on as far as the cause.
> > The named JPQL is good since I know it generates a good sql
> (can trace
> > code and see it) . I know the sql is good as I can
> copy/paste it into
> > mysql query browser, execute and get the correct data back. The
> > problem is that these lines result in an NPE.
> >
> > Query q =
> > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > q.setParameter("storeName", storeName.toUpperCase());
> > q.setParameter("loginName", loginName.toUpperCase());
> > List<Person> results = null;
> > try {
> > results = (List<Person>) q.getResultList();
> > System.out.println(results.size());
> > }
> > catch(Exception e) {
> > e.printStackTrace();
> > }
> > if (results.isEmpty()) { <- NPE thrown here
> > throw new UserNotFoundException("No
> user found");
> > }
> > Also the "mappingTool validate" seems to work fine. Of course how
> > would I know since I can find no description of what a good
> one looks
> > like but reading it (no
> > exceptions) seem to make sense.
> >
> > Any help would be much appreciated.
> >
> > Phill
> >
>
>
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity named
in this message. If you are not the intended recipient, and have received this
message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
So you're saying that the ResultList contains an Exception? Can you post
what you get if you do '((Exception) results.get(0)).printStackTrace()'?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 1:44 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> Some more information on this exception
>
> Right after the execution the exception held inside the
> result is "com.sun.jdi.InvocationException occurred invoking
> method..." Can't seem to get more data out of it
>
> Once the system.out is executed the exception changes to "The
> result list has been closed"
>
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: April 26, 2007 4:18 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: How to debug object retrieveal in JPA?
>
> I did not mean it threw an NPE but I was left with a null
> result list.
>
> I have setup trace already and I actually get nothing back.
> Here is the trace across the execution point
>
> 13734 WARN [main] openjpa.MetaData - Found duplicate query
> "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person".
> Ignoring.
> 22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 31103354 SELECT t0.id,
> t0.lastUpdated, t0.active, t0.activeFrom, t0.activeUntil,
> t0.created, t0.displayName, t0.firstName, t0.lastLogin,
> t0.lastName, t0.locale, t0.loginName, t0.middleName, t2.id,
> t2.lastUpdated, t2.description, t3.id, t3.lastUpdated,
> t3.description, t2.value, t4.id, t4.lastUpdated,
> t4.description, t4.categoryTypeFK, t4.value, t1.id,
> t1.lastUpdated, t1.created, t1.description, t1.displayName,
> t1.name, t5.id, t5.lastUpdated, t5.description,
> t5.categoryTypeFK, t5.value, t0.title, t0.visible FROM person
> t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK = t1.id
> LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER
> JOIN category
> t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON
> t1.typeFK = t5.id LEFT OUTER JOIN categorytype t3 ON
> t2.categoryTypeFK = t3.id WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY
> t0.lastName ASC, t0.firstName ASC [params=(String) BIDSPEC,
> (String) PMORAN]
> 22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [15 ms] spent
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> executing prepstmnt 3888519 SELECT COUNT(*) FROM
> person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
> t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT
> OUTER JOIN category t4 ON t0.salutationFK = t4.id LEFT OUTER
> JOIN category t5 ON t1.typeFK = t5.id LEFT OUTER JOIN
> categorytype t3 ON t2.categoryTypeFK = t3.id WHERE
> (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?)
> [params=(String) BIDSPEC,
> (String) PMORAN]
> 27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn
> 9575056> [0 ms] spent
> 1
> [2007-04-26 16:07:36,125] INFO
> ca.BidSpec.testing.emall.UserFactoryTest Rolled back
> transaction after test execution
>
> What is interesting is the line with a "1" (from
> System.out.println(results.size())). What this represents is
> the message that the "result list is closed" nothing else in
> the trace.
>
> So what causes the result list to be closed?
>
> Phill
>
> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On
> Behalf Of Marc Prud'hommeaux
> Sent: April 26, 2007 3:54 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> Phill-
>
> The maximum verbosity of logging is obtained by specifying
> the "openjpa.Log"
> property to "DefaultLevel=TRACE".
>
> What is the full exception stack trace? We might be able to
> help identify the problem. In any case OpenJPA should never
> be throwing an NPE, so we should at least probably fix the
> error message.
>
>
> On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
>
> > Community,
> >
> > How does one go about debugging object retrieval/creation.
> I continue
> > to have exceptions and little to go on as far as the cause.
> > The named JPQL is good since I know it generates a good sql
> (can trace
> > code and see it) . I know the sql is good as I can
> copy/paste it into
> > mysql query browser, execute and get the correct data back. The
> > problem is that these lines result in an NPE.
> >
> > Query q =
> > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> > q.setParameter("storeName", storeName.toUpperCase());
> > q.setParameter("loginName", loginName.toUpperCase());
> > List<Person> results = null;
> > try {
> > results = (List<Person>) q.getResultList();
> > System.out.println(results.size());
> > }
> > catch(Exception e) {
> > e.printStackTrace();
> > }
> > if (results.isEmpty()) { <- NPE thrown here
> > throw new UserNotFoundException("No
> user found");
> > }
> > Also the "mappingTool validate" seems to work fine. Of course how
> > would I know since I can find no description of what a good
> one looks
> > like but reading it (no
> > exceptions) seem to make sense.
> >
> > Any help would be much appreciated.
> >
> > Phill
> >
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
Some more information on this exception
Right after the execution the exception held inside the result is
"com.sun.jdi.InvocationException occurred invoking method..." Can't seem to get
more data out of it
Once the system.out is executed the exception changes to "The result list has
been closed"
-----Original Message-----
From: Phill Moran [mailto:pjmoran@rogers.com]
Sent: April 26, 2007 4:18 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: How to debug object retrieveal in JPA?
I did not mean it threw an NPE but I was left with a null result list.
I have setup trace already and I actually get nothing back. Here is the trace
across the execution point
13734 WARN [main] openjpa.MetaData - Found duplicate query
"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person". Ignoring.
22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> executing
prepstmnt 31103354 SELECT t0.id, t0.lastUpdated, t0.active, t0.activeFrom,
t0.activeUntil, t0.created, t0.displayName, t0.firstName, t0.lastLogin,
t0.lastName, t0.locale, t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
t2.description, t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value, t1.id,
t1.lastUpdated, t1.created, t1.description, t1.displayName, t1.name, t5.id,
t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value, t0.title,
t0.visible FROM person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK = t5.id
LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id WHERE
(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName ASC,
t0.firstName ASC [params=(String) BIDSPEC, (String) PMORAN]
22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> [15 ms] spent
27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> executing
prepstmnt 3888519 SELECT COUNT(*) FROM person t0 INNER JOIN manufacturer t1 ON
t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT
OUTER JOIN category t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON
t1.typeFK = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
WHERE (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) [params=(String) BIDSPEC,
(String) PMORAN]
27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> [0 ms] spent
1
[2007-04-26 16:07:36,125] INFO ca.BidSpec.testing.emall.UserFactoryTest Rolled
back transaction after test execution
What is interesting is the line with a "1" (from
System.out.println(results.size())). What this represents is the message that
the "result list is closed" nothing else in the trace.
So what causes the result list to be closed?
Phill
-----Original Message-----
From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On Behalf Of Marc
Prud'hommeaux
Sent: April 26, 2007 3:54 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: How to debug object retrieveal in JPA?
Phill-
The maximum verbosity of logging is obtained by specifying the "openjpa.Log"
property to "DefaultLevel=TRACE".
What is the full exception stack trace? We might be able to help identify the
problem. In any case OpenJPA should never be throwing an NPE, so we should at
least probably fix the error message.
On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> Community,
>
> How does one go about debugging object retrieval/creation. I continue
> to have exceptions and little to go on as far as the cause.
> The named JPQL is good since I know it generates a good sql (can trace
> code and see it) . I know the sql is good as I can copy/paste it into
> mysql query browser, execute and get the correct data back. The
> problem is that these lines result in an NPE.
>
> Query q =
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> q.setParameter("storeName", storeName.toUpperCase());
> q.setParameter("loginName", loginName.toUpperCase());
> List<Person> results = null;
> try {
> results = (List<Person>) q.getResultList();
> System.out.println(results.size());
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> if (results.isEmpty()) { <- NPE thrown here
> throw new UserNotFoundException("No user found");
> }
> Also the "mappingTool validate" seems to work fine. Of course how
> would I know since I can find no description of what a good one looks
> like but reading it (no
> exceptions) seem to make sense.
>
> Any help would be much appreciated.
>
> Phill
>
RE: How to debug object retrieveal in JPA?
Posted by Phill Moran <pj...@rogers.com>.
I did not mean it threw an NPE but I was left with a null result list.
I have setup trace already and I actually get nothing back. Here is the trace
across the execution point
13734 WARN [main] openjpa.MetaData - Found duplicate query
"PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person". Ignoring.
22594 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> executing
prepstmnt 31103354 SELECT t0.id, t0.lastUpdated, t0.active, t0.activeFrom,
t0.activeUntil, t0.created, t0.displayName, t0.firstName, t0.lastLogin,
t0.lastName, t0.locale, t0.loginName, t0.middleName, t2.id, t2.lastUpdated,
t2.description, t3.id, t3.lastUpdated, t3.description, t2.value, t4.id,
t4.lastUpdated, t4.description, t4.categoryTypeFK, t4.value, t1.id,
t1.lastUpdated, t1.created, t1.description, t1.displayName, t1.name, t5.id,
t5.lastUpdated, t5.description, t5.categoryTypeFK, t5.value, t0.title,
t0.visible FROM person t0 INNER JOIN manufacturer t1 ON t0.manufacturerFK =
t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT OUTER JOIN category
t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON t1.typeFK = t5.id
LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id WHERE
(UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName ASC,
t0.firstName ASC [params=(String) BIDSPEC, (String) PMORAN]
22609 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> [15 ms] spent
27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> executing
prepstmnt 3888519 SELECT COUNT(*) FROM person t0 INNER JOIN manufacturer t1 ON
t0.manufacturerFK = t1.id LEFT OUTER JOIN category t2 ON t0.roleFK = t2.id LEFT
OUTER JOIN category t4 ON t0.salutationFK = t4.id LEFT OUTER JOIN category t5 ON
t1.typeFK = t5.id LEFT OUTER JOIN categorytype t3 ON t2.categoryTypeFK = t3.id
WHERE (UPPER(t1.name) = ? AND UPPER(t0.loginName) = ?) [params=(String) BIDSPEC,
(String) PMORAN]
27469 TRACE [main] openjpa.jdbc.SQL - <t 31845311, conn 9575056> [0 ms] spent
1
[2007-04-26 16:07:36,125] INFO ca.BidSpec.testing.emall.UserFactoryTest Rolled
back transaction after test execution
What is interesting is the line with a "1" (from
System.out.println(results.size())). What this represents is the message that
the "result list is closed" nothing else in the trace.
So what causes the result list to be closed?
Phill
-----Original Message-----
From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On Behalf Of Marc
Prud'hommeaux
Sent: April 26, 2007 3:54 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: How to debug object retrieveal in JPA?
Phill-
The maximum verbosity of logging is obtained by specifying the "openjpa.Log"
property to "DefaultLevel=TRACE".
What is the full exception stack trace? We might be able to help identify the
problem. In any case OpenJPA should never be throwing an NPE, so we should at
least probably fix the error message.
On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> Community,
>
> How does one go about debugging object retrieval/creation. I continue
> to have exceptions and little to go on as far as the cause.
> The named JPQL is good since I know it generates a good sql (can trace
> code and see it) . I know the sql is good as I can copy/paste it into
> mysql query browser, execute and get the correct data back. The
> problem is that these lines result in an NPE.
>
> Query q =
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> q.setParameter("storeName", storeName.toUpperCase());
> q.setParameter("loginName", loginName.toUpperCase());
> List<Person> results = null;
> try {
> results = (List<Person>) q.getResultList();
> System.out.println(results.size());
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> if (results.isEmpty()) { <- NPE thrown here
> throw new UserNotFoundException("No user found");
> }
> Also the "mappingTool validate" seems to work fine. Of course how
> would I know since I can find no description of what a good one looks
> like but reading it (no
> exceptions) seem to make sense.
>
> Any help would be much appreciated.
>
> Phill
>
Re: How to debug object retrieveal in JPA?
Posted by Marc Prud'hommeaux <mp...@apache.org>.
Phill-
The maximum verbosity of logging is obtained by specifying the
"openjpa.Log" property to "DefaultLevel=TRACE".
What is the full exception stack trace? We might be able to help
identify the problem. In any case OpenJPA should never be throwing an
NPE, so we should at least probably fix the error message.
On Apr 26, 2007, at 12:39 PM, Phill Moran wrote:
> Community,
>
> How does one go about debugging object retrieval/creation. I
> continue to have
> exceptions and little to go on as far as the cause.
> The named JPQL is good since I know it generates a good sql (can
> trace code and
> see it) . I know the sql is good as I can copy/paste it into mysql
> query
> browser, execute and get the correct data back. The problem is that
> these lines
> result in an NPE.
>
> Query q =
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> q.setParameter("storeName", storeName.toUpperCase());
> q.setParameter("loginName", loginName.toUpperCase());
> List<Person> results = null;
> try {
> results = (List<Person>) q.getResultList();
> System.out.println(results.size());
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> if (results.isEmpty()) { <- NPE thrown here
> throw new UserNotFoundException("No user found");
> }
> Also the "mappingTool validate" seems to work fine. Of course how
> would I know
> since I can find no description of what a good one looks like but
> reading it (no
> exceptions) seem to make sense.
>
> Any help would be much appreciated.
>
> Phill
>
RE: How to debug object retrieveal in JPA?
Posted by Patrick Linskey <pl...@bea.com>.
Could you post the full NPE? Is results null, or is the NPE coming from
within OpenJPA somewhere? OpenJPA shouldn't be returning a null
collection in any situation, I don't think.
One way to fish for causes of suspicious problems is to set the default
log level to TRACE:
<property name="openjpa.Log" value="DefaultLevel=TRACE"/>
This will generate tons of output, but the stuff towards the end might
provide something of value.
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -----Original Message-----
> From: Phill Moran [mailto:pjmoran@rogers.com]
> Sent: Thursday, April 26, 2007 12:39 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: How to debug object retrieveal in JPA?
>
> Community,
>
> How does one go about debugging object retrieval/creation. I
> continue to have exceptions and little to go on as far as the cause.
> The named JPQL is good since I know it generates a good sql
> (can trace code and see it) . I know the sql is good as I can
> copy/paste it into mysql query browser, execute and get the
> correct data back. The problem is that these lines result in an NPE.
>
> Query q =
> this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin");
> q.setParameter("storeName", storeName.toUpperCase());
> q.setParameter("loginName", loginName.toUpperCase());
> List<Person> results = null;
> try {
> results = (List<Person>) q.getResultList();
> System.out.println(results.size());
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> if (results.isEmpty()) { <- NPE thrown here
> throw new UserNotFoundException("No
> user found");
> }
> Also the "mappingTool validate" seems to work fine. Of course
> how would I know since I can find no description of what a
> good one looks like but reading it (no
> exceptions) seem to make sense.
>
> Any help would be much appreciated.
>
> Phill
>
>
Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.