Hi Dimas,

SynchronizationType this is part of the Java EE 7.
I can see that you are using Java EE 6 API:
  <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0-6</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>


Try use: org.apache.tomee:javaee-api:7.0

On Wed, Aug 24, 2016 at 3:23 PM, dimas <dmitry_shu...@kaltire.com> wrote:

> Hi,
>
> I'm trying to use the Deltaspike test for some app that has persistence
> (hibernate), so here are my test dependencies:
>
> <hibernate.version>4.2.16.Final</hibernate.version>
> <deltaspike.version>1.6.1</deltaspike.version>
> <openejb-core.version>7.0.0</openejb-core.version>
> <camel.version>2.17.2</camel.version>
>
>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-core</artifactId>
>             <scope>compile</scope>
>             <version>${hibernate.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-entitymanager</artifactId>
>             <scope>compile</scope>
>             <version>${hibernate.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate.javax.persistence</groupId>
>             <artifactId>hibernate-jpa-2.0-api</artifactId>
>             <version>1.0.1.Final</version>
>             <scope>provided</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate.java-persistence</groupId>
>             <artifactId>jpa-api</artifactId>
>             <version>2.0-cr-1</version>
>             <scope>provided</scope>
>         </dependency>
>
>
> <dependency>
>             <groupId>org.apache.deltaspike.modules</groupId>
>             <artifactId>deltaspike-test-control-module-api</artifactId>
>             <version>${deltaspike.version}</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.deltaspike.modules</groupId>
>             <artifactId>deltaspike-test-control-module-impl</artifactId>
>             <version>${deltaspike.version}</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.deltaspike.cdictrl</groupId>
>             <artifactId>deltaspike-cdictrl-openejb</artifactId>
>             <version>${deltaspike.version}</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.tomee</groupId>
>             <artifactId>openejb-core</artifactId>
>             <version>${openejb-core.version}</version>
>             <type>test-jar</type>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.openejb</groupId>
>             <artifactId>javaee-api</artifactId>
>             <version>6.0-6</version>
>             <type>test-jar</type>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.camel</groupId>
>             <artifactId>camel-test-cdi</artifactId>
>             <scope>test</scope>
>             <version>${camel.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>4.11</version>
>             <scope>test</scope>
>         </dependency>
>
> While trying to run some simple test annotated with
> @RunWith(CdiTestRunner.class) it fails with exception:
>
> Caused by: java.lang.NoSuchMethodError:
> javax.persistence.PersistenceContext.synchronization()Ljavax/persistence/
> SynchronizationType;
>         at
> org.apache.openejb.config.PersistenceContextAnnFactory$
> DirectPersistenceContext.synchronization(PersistenceContextAnnFactory.
> java:118)
>         at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.
> buildPersistenceContext(AnnotationDeployer.java:4600)
>         at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.
> buildAnnotatedRefs(AnnotationDeployer.java:3985)
>         at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(
> AnnotationDeployer.java:2912)
>         at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(
> AnnotationDeployer.java:1951)
>         at
> org.apache.openejb.config.AnnotationDeployer.deploy(
> AnnotationDeployer.java:378)
>         at
> org.apache.openejb.config.ConfigurationFactory$Chain.
> deploy(ConfigurationFactory.java:417)
>         at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(
> ConfigurationFactory.java:1023)
>         at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(
> ConfigurationFactory.java:885)
>         at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(
> ConfigurationFactory.java:582)
>         at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(
> ConfigurationFactory.java:627)
>         at
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(
> Assembler.java:500)
>         at org.apache.openejb.assembler.classic.Assembler.build(
> Assembler.java:479)
>         at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
>         ... 31 more
>
> I have another app that doesn't have any persistence and all tests are
> working, so it looks like I'm missing something here, but not sure what
> exactly...
>
> Dmitry
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/java-lang-NoSuchMethodError-javax-persistence-
> PersistenceContext-synchronization-Ljavax-persistence--tp4679869.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>



-- 
Daniel Cunha
https://twitter.com/dvlc_
http://www.tomitribe.com
http://www.tomitribe.io

Reply via email to