2 Replies Latest reply on Feb 23, 2012 5:58 AM by Gerald Quintana

    Getting error testing with embedded GF 3.1 and weaved entities

    Noah White Newbie

      I am trying to run a simple test that persists an Entity which has a weaved property (FetchType.LAZY)  and it is failing. I am using Arquillian 1.0.0a5 and Glassfish Embedded 3.1 *(with Eclipselink 2.2.0v20110202-r8913).

       

      It looks like I am possibly suffering from the Arquillian infrastructure bootstrapping embedded GF with the test classes also being picked up in that classloader as well as the application classloader after deployment. If that's the case then it would seem to line up with this thread:

       

      http://www.java.net/forum/topic/glassfish/glassfish/embedded-glassfish-and-weaving

       

      Thoughts?

       

      For the sake of completness here are the gory details:

       

      INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)

      SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@d62d1b

      Sep 30, 2011 10:54:31 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA

      INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      Sep 30, 2011 10:54:31 AM org.eclipse.persistence.session.file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8547630037155614550tmp/applications/test/WEB-INF/lib/foo.jar_FOOJPA

      INFO: EclipseLink, version: Eclipse Persistence Services - 2.2.0.v20110202-r8913

      Sep 30, 2011 10:54:32 AM org.eclipse.persistence.session.file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8547630037155614550tmp/applications/test/WEB-INF/lib/foo.jar_FOOJPA

      SEVERE:

      Local Exception Stack:

      Exception [EclipseLink-0] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.IntegrityException

      Descriptor Exceptions:

      ---------------------------------------------------------

       

       

      Exception [EclipseLink-60] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DescriptorException

      Exception Description: The method [_persistence_set_zone_vh] or [_persistence_get_zone_vh] is not defined in the object [com.abc.foo.entity.BarEntity].

      Internal Exception: java.lang.NoSuchMethodException: com.abc.foo.entity.BarEntity._persistence_get_zone_vh()

      Mapping: org.eclipse.persistence.mappings.ManyToOneMapping[zone]

      Descriptor: RelationalDescriptor(com.abc.foo.entity.BarEntity --> [DatabaseTable(FOOADMIN.BAR)])

       

       

      Exception [EclipseLink-218] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DescriptorException

      Exception Description: A NullPointerException would have occurred accessing a non-existent weaved _vh_ method [_persistence_get_zone_vh].  The class was not weaved properly - for EE deployments, check the module order in the application.xml deployment descriptor and verify that the module containing the persistence unit is ahead of any other module that uses it.

       

       

      Runtime Exceptions:

      ---------------------------------------------------------

       

       

                at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:476)

                at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:407)

                at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:680)

                at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:641)

                at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:235)

                at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:394)

                at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:185)

                at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:242)

                at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:230)

                at org.glassfish.persistence.jpa.PersistenceUnitLoader.doJava2DB(PersistenceUnitLoader.java:373)

                at org.glassfish.persistence.jpa.JPADeployer$2.visitPUD(JPADeployer.java:434)

                at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)

                at org.glassfish.persistence.jpa.JPADeployer.iterateInitializedPUsAtApplicationPrepare(JPADeployer.java:464)

                at org.glassfish.persistence.jpa.JPADeployer.event(JPADeployer.java:388)

                at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)

                at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:452)

                at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)

                at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)

                at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)

                at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)

                at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)

                at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)

                at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)

                at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)

                at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.executeCommand(CommandExecutorImpl.java:118)

                at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:97)

                at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:88)

                at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.deploy(GlassFishContainer.java:164)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:141)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:226)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)

                at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:100)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)

                at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:78)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)

                at org.jboss.arquillian.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:51)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)

                at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:217)

                at org.jboss.arquillian.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:78)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)

                at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.impl.client.ContainerEventController.execute(ContainerEventController.java:69)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)

                at org.jboss.arquillian.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)

                at org.jboss.arquillian.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)

                at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:70)

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:170)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:303)

                at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45)

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:187)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127)

                at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

                at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)

                at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)

                at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)