Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 39364 invoked from network); 19 Apr 2007 13:06:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Apr 2007 13:06:07 -0000 Received: (qmail 11959 invoked by uid 500); 19 Apr 2007 13:06:13 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 11934 invoked by uid 500); 19 Apr 2007 13:06:13 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 11925 invoked by uid 99); 19 Apr 2007 13:06:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 06:06:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [206.190.36.83] (HELO smtp105.rog.mail.re2.yahoo.com) (206.190.36.83) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 19 Apr 2007 06:06:06 -0700 Received: (qmail 45700 invoked from network); 19 Apr 2007 13:05:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-MimeOLE:In-Reply-To:Thread-Index; b=lK2nxWKnv5Vs2p0lomPk9UU6u+kLm5CeEwqCvQScoIXI8WauEn3d1iax+g4d46IGHuyBRkRY8WO8GScqOmXOoYx1xjAT/jeo8XzLh/IAQPDKu4QngP+Tk6L+0YkCjvxPY994cvczz6a/gYxC2eKMpTFQ7Y/Kqx8UhT6BGzfIH18= ; Received: from unknown (HELO tyan2400) (pjmoran@rogers.com@74.103.60.187 with login) by smtp105.rog.mail.re2.yahoo.com with SMTP; 19 Apr 2007 13:05:43 -0000 X-YMail-OSG: ce2hYq8VM1kHmS0XZeQ7kl9JmmE5mGC_BwXjYpO.Mwk7hQi47XLWC3sT7GaUlZkEXg-- From: "Phill Moran" To: , Subject: RE: Named query created in error Date: Thu, 19 Apr 2007 09:05:41 -0400 Message-ID: <031701c78283$6fa4dab0$6601a8c0@tyan2400> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 In-Reply-To: <1b5bfeb50704182317u485b1cfasfb57fa526c7a62ea@mail.gmail.com> Thread-Index: AceCSn2dYt0Y1ls7ReGoHpKZw/vwjAANu5Lw X-Virus-Checked: Checked by ClamAV on apache.org I am using MySQL version 5 The stack trace only shows because have wrapped this in a try/catch. The exception becomes NPE due to OpenJPA trying to make a Person object form more than just Person Object data, it fails to do this (silently) and the object it was to be assigned to become an NP I use annotations for this project so no ORM file Nothing in the persistence.xml except class names (all persistable classes represented in here) and OpenJPA settings. Interesting questions on why the duplicate query exception suddenly showing up, but a search on workspace tells me it is the only one with that name Store is annotated as well. In fact both Person and Store both have other named queries in them that are working. I also get other reports of dup queries and they work as well. Another thread (Patrick I believe) described the reason for these but not sure the impact of them Here is the whole trace-not sure why the whole thing did not show up before <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.EagerResultList.(EagerResultList.java:33) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1203) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:979) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:832) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:763) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:520) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:212) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:251) at ca.BidSpec.emall.user.PersonFactoryImpl.getLoginPersonValueObject(PersonFactoryI mpl.java:98) 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.(Locale.java:272) at java.util.Locale.(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) ... 69 more This is all I get -----Original Message----- From: eljotpl@gmail.com [mailto:eljotpl@gmail.com] On Behalf Of Jacek Laskowski Sent: April 19, 2007 2:18 AM To: open-jpa-dev@incubator.apache.org Subject: Re: Named query created in error On 4/19/07, Phill Moran wrote: > Here it is: > > [2007-04-18 18:37:07,937] INFO > ca.BidSpec.testing.emall.UserFactoryTest Began transaction (1): > transaction manager > [org.springframework.orm.jpa.JpaTransactionManager@749ebc]; default rollback = true > 25547 WARN [main] openjpa.MetaData - Found duplicate query > "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person". Ignoring. > 33360 TRACE [main] openjpa.jdbc.SQL - > executing prepstmnt 23861335 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, t5.id, t5.lastUpdated, > t5.created, t5.description, t5.displayName, t5.name, t6.id, > t6.lastUpdated, t6.description, t6.categoryTypeFK, t6.value, t0.title, > t0.visible FROM bidspec.person t0 INNER JOIN bidspec.manufacturer t1 > ON t0.manufacturerFK = t1.id LEFT OUTER JOIN bidspec.category t2 ON > t0.roleFK = t2.id LEFT OUTER JOIN bidspec.category t4 ON > t0.salutationFK = t4.id LEFT OUTER JOIN bidspec.manufacturer t5 ON > t0.manufacturerFK = t5.id LEFT OUTER JOIN bidspec.categorytype t3 ON > t2.categoryTypeFK = t3.id LEFT OUTER JOIN bidspec.category t6 ON > t5.typeFK = t6.id WHERE (UPPER(t1.name) = ? AND > UPPER(t0.loginName) = ?) ORDER BY t0.lastName ASC, t0.firstName ASC > [params=(String) BIDSPEC, (String) PMORAN] 33360 TRACE [main] > openjpa.jdbc.SQL - [0 ms] spent > <0|false|0.9.6-incubating> org.apache.openjpa.persistence.PersistenceException: > null > at > org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:851) What database do you use? Show the line where the query is created and the parameters are passed. How do the persistence.xml look like? Do you happen to use orm.xml-like files? What Spring version is used? Show the Person entity (ca.BidSpec.emall.user.Person). I wonder why you only get the following warning message 25547 WARN [main] openjpa.MetaData - Found duplicate query "PersonFXLastFirst" in "class ca.BidSpec.emall.user.Person". Ignoring. , but there's no corresponding warning message for the entity behind p.store (possibly .Store). Do you happen to *not* annotate the Store class with @Entity? Could you attach the whole TRACE output of OpenJPA execution? Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl