2 Replies Latest reply on Jun 10, 2013 2:57 PM by peter müller

    Problem with arquillian-openejb-embedded-4 (duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin")

    peter müller Newbie

      Hi,

       

      i am new to qrquillian and i hope iam right in this forum.

       

      I would like to setup a test environment with arquillian using openejb, openjpa and hsqldb in maven.

       

       

      If i use the normal folder (src/main/java for the "normal" java classes, and src/test/main for my testcases)

      the following error occured if a run mvn test:

       

       

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

      Test set: PersistenceServiceTestCase

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

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.595 sec <<< FAILURE!

      PersistenceServiceTestCase  Time elapsed: 0 sec  <<< ERROR!

      org.jboss.arquillian.container.spi.client.container.DeploymentException: can't deploy 602f3287-b1f9-48a3-8d8f-125b3bc9c892.jar

          at org.apache.openejb.arquillian.openejb.OpenEJBDeployableContainer.deploy(OpenEJBDeployableContainer.java:184)

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

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

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

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

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

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

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

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

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

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

          at org.apache.openejb.arquillian.openejb.TestObserver.observes(TestObserver.java:55)

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

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

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

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

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

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

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

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

          at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

          at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

          at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

          at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

          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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)

          at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

      Caused by: org.apache.openejb.OpenEJBException: Creating application failed: D:\BachelorArbeit\workspace\test\602f3287-b1f9-48a3-8d8f-125b3bc9c892.jar: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"

          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:959)

          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:537)

          at org.apache.openejb.arquillian.openejb.OpenEJBDeployableContainer.deploy(OpenEJBDeployableContainer.java:170)

          ... 98 more

      Caused by: java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin"

          at java.lang.ClassLoader.defineClass1(Native Method)

          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

          at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

          at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

          at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

          at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:295)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:295)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

          at org.apache.openejb.cdi.OptimizedLoaderService.loadWebBeansPlugins(OptimizedLoaderService.java:87)

          at org.apache.openejb.cdi.OptimizedLoaderService.load(OptimizedLoaderService.java:57)

          at org.apache.openejb.cdi.OptimizedLoaderService.load(OptimizedLoaderService.java:51)

          at org.apache.webbeans.plugins.PluginLoader.startUp(PluginLoader.java:75)

          at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:159)

          at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:150)

          at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:44)

          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:807)

          ... 100 more

       

       

      But if i copy the normal java classes in src/test/main too and the src/main/java is empty, mvn test work with now problems.

       

      In my optionen it is a packaging problem, but i have no idea how can i fix it.

       

      Can anyone help me, or can give my an example how can i setup this environment correct ? I cant find a totuial that work/explain my configuration.

       

      I have attached the complete project, too.

       

      Here are my pom.xml:

       

       

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>test</groupId>
          <artifactId>test</artifactId>
          <version>0.0.1-SNAPSHOT</version>
      
          <properties>
              <arquillian.version>1.0.3.Final</arquillian.version>
          </properties>
          <repositories>
              <repository>
                  <id>maven2-repository.dev.java.net</id>
                  <name>Java.net Repository for Maven</name>
                  <url>http://download.java.net/maven/2</url>
              </repository>
          </repositories>
          <dependencyManagement>
              <dependencies>
      
      
      
                  <dependency>
      
                      <groupId>junit</groupId>
      
                      <artifactId>junit</artifactId>
      
                      <version>4.8.1</version>
      
                      <scope>test</scope>
      
                  </dependency>
      
      
      
      
      
                  <dependency>
                      <groupId>org.mockito</groupId>
                      <artifactId>mockito-all</artifactId>
                      <version>1.8.4</version>
                      <scope>test</scope>
                  </dependency>
                  <dependency>
                      <groupId>javax</groupId>
                      <artifactId>javaee-api</artifactId>
                      <version>6.0</version>
      
                  </dependency>
      
              </dependencies>
          </dependencyManagement>
      
      
      
          <build>
              <finalName>${project.artifactId}</finalName>
      
              <plugins>
      
      
      
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-surefire-plugin</artifactId>
                      <version>2.4</version>
                      <configuration>
                          <forkMode>once</forkMode>
                          <argLine>
                              -javaagent:"${basedir}/openejb-javaagent-4.5.2.jar"
                          </argLine>
                          <useSystemClassloader>true</useSystemClassloader>
                      </configuration>
                  </plugin>
      
      
      
                  <plugin>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <configuration>
                          <source>1.6</source>
                          <target>1.6</target>
                      </configuration>
                  </plugin>
                  <plugin>
                      <artifactId>maven-war-plugin</artifactId>
                      <configuration>
                          <failOnMissingWebXml>false</failOnMissingWebXml>
                      </configuration>
                  </plugin>
      
                  <plugin>
                      <groupId>org.jacoco</groupId>
                      <artifactId>jacoco-maven-plugin</artifactId>
                      <version>0.6.2.201302030002</version>
                      <configuration>
                          <destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
                          <datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
                      </configuration>
                      <executions>
                          <execution>
                              <id>jacoco-initialize</id>
                              <goals>
                                  <goal>prepare-agent</goal>
                              </goals>
                          </execution>
                          <execution>
                              <id>jacoco-site</id>
                              <phase>test</phase>
                              <goals>
                                  <goal>report</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
      
      
      
      
              </plugins>
          </build>
          <dependencies>
      
      
      
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
      
              </dependency>
      
      
              <dependency>
                  <groupId>org.apache.openjpa</groupId>
                  <artifactId>openjpa</artifactId>
                  <version>2.2.0</version>
      
              </dependency>
      
      
      
      
              <dependency>
                  <groupId>org.apache.openejb</groupId>
                  <artifactId>arquillian-openejb-embedded-4</artifactId>
                  <version>4.5.1</version>
                  <scope>provided</scope>
              </dependency>
      
      
      
      
      
      
      
      
              <dependency>
                  <groupId>javax</groupId>
                  <artifactId>javaee-api</artifactId>
                  <!-- <scope>provided</scope> -->
              </dependency>
              <dependency>
                  <groupId>org.mockito</groupId>
                  <artifactId>mockito-all</artifactId>
      
              </dependency>
      
          </dependencies>
      
      </project>
      

       

      In /src/main/jave i have two classes:

       

       

      import java.util.List;
      
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import javax.persistence.TypedQuery;
      import javax.persistence.criteria.CriteriaBuilder;
      import javax.persistence.criteria.CriteriaQuery;
      import javax.persistence.criteria.Root;
      
      @Stateless
      public class PersistenceServiceBean {
          @PersistenceContext
          private EntityManager em;
      
          public void seed() {
              em.persist(new Record("Sample record"));
          }
      
          public List<Record> selectAll() {
      
              CriteriaBuilder cb = em.getCriteriaBuilder();
      
              CriteriaQuery<Record> c = cb.createQuery(Record.class);
      
              Root<Record> p = c.from(Record.class);
      
              c.select(p);
      
              TypedQuery<Record> q = em.createQuery(c);
      
              List<Record> result = q.getResultList();
      
              if (result.size() > 0) {
                  System.out.println("mhh");
              } else {
                  System.out.println("waa");
              }
      
              return q.getResultList();
      
              // return em.createQuery("select r from Record r").getResultList();
          }
      }
      

       

       

      import javax.persistence.Entity;
      import javax.persistence.GeneratedValue;
      import javax.persistence.Id;
      
      @Entity
      public class Record {
      
          @Override
          public String toString() {
              return "Record [id=" + id + ", test=" + test + "]";
          }
      
          @Id
          @GeneratedValue
          private Integer id;
      
          public Integer getId() {
              return id;
          }
      
          public void setId(Integer id) {
              this.id = id;
          }
      
          public String getTest() {
              return test;
          }
      
          public Record() {
              // TODO Auto-generated constructor stub
          }
      
          public Record(String test) {
              super();
              setTest(test);
          }
      
          public void setTest(String test) {
              this.test = test;
          }
      
          private String test;
      
      }
      

       

      In src/main/ressources i have a empty META-INF directory, a emtpy beans.xml and a ejb.xml with <ejb/>.

       

      In src/test/java i have my testcases:

       

       

      import java.util.List;
      
      import javax.ejb.EJB;
      
      import junit.framework.Assert;
      
      import org.jboss.arquillian.container.test.api.Deployment;
      import org.jboss.arquillian.junit.Arquillian;
      import org.jboss.shrinkwrap.api.Archive;
      import org.jboss.shrinkwrap.api.ShrinkWrap;
      import org.jboss.shrinkwrap.api.spec.JavaArchive;
      import org.junit.After;
      import org.junit.Before;
      import org.junit.Test;
      import org.junit.runner.RunWith;
      
      @RunWith(Arquillian.class)
      public class PersistenceServiceTestCase {
          @Deployment
          public static Archive<?> createDeployment() {
      
              
      
              return ShrinkWrap
                      .create(JavaArchive.class)
                      .addClasses(Record.class, PersistenceServiceBean.class,
                              PersistenceServiceBean.class)
                      .addAsManifestResource("persistence.xml", "persistence.xml");
          }
      
          private static boolean initDB = true;
      
          @EJB
          PersistenceServiceBean service;
      
          @Before
          public void setup() {
              if (initDB) {
      
                  service.seed();
                  initDB = false;
              }
          }
      
          @After
          public void teardown() {
      
          }
      
          @Test
          public void queryShouldFindSeedRecord() {
      
              List<Record> results = service.selectAll();
      
              System.out.println(results.toString());
      
              Assert.assertEquals("Should have found one record", 1, results.size());
          }
      
          @Test
          public void queryShouldFindSeedRecord1() {
      
              List<Record> results = service.selectAll();
      
              System.out.println(results.toString());
      
              Assert.assertEquals("Should have found one record", 1, results.size());
          }
      
          @Test
          public void queryShouldFindSeedRecord2() {
      
              List<Record> results = service.selectAll();
      
              System.out.println(results.toString());
      
              Assert.assertEquals("Should have found one record", 1, results.size());
          }
      
          @Test
          public void queryShouldFindSeedRecord3() {
      
              List<Record> results = service.selectAll();
      
              System.out.println(results.toString());
      
              Assert.assertEquals("Should have found one record", 1, results.size());
          }
      }
      

       

      and finally in src/main/test my persistance.xml and my jndi.properties:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
            http://java.sun.com/xml/ns/persistence
            http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
         <persistence-unit name="test">
            <jta-data-source>testDatabase</jta-data-source>
            <properties>
                   <property name="openjpa.DynamicEnhancementAgent" value="true"/>
                   
               <!-- configures OpenJPA to generate the database schema automatically -->
               <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true,schemaAction='dropDB,add')"/>
               <!-- print SQL being executed -->
               <property name="openjpa.Log" value="DefaultLevel=WARN, SQL=TRACE"/>
            </properties>
         </persistence-unit>
      </persistence>
      

       

       

      java.naming.factory.initial=org.apache.openejb.client.LocalInitialContextFactory
      testDatabase=new://Resource?type=DataSource
      testDatabase.JdbcDriver=org.hsqldb.jdbcDriver
      #testDatabase.JdbcDriver=org.hsqldb.jdbc.pool.JDBCXADataSource
      testDatabase.JdbcUrl=jdbc:hsqldb:mem:testdb
      testDatabase.JtaManaged=true
      

       

       

      Thanks for any help.

       

      Regards,

       

      haunted

        • 1. Re: Problem with arquillian-openejb-embedded-4 (duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin")
          peter müller Newbie

          in the last days, i have try a lot of different things, but without any success.

           

          Ihave try to use the newest jar files from arquillian-openejb-embedded-4 and openejb-core (both version 4.5.2).

           

          After i had change this, i get the following error, but i have configured an javaagent and in the pom.xml to enhance the jar files. The enhancement in maven at the build time is at the moment no opinion for my, because i can't change this in the product envorinment.

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

          Test set: PersistenceServiceTestCase

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

          Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 4.1 sec <<< FAILURE!

          queryShouldFindSeedRecord(PersistenceServiceTestCase)  Time elapsed: 0.937 sec  <<< ERROR!

          javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:

              <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)

              at PersistenceServiceBean$LocalBeanProxy.seed(PersistenceServiceBean.java)

              at PersistenceServiceTestCase.setup(PersistenceServiceTestCase.java:37)

              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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)

              at org.jboss.arquillian.junit.Arquillian$StatementLifecycleExecutor.invoke(Arquillian.java:351)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.execute(ClientBeforeAfterLifecycleEventExecuter.java:99)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.on(ClientBeforeAfterLifecycleEventExecuter.java:72)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.apache.openejb.arquillian.openejb.TestObserver.observes(TestObserver.java:55)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

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

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

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

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

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

              at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

              at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

              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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)

              at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

          Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4662)

              at org.apache.openjpa.kernel.BrokerImpl.persistInternal(BrokerImpl.java:2626)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2571)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2554)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2458)

              at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1077)

              at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:716)

              at org.apache.openejb.persistence.JtaEntityManager.persist(JtaEntityManager.java:126)

              at PersistenceServiceBean.seed(PersistenceServiceBean.java:17)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)

              at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)

              at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)

              at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)

              at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)

              at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:239)

              at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:191)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:246)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:241)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:83)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:279)

              ... 86 more

           

          queryShouldFindSeedRecord1(PersistenceServiceTestCase)  Time elapsed: 0.015 sec  <<< ERROR!

          javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:

              <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)

              at PersistenceServiceBean$LocalBeanProxy.seed(PersistenceServiceBean.java)

              at PersistenceServiceTestCase.setup(PersistenceServiceTestCase.java:37)

              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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)

              at org.jboss.arquillian.junit.Arquillian$StatementLifecycleExecutor.invoke(Arquillian.java:351)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.execute(ClientBeforeAfterLifecycleEventExecuter.java:99)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.on(ClientBeforeAfterLifecycleEventExecuter.java:72)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.apache.openejb.arquillian.openejb.TestObserver.observes(TestObserver.java:55)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

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

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

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

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

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

              at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

              at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

              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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)

              at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

          Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4662)

              at org.apache.openjpa.kernel.BrokerImpl.persistInternal(BrokerImpl.java:2626)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2571)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2554)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2458)

              at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1077)

              at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:716)

              at org.apache.openejb.persistence.JtaEntityManager.persist(JtaEntityManager.java:126)

              at PersistenceServiceBean.seed(PersistenceServiceBean.java:17)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)

              at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)

              at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)

              at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)

              at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)

              at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:239)

              at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:191)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:246)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:241)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:83)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:279)

              ... 86 more

           

          queryShouldFindSeedRecord2(PersistenceServiceTestCase)  Time elapsed: 0.008 sec  <<< ERROR!

          javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:

              <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)

              at PersistenceServiceBean$LocalBeanProxy.seed(PersistenceServiceBean.java)

              at PersistenceServiceTestCase.setup(PersistenceServiceTestCase.java:37)

              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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)

              at org.jboss.arquillian.junit.Arquillian$StatementLifecycleExecutor.invoke(Arquillian.java:351)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.execute(ClientBeforeAfterLifecycleEventExecuter.java:99)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.on(ClientBeforeAfterLifecycleEventExecuter.java:72)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.apache.openejb.arquillian.openejb.TestObserver.observes(TestObserver.java:55)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

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

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

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

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

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

              at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

              at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

              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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)

              at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

          Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4662)

              at org.apache.openjpa.kernel.BrokerImpl.persistInternal(BrokerImpl.java:2626)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2571)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2554)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2458)

              at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1077)

              at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:716)

              at org.apache.openejb.persistence.JtaEntityManager.persist(JtaEntityManager.java:126)

              at PersistenceServiceBean.seed(PersistenceServiceBean.java:17)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)

              at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)

              at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)

              at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)

              at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)

              at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:239)

              at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:191)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:246)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:241)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:83)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:279)

              ... 86 more

           

          queryShouldFindSeedRecord3(PersistenceServiceTestCase)  Time elapsed: 0.008 sec  <<< ERROR!

          javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:

              <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)

              at PersistenceServiceBean$LocalBeanProxy.seed(PersistenceServiceBean.java)

              at PersistenceServiceTestCase.setup(PersistenceServiceTestCase.java:37)

              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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)

              at org.jboss.arquillian.junit.Arquillian$StatementLifecycleExecutor.invoke(Arquillian.java:351)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.execute(ClientBeforeAfterLifecycleEventExecuter.java:99)

              at org.jboss.arquillian.container.test.impl.execution.ClientBeforeAfterLifecycleEventExecuter.on(ClientBeforeAfterLifecycleEventExecuter.java:72)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.apache.openejb.arquillian.openejb.TestObserver.observes(TestObserver.java:55)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

              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.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

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

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

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

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

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

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

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

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

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

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

              at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

              at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

              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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)

              at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

          Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "Record [id=null, test=Sample record]" to PersistenceCapable failed.  Ensure that it has been enhanced.

          FailedObject: Record [id=null, test=Sample record]

              at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4662)

              at org.apache.openjpa.kernel.BrokerImpl.persistInternal(BrokerImpl.java:2626)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2571)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2554)

              at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2458)

              at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1077)

              at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:716)

              at org.apache.openejb.persistence.JtaEntityManager.persist(JtaEntityManager.java:126)

              at PersistenceServiceBean.seed(PersistenceServiceBean.java:17)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)

              at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)

              at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)

              at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)

              at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)

              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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)

              at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)

              at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)

              at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:239)

              at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:191)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:246)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:241)

              at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:83)

              at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:279)

              ... 86 more

          • 2. Re: Problem with arquillian-openejb-embedded-4 (duplicate class definition for name: "org/apache/openejb/cdi/CdiPlugin")
            peter müller Newbie

            after a lot of try and error, i found out that openejb seams not to support mappedsupper classes in jpa and need to define the entities in the persistence xml.

             

            but now i geht an user lack privilege exception if jpa try to read from openjpa sequenze table. have anyone an idea?