Re: jpa provider

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Dec 07 2007 - 16:00:24 EST

  • Next message: Jean-François Smigielski: "Ghost/Dupplicated persistent objects"

    maven-specific advice - configuration we are using from our own
    integration tests:

         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>

            <configuration>
                    <forkMode>once</forkMode>
                    <argLine>
                    -javaagent:${settings.localRepository}/org/apache/cayenne/cayenne-
    agent/${version}/cayenne-agent-${version}.jar
                    </argLine>
            </configuration>
         </plugin>

    On Dec 7, 2007, at 10:57 PM, Andrus Adamchik wrote:

    > You will need to start your code with an instrumentation agent:
    >
    > http://cayenne.apache.org/doc/jpa-agent.html
    >
    > Andrus
    >
    > On Dec 7, 2007, at 10:00 PM, Gilberto C Andrade wrote:
    >
    >> After put those dependences:
    >> <dependency>
    >> <groupId>asm</groupId>
    >> <artifactId>asm</artifactId>
    >> <version>3.0</version>
    >> </dependency>
    >> <dependency>
    >> <groupId>asm</groupId>
    >> <artifactId>asm-commons</artifactId>
    >> <version>3.0</version>
    >> </dependency>
    >>
    >> I'm getting:
    >>> -------------------------------------------------------------------------------
    >>> Test set: com.gilbertoca.gfi.service.PessoaServiceTest
    >>> -------------------------------------------------------------------------------
    >>> Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed:
    >>> 0.477 sec <<< FAILURE!
    >>> hello(com.gilbertoca.gfi.service.PessoaServiceTest) Time elapsed:
    >>> 0.413 sec <<< ERROR!
    >>> java.lang.IllegalStateException: Attempt to add a transformer
    >>> failed - instrumentation is not initialized.
    >>> at
    >>> org
    >>> .apache
    >>> .cayenne
    >>> .jpa
    >>> .instrument
    >>> .InstrumentingUnit.addTransformer(InstrumentingUnit.java:69)
    >>> at
    >>> org
    >>> .apache
    >>> .cayenne
    >>> .jpa.Provider.createContainerEntityManagerFactory(Provider.java:243)
    >>> at
    >>> org
    >>> .apache
    >>> .cayenne.jpa.Provider.createEntityManagerFactory(Provider.java:194)
    >>> at
    >>> javax
    >>> .persistence
    >>> .Persistence.createEntityManagerFactory(Persistence.java:83)
    >>> at
    >>> javax
    >>> .persistence
    >>> .Persistence.createEntityManagerFactory(Persistence.java:60)
    >>> at
    >>> com
    >>> .gilbertoca
    >>> .gfi.service.PessoaServiceTest.setUp(PessoaServiceTest.java:32)
    >>> 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:585)
    >>> at
    >>> org
    >>> .junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:
    >>> 122)
    >>> at
    >>> org
    >>> .junit
    >>> .internal
    >>> .runners
    >>> .MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
    >>> at
    >>> org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
    >>> 77)
    >>> at
    >>> org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
    >>> at
    >>> org
    >>> .junit
    >>> .internal
    >>> .runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:
    >>> 88)
    >>> at
    >>> org
    >>> .junit
    >>> .internal
    >>> .runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
    >>> at org.junit.internal.runners.JUnit4ClassRunner
    >>> $1.run(JUnit4ClassRunner.java:44)
    >>> at
    >>> org
    >>> .junit
    >>> .internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
    >>> at
    >>> org
    >>> .junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:
    >>> 37)
    >>> at
    >>> org
    >>> .junit
    >>> .internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    >>> at
    >>> org
    >>> .apache
    >>> .maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    >>> at
    >>> org
    >>> .apache
    >>> .maven
    >>> .surefire
    >>> .suite
    >>> .AbstractDirectoryTestSuite
    >>> .executeTestSet(AbstractDirectoryTestSuite.java:138)
    >>> at
    >>> org
    >>> .apache
    >>> .maven
    >>> .surefire
    >>> .suite
    >>> .AbstractDirectoryTestSuite
    >>> .execute(AbstractDirectoryTestSuite.java:125)
    >>> at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
    >>> 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:585)
    >>> at
    >>> org
    >>> .apache
    >>> .maven
    >>> .surefire
    >>> .booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
    >>> at
    >>> org
    >>> .apache
    >>> .maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Dec 07 2007 - 16:01:02 EST