Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 92108 invoked from network); 23 Oct 2009 15:41:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Oct 2009 15:41:28 -0000 Received: (qmail 91178 invoked by uid 500); 23 Oct 2009 15:41:27 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 91153 invoked by uid 500); 23 Oct 2009 15:41:27 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 91144 invoked by uid 99); 23 Oct 2009 15:41:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Oct 2009 15:41:27 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.210.186] (HELO mail-yx0-f186.google.com) (209.85.210.186) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Oct 2009 15:41:24 +0000 Received: by yxe16 with SMTP id 16so8606762yxe.27 for ; Fri, 23 Oct 2009 08:41:03 -0700 (PDT) MIME-Version: 1.0 Sender: quintin@skywalk.co.za Received: by 10.101.57.14 with SMTP id j14mr1902782ank.105.1256312462238; Fri, 23 Oct 2009 08:41:02 -0700 (PDT) In-Reply-To: <1f3854d50910230625w79e2ad35xedd3fc1dc0525689@mail.gmail.com> References: <1f3854d50910230625w79e2ad35xedd3fc1dc0525689@mail.gmail.com> From: Quintin Beukes Date: Fri, 23 Oct 2009 17:40:42 +0200 X-Google-Sender-Auth: 8dee39c16dd86207 Message-ID: <1f3854d50910230840y20c4c22fmd7fcd3c822f14dbb@mail.gmail.com> Subject: Re: Persistence unit annotation having no effect To: Geronimo Users List , OpenEJB Users List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I think I might have why it works in OpenEJB and not in Geronimo. It seems Geronimo has OpenJPA do the management, where OpenEJB does it themselves. Is there a way I can pass this responsibility over to OpenEJB instead? Quintin Beukes On Fri, Oct 23, 2009 at 3:25 PM, Quintin Beukes wrote= : > Hey, > > When doing unit tests, this work fine. But as soon as I deploy the app > to Geronimo, it fails. > > I have 2 jars A and B. B depends on A, and both have entities classes. > Some of the entities in B reference (foreign keys) entities in A. So > to get this working I add the classes in in A I'm referencing to B's > persistence unit. > > When I unit test, this works perfectly. But as soon as I deploy it, I > get the following: > 2009-10-23 15:18:26,400 INFO =C2=A0[config] Configuring enterprise > application: net.kunye/VDS-lamps-ejb/3.0/jar > 2009-10-23 15:18:26,807 INFO =C2=A0[OpenEJB] Auto-deploying ejb LampBean: > EjbDeployment(deployment-id=3DVDS-lamps-ejb/LampBean) > 2009-10-23 15:18:26,808 INFO =C2=A0[config] Enterprise application > "net.kunye/VDS-lamps-ejb/3.0/jar" loaded. > 2009-10-23 15:18:28,719 INFO =C2=A0[Ejb3Configuration] Processing > PersistenceUnitInfo [ > =C2=A0 =C2=A0 =C2=A0 =C2=A0name: VDS-lamps-PU > =C2=A0 =C2=A0 =C2=A0 =C2=A0...] > 2009-10-23 15:18:28,961 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.vds.lamps.LampAssignment > 2009-10-23 15:18:28,962 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.vds.lamps.LampAssignment on table LampAssignment > 2009-10-23 15:18:29,004 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.vds.lamps.Lamp > 2009-10-23 15:18:29,004 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.vds.lamps.Lamp on table Lamp > 2009-10-23 15:18:29,017 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.vds.lamps.LampFault > 2009-10-23 15:18:29,017 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.vds.lamps.LampFault on table LampFault > 2009-10-23 15:18:29,018 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.vds.lamps.LampTest > 2009-10-23 15:18:29,019 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.vds.lamps.LampTest on table LampTest > 2009-10-23 15:18:29,033 ERROR [GBeanInstanceState] Error while > starting; GBean is now in the FAILED state: > abstractName=3D"net.kunye/VDS-lamps-ejb/3.0/jar?EJBModule=3Dnet.kunye/VDS= -lamps-ejb/3.0/jar,J2EEApplication=3Dnull,PersistenceUnitModule=3Dejb.jar,j= 2eeType=3DPersistenceUnit,name=3DVDS-lamps-PU" > org.hibernate.AnnotationException: @OneToOne or @ManyToOne on > net.kunye.vds.lamps.LampAssignment.employee references an unknown > entity: net.kunye.personnel.Employee > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.cfg.ToOneFkSecondPass.doSecon= dPass(ToOneFkSecondPass.java:81) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.cfg.AnnotationConfiguration.p= rocessEndOfQueue(AnnotationConfiguration.java:456) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.cfg.AnnotationConfiguration.p= rocessFkSecondPassInOrder(AnnotationConfiguration.java:438) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.cfg.AnnotationConfiguration.s= econdPassCompile(AnnotationConfiguration.java:309) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.cfg.Configuration.buildMappin= gs(Configuration.java:1162) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.ejb.Ejb3Configuration.buildMa= ppings(Ejb3Configuration.java:1226) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.ejb.EventListenerConfigurator= .configure(EventListenerConfigurator.java:173) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.ejb.Ejb3Configuration.configu= re(Ejb3Configuration.java:854) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.ejb.Ejb3Configuration.configu= re(Ejb3Configuration.java:425) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.hibernate.ejb.HibernatePersistence.crea= teContainerEntityManagerFactory(HibernatePersistence.java:131) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.persistence.Persistence= UnitGBean.(PersistenceUnitGBean.java:127) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.NativeConstructorAccessorImpl.n= ewInstance0(Native Method) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.NativeConstructorAccessorImpl.n= ewInstance(NativeConstructorAccessorImpl.java:39) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.DelegatingConstructorAccessorIm= pl.newInstance(DelegatingConstructorAccessorImpl.java:27) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.reflect.Constructor.newInstance(C= onstructor.java:513) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.xbean.recipe.ReflectionUtil$Cons= tructorFactory.create(ReflectionUtil.java:952) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.xbean.recipe.ObjectRecipe.intern= alCreate(ObjectRecipe.java:276) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.xbean.recipe.AbstractRecipe.crea= te(AbstractRecipe.java:96) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.xbean.recipe.AbstractRecipe.crea= te(AbstractRecipe.java:61) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= ance.createInstance(GBeanInstance.java:910) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= anceState.attemptFullStart(GBeanInstanceState.java:269) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= anceState.start(GBeanInstanceState.java:103) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= anceState.startRecursive(GBeanInstanceState.java:125) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= ance.startRecursive(GBeanInstance.java:538) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.basic.BasicKerne= l.startRecursiveGBean(BasicKernel.java:377) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.config.Configura= tionUtil.startConfigurationGBeans(ConfigurationUtil.java:456) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.config.KernelCon= figurationManager.start(KernelConfigurationManager.java:190) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.config.SimpleCon= figurationManager.startConfiguration(SimpleConfigurationManager.java:546) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.config.SimpleCon= figurationManager.startConfiguration(SimpleConfigurationManager.java:527) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.NativeMethodAccessorImpl.invoke= 0(Native Method) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.NativeMethodAccessorImpl.invoke= (NativeMethodAccessorImpl.java:39) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.DelegatingMethodAccessorImpl.in= voke(DelegatingMethodAccessorImpl.java:25) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.reflect.Method.invoke(Method.java= :597) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.Reflectio= nMethodInvoker.invoke(ReflectionMethodInvoker.java:34) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanOper= ation.invoke(GBeanOperation.java:130) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= ance.invoke(GBeanInstance.java:850) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.basic.BasicKerne= l.invoke(BasicKernel.java:237) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.KernelGBean.invo= ke(KernelGBean.java:342) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.GeneratedMethodAccessor134.invo= ke(Unknown Source) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.DelegatingMethodAccessorImpl.in= voke(DelegatingMethodAccessorImpl.java:25) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.reflect.Method.invoke(Method.java= :597) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.Reflectio= nMethodInvoker.invoke(ReflectionMethodInvoker.java:34) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanOper= ation.invoke(GBeanOperation.java:130) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.gbean.runtime.GBeanInst= ance.invoke(GBeanInstance.java:850) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.kernel.basic.BasicKerne= l.invoke(BasicKernel.java:237) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.geronimo.system.jmx.MBeanGBeanBr= idge.invoke(MBeanGBeanBridge.java:172) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at com.sun.jmx.interceptor.DefaultMBeanServerI= nterceptor.invoke(DefaultMBeanServerInterceptor.java:836) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at com.sun.jmx.mbeanserver.JmxMBeanServer.invo= ke(JmxMBeanServer.java:761) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at javax.management.remote.rmi.RMIConnectionIm= pl.doOperation(RMIConnectionImpl.java:1426) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at javax.management.remote.rmi.RMIConnectionIm= pl.access$200(RMIConnectionImpl.java:72) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at javax.management.remote.rmi.RMIConnectionIm= pl$PrivilegedOperation.run(RMIConnectionImpl.java:1264) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.security.AccessController.doPrivileged= (Native Method) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at javax.management.remote.rmi.RMIConnectionIm= pl.doPrivilegedOperation(RMIConnectionImpl.java:1366) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at javax.management.remote.rmi.RMIConnectionIm= pl.invoke(RMIConnectionImpl.java:788) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.GeneratedMethodAccessor175.invo= ke(Unknown Source) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.reflect.DelegatingMethodAccessorImpl.in= voke(DelegatingMethodAccessorImpl.java:25) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.reflect.Method.invoke(Method.java= :597) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.rmi.server.UnicastServerRef.dispatch(Un= icastServerRef.java:305) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.rmi.transport.Transport$1.run(Transport= .java:159) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.security.AccessController.doPrivileged= (Native Method) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.rmi.transport.Transport.serviceCall(Tra= nsport.java:155) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.rmi.transport.tcp.TCPTransport.handleMe= ssages(TCPTransport.java:535) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.rmi.transport.tcp.TCPTransport$Connecti= onHandler.run0(TCPTransport.java:790) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.rmi.transport.tcp.TCPTransport$Connecti= onHandler.run(TCPTransport.java:649) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wor= ker.runTask(ThreadPoolExecutor.java:886) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wor= ker.run(ThreadPoolExecutor.java:908) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.Thread.run(Thread.java:619) > 2009-10-23 15:18:29,036 INFO =C2=A0[startup] Assembling app: > /opt/kms/server/geronimo-2.2-20091022/var/temp/geronimo-deployer149950668= 6456954036.tmpdir/VDS-lamps-ejb-3.0.jar > > The entity being referenced is in a module called KMS-Personnel-ejb. I > do have this module as a dependency. If it didn't find it, it should > would have told me so. Just a few moments before I deployed this one, > I have this in my log: > 2009-10-23 15:14:49,688 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.personnel.Employee > 2009-10-23 15:14:49,688 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.personnel.Employee on table Employee > 2009-10-23 15:14:49,690 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.personnel.Visitor > 2009-10-23 15:14:49,690 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.personnel.Visitor on table Visitor > 2009-10-23 15:14:49,773 INFO =C2=A0[AnnotationBinder] Binding entity from > annotated class: net.kunye.personnel.Company > 2009-10-23 15:14:49,774 INFO =C2=A0[EntityBinder] Bind entity > net.kunye.personnel.Company on table Company > > This is my deployment plan: This is my deployment plan for the above proj= ect. > =C2=A0 > =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0net.kunye > =C2=A0 =C2=A0 =C2=A0VDS-lamps-ejb > =C2=A0 =C2=A0 =C2=A03.0 > =C2=A0 =C2=A0 =C2=A0jar > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0net.kunye > =C2=A0 =C2=A0 =C2=A0 =C2=A0VDS-ejb > =C2=A0 =C2=A0 =C2=A0 =C2=A03.0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0jar > =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0net.kunye > =C2=A0 =C2=A0 =C2=A0 =C2=A0KMS-Personnel-ejb > =C2=A0 =C2=A0 =C2=A0 =C2=A01.0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0jar > =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 > =C2=A0 > > Can someone please advise how to get around this. It's an urgent problem. > > Quintin Beukes >