Re: jpa provider

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Dec 07 2007 - 10:14:58 EST

  • Next message: Gilberto C Andrade: "Re: jpa provider"

    Gilberto,

    You'll need asm-3.0.jar and asm-commons-3.0.jar on the CLASSPATH:

    http://cayenne.apache.org/doc/jpa-installation.html

    I will doublecheck to ensure that the next milestone of 3.0 puts them
    in the lib.third-party.

    Andrus

    On Dec 7, 2007, at 3:53 PM, Gilberto C Andrade wrote:

    > Cayenne 3.0M2
    > gilbert..i-des05:~> java -version
    > java version "1.5.0_13"
    > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
    > Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode)
    > gilbert..i-des05:~> cat /etc/issue
    > Welcome to openSUSE 10.3 (i586) - Kernel \r (\l).
    >
    >
    >
    > I'm getting this error while creating my first test with cayenne-jpa:
    >
    > -------------------------------------------------------------------------------
    > Test set: com.gilbertoca.gfi.service.PessoaServiceTest
    > -------------------------------------------------------------------------------
    > Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.436
    > sec <<< FAILURE!
    > hello(com.gilbertoca.gfi.service.PessoaServiceTest) Time elapsed:
    > 0.372
    > sec <<< ERROR!
    > java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
    > at
    > org
    > .apache
    > .cayenne
    > .jpa.Provider.createContainerEntityManagerFactory(Provider.java:241)
    > 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)
    >
    > My test:
    > public class PessoaServiceTest {
    >
    > protected final Log log = LogFactory.getLog(getClass());
    > private EntityManagerFactory emf = null;
    > private EntityManager em = null;
    >
    > public PessoaServiceTest() { }
    >
    > ..efore
    > public void setUp() {
    > emf = Persistence.createEntityManagerFactory("gfi-corePU");
    > em = emf.createEntityManager();
    > }
    >
    > ..fter
    > public void tearDown() {
    > em.close();
    > emf.close();
    > }
    >
    > ..est
    > public void hello() {}
    > }
    >
    > My persistence file:
    > <?xml version="1.0" encoding="UTF-8"?>
    > <persistence version="1.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="gfi-corePU" transaction-
    > type="RESOURCE_LOCAL">
    > <provider>org.apache.cayenne.jpa.Provider</provider>
    > <class>com.gilbertoca.gfi.model.ger.TpDeficiencia</class>
    > <class>com.gilbertoca.gfi.model.ger.TpDependencia</class>
    > <class>com.gilbertoca.gfi.model.ger.TpGrauParentesco</class>
    > <class>com.gilbertoca.gfi.model.ger.TpMotivoFimDependencia</class>
    > <class>com.gilbertoca.gfi.model.ger.TpMotivoInicioDependencia</class>
    > <class>com.gilbertoca.gfi.model.ger.TpNacionalidade</class>
    > <class>com.gilbertoca.gfi.model.ger.TpRaca</class>
    > <class>com.gilbertoca.gfi.model.ger.TpReligiao</class>
    > <class>com.gilbertoca.gfi.model.ger.TpSanguineo</class>
    > <class>com.gilbertoca.gfi.model.ger.Escolaridade</class>
    > <class>com.gilbertoca.gfi.model.ger.EstadoCivil</class>
    > <class>com.gilbertoca.gfi.model.ger.Pessoa</class>
    > <class>com.gilbertoca.gfi.model.ger.Email</class>
    > <class>com.gilbertoca.gfi.model.ger.Telefone</class>
    > <class>com.gilbertoca.gfi.model.ger.PessoaDocumento</class>
    > <class>com.gilbertoca.gfi.model.ger.PessoaCaracteristica</
    > class>
    > <class>com.gilbertoca.gfi.model.ger.PessoaDependencia</class>
    >
    > <properties>
    > <property name="org.apache.cayenne.datasource.jdbc.driver"
    > value="org.apache.derby.jdbc.ClientDriver"/>
    > <property name="org.apache.cayenne.datasource.jdbc.url"
    > value="jdbc:derby://localhost/gfi_db;create=true"/>
    > <property
    > name="org.apache.cayenne.datasource.jdbc.username"
    > value="any"/>
    > <property
    > name="org.apache.cayenne.datasource.jdbc.password"
    > value="value"/>
    > </properties>
    > </persistence-unit>
    > </persistence>
    >
    > Did I miss something?
    >
    > Gilberto
    >



    This archive was generated by hypermail 2.0.0 : Fri Dec 07 2007 - 10:15:32 EST