You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Hadrian Zbarcea <hz...@gmail.com> on 2011/09/15 03:34:36 UTC

Re: svn commit: r1170077 - in /camel/trunk: components/camel-jpa/pom.xml components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java parent/pom.xml platforms/karaf/features/src/main/resources/features.xml pom.xml

I believe this patch broke 4 tests in camel-jpa. See test results below:

Tests in error:
 
testSendTraceMessage(org.apache.camel.processor.interceptor.JpaTraceEventMessageTest): 
Could not open JPA EntityManager for transaction; nested exception is 
<openjpa-2.1.1-r422266:1148538 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: This configuration 
disallows runtime optimization, but the following listed types were not 
enhanced at build time or at class load time with a javaagent: "
 
testFileConsumerJpaIdempotent(org.apache.camel.processor.jpa.FileConsumerJpaIdempotentTest): 
Could not open JPA EntityManager for transaction; nested exception is 
<openjpa-2.1.1-r422266:1148538 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: This configuration 
disallows runtime optimization, but the following listed types were not 
enhanced at build time or at class load time with a javaagent: "
 
testDuplicateMessagesAreFilteredOut(org.apache.camel.processor.jpa.JpaIdempotentConsumerTest): 
Could not open JPA EntityManager for transaction; nested exception is 
<openjpa-2.1.1-r422266:1148538 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: This configuration 
disallows runtime optimization, but the following listed types were not 
enhanced at build time or at class load time with a javaagent: "
 
testFailedExchangesNotAdded(org.apache.camel.processor.jpa.JpaIdempotentConsumerTest): 
Could not open JPA EntityManager for transaction; nested exception is 
<openjpa-2.1.1-r422266:1148538 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: This configuration 
disallows runtime optimization, but the following listed types were not 
enhanced at build time or at class load time with a javaagent: "

Tests run: 42, Failures: 0, Errors: 4, Skipped: 0



Hadrian

On 09/13/2011 04:18 AM, davsclaus@apache.org wrote:
> Author: davsclaus
> Date: Tue Sep 13 08:18:08 2011
> New Revision: 1170077
>
> URL: http://svn.apache.org/viewvc?rev=1170077&view=rev
> Log:
> CAMEL-3742: Upgraded camel-jpa to JPA2 spec. Thanks to Ioannis for the patch.
>
> Modified:
>      camel/trunk/components/camel-jpa/pom.xml
>      camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>      camel/trunk/parent/pom.xml
>      camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>      camel/trunk/pom.xml
>
> Modified: camel/trunk/components/camel-jpa/pom.xml
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-jpa/pom.xml (original)
> +++ camel/trunk/components/camel-jpa/pom.xml Tue Sep 13 08:18:08 2011
> @@ -66,8 +66,8 @@
>         <artifactId>spring-orm</artifactId>
>       </dependency>
>       <dependency>
> -<groupId>org.apache.servicemix.specs</groupId>
> -<artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
> +<groupId>org.apache.geronimo.specs</groupId>
> +<artifactId>geronimo-jpa_2.0_spec</artifactId>
>         <scope>provided</scope>
>       </dependency>
>       <!-- testing -->
> @@ -103,50 +103,28 @@
>       </dependency>
>     </dependencies>
>
> -<build>
> -<plugins>
> -
> -<!-- lets enhance the classes for OpenJPA (shame it can't do it at runtime!) -->
> -<plugin>
> -<groupId>org.apache.maven.plugins</groupId>
> -<artifactId>maven-antrun-plugin</artifactId>
> -<executions>
> -<execution>
> -<phase>process-test-classes</phase>
> -<configuration>
> -<tasks>
> -<path id="cp">
> -<path refid="maven.test.classpath" />
> -<path refid="maven.compile.classpath" />
> -<path refid="maven.dependency.classpath" />
> -</path>
> -<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
> -<classpath refid="cp" />
> -</taskdef>
> -
> -<mkdir dir="${basedir}/target/jpa-test-classes" />
> -
> -<openjpac directory="${basedir}/target/jpa-test-classes">
> -<classpath refid="cp" />
> -<fileset dir="${basedir}/target/classes">
> -<include name="org/apache/camel/processor/**/MessageProcessed.class" />
> -<include name="org/apache/camel/processor/**/JpaTraceEventMessage.class" />
> -</fileset>
> -<config propertiesFile="${basedir}/src/test/resources/META-INF/persistence.xml" />
> -</openjpac>
> -
> -<copy overwrite="true" todir="${basedir}/target/test-classes">
> -<fileset dir="${basedir}/target/jpa-test-classes" />
> -</copy>
> -</tasks>
> -</configuration>
> -<goals>
> -<goal>run</goal>
> -</goals>
> -</execution>
> -</executions>
> -</plugin>
> -</plugins>
> -</build>
> -
> +<build>
> +<plugins>
> +<!-- lets enhance the classes for OpenJPA (shame it can't do it at runtime!) -->
> +<plugin>
> +<groupId>org.codehaus.mojo</groupId>
> +<artifactId>openjpa-maven-plugin</artifactId>
> +<version>1.2</version>
> +<configuration>
> +<includes>org/apache/camel/examples/*.class</includes>
> +<addDefaultConstructor>true</addDefaultConstructor>
> +<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
> +</configuration>
> +<executions>
> +<execution>
> +<id>enhancer</id>
> +<phase>process-test-classes</phase>
> +<goals>
> +<goal>test-enhance</goal>
> +</goals>
> +</execution>
> +</executions>
> +</plugin>
> +</plugins>
> +</build>
>   </project>
>
> Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?rev=1170077&r1=1170076&r2=1170077&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java (original)
> +++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java Tue Sep 13 08:18:08 2011
> @@ -273,6 +273,11 @@ public class JpaConsumer extends Schedul
>               if (LOG.isDebugEnabled()) {
>                   LOG.debug("Failed to achieve lock on entity: " + entity + ". Reason: " + e, e);
>               }
> +            //TODO: Find if possible an alternative way to handle results of netive queries.
> +            //Result of native queries are Arrays and cannot be locked by all JPA Providers.
> +            if (entity.getClass().isArray()) {
> +                return true;
> +            }
>               return false;
>           }
>       }
>
> Modified: camel/trunk/parent/pom.xml
> URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
> ==============================================================================
> --- camel/trunk/parent/pom.xml (original)
> +++ camel/trunk/parent/pom.xml Tue Sep 13 08:18:08 2011
> @@ -72,6 +72,7 @@
>       <geronimo-j2ee-management-spec-version>1.1</geronimo-j2ee-management-spec-version>
>       <geronimo-jms-spec-version>1.1.1</geronimo-jms-spec-version>
>       <geronimo-jpa-spec-version>1.1.1</geronimo-jpa-spec-version>
> +<geronimo-jpa2-spec-version>1.1</geronimo-jpa2-spec-version>
>       <geronimo-jsp-spec-version>1.0.1</geronimo-jsp-spec-version>
>       <geronimo-jta-spec-version>1.1.1</geronimo-jta-spec-version>
>       <geronimo-servlet-spec-version>1.1.1</geronimo-servlet-spec-version>
> @@ -1016,6 +1017,11 @@
>           <version>${geronimo-jpa-spec-version}</version>
>         </dependency>
>         <dependency>
> +<groupId>org.apache.geronimo.specs</groupId>
> +<artifactId>geronimo-jpa_2.0_spec</artifactId>
> +<version>${geronimo-jpa2-spec-version}</version>
> +</dependency>
> +<dependency>
>           <groupId>org.apache.servicemix.specs</groupId>
>           <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
>           <version>${servicemix-specs-version}</version>
>
> Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml
> URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
> ==============================================================================
> --- camel/trunk/platforms/karaf/features/src/main/resources/features.xml (original)
> +++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Tue Sep 13 08:18:08 2011
> @@ -371,7 +371,7 @@
>       <bundle>mvn:org.apache.camel/camel-josql/${pom.version}</bundle>
>     </feature>
>     <feature name='camel-jpa' version='${pom.version}' resolver='(obr)' start-level='50'>
> -<bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.java-persistence-api-1.1.1/${servicemix-specs-version}</bundle>
> +<bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
>       <feature version="[3,4)">spring-tx</feature>
>       <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/${geronimo-el-version}</bundle>
>       <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${geronimo-jta-spec-version}</bundle>
> @@ -383,7 +383,7 @@
>       <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/${ant-bundle-version}</bundle>
>       <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp-bundle-version}</bundle>
>       <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo-jms-spec-version}</bundle>
> -<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.openjpa/${openjpa-bundle-version}</bundle>
> +<bundle>mvn:org.apache.openjpa/openjpa/${openjpa-version}</bundle>	
>       <feature version="[3,4)">spring-orm</feature>
>       <feature version='${pom.version}'>camel-core</feature>
>       <bundle>mvn:org.apache.camel/camel-jpa/${pom.version}</bundle>
>
> Modified: camel/trunk/pom.xml
> URL: http://svn.apache.org/viewvc/camel/trunk/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
> ==============================================================================
> --- camel/trunk/pom.xml (original)
> +++ camel/trunk/pom.xml Tue Sep 13 08:18:08 2011
> @@ -49,7 +49,7 @@
>       <jaxb-api-version>2.1</jaxb-api-version>
>       <maven-bundle-version>2.3.5</maven-bundle-version>
>
> -<openjpa-version>1.2.2</openjpa-version>
> +<openjpa-version>2.1.1</openjpa-version>
>     </properties>
>
>     <mailingLists>
>
>

Re: svn commit: r1170077 - in /camel/trunk: components/camel-jpa/pom.xml components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java parent/pom.xml platforms/karaf/features/src/main/resources/features.xml pom.xml

Posted by Claus Ibsen <cl...@gmail.com>.
Okay I got it fixed now.

It passes on my win xp box now

[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ camel-jpa ---
[INFO] Installing
E:\workspace\camel\components\camel-jpa\target\camel-jpa-2.9-SNAPSHOT.jar
to e:\maven-repo\org\apache\
camel\camel-jpa\2.9-SNAPSHOT\camel-jpa-2.9-SNAPSHOT.jar
[INFO] Installing E:\workspace\camel\components\camel-jpa\pom.xml to
e:\maven-repo\org\apache\camel\camel-jpa\2.9-SNAPSH
OT\camel-jpa-2.9-SNAPSHOT.pom
[INFO]
[INFO] --- maven-bundle-plugin:2.3.5:install (default-install) @ camel-jpa ---
[INFO] Installing
org/apache/camel/camel-jpa/2.9-SNAPSHOT/camel-jpa-2.9-SNAPSHOT.jar
[INFO] Writing OBR metadata
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.047s
[INFO] Finished at: Thu Sep 15 10:44:17 CEST 2011
[INFO] Final Memory: 11M/30M
[INFO] ------------------------------------------------------------------------


-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: svn commit: r1170077 - in /camel/trunk: components/camel-jpa/pom.xml components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java parent/pom.xml platforms/karaf/features/src/main/resources/features.xml pom.xml

Posted by Claus Ibsen <cl...@gmail.com>.
It works on mac osx

[INFO]
[INFO] --- maven-bundle-plugin:2.3.5:install (default-install) @ camel-jpa ---
[INFO] Installing
org/apache/camel/camel-jpa/2.9-SNAPSHOT/camel-jpa-2.9-SNAPSHOT.jar
[INFO] Writing OBR metadata
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

But fails on WinXP as well

Tests run: 42, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:04.812s
[INFO] Finished at: Thu Sep 15 09:14:59 CEST 2011
[INFO] Final Memory: 10M/26M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.8:test (default-test)
on project camel-j
pa: There are test failures.
[ERROR]
[ERROR] Please refer to
E:\workspace\camel\components\camel-jpa\target\surefire-reports for
the individual test results.


I assume its the maven enhance plugin that has some issues. Could be
something related to tools.jar as its default on mac osx, but the
other OS's its not.



On Thu, Sep 15, 2011 at 3:34 AM, Hadrian Zbarcea <hz...@gmail.com> wrote:
> I believe this patch broke 4 tests in camel-jpa. See test results below:
>
> Tests in error:
>
> testSendTraceMessage(org.apache.camel.processor.interceptor.JpaTraceEventMessageTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> testFileConsumerJpaIdempotent(org.apache.camel.processor.jpa.FileConsumerJpaIdempotentTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> testDuplicateMessagesAreFilteredOut(org.apache.camel.processor.jpa.JpaIdempotentConsumerTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> testFailedExchangesNotAdded(org.apache.camel.processor.jpa.JpaIdempotentConsumerTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> Tests run: 42, Failures: 0, Errors: 4, Skipped: 0
>
>
>
> Hadrian
>
> On 09/13/2011 04:18 AM, davsclaus@apache.org wrote:
>>
>> Author: davsclaus
>> Date: Tue Sep 13 08:18:08 2011
>> New Revision: 1170077
>>
>> URL: http://svn.apache.org/viewvc?rev=1170077&view=rev
>> Log:
>> CAMEL-3742: Upgraded camel-jpa to JPA2 spec. Thanks to Ioannis for the
>> patch.
>>
>> Modified:
>>     camel/trunk/components/camel-jpa/pom.xml
>>
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>>     camel/trunk/parent/pom.xml
>>     camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>>     camel/trunk/pom.xml
>>
>> Modified: camel/trunk/components/camel-jpa/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>> --- camel/trunk/components/camel-jpa/pom.xml (original)
>> +++ camel/trunk/components/camel-jpa/pom.xml Tue Sep 13 08:18:08 2011
>> @@ -66,8 +66,8 @@
>>        <artifactId>spring-orm</artifactId>
>>      </dependency>
>>      <dependency>
>> -<groupId>org.apache.servicemix.specs</groupId>
>>
>> -<artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
>> +<groupId>org.apache.geronimo.specs</groupId>
>> +<artifactId>geronimo-jpa_2.0_spec</artifactId>
>>        <scope>provided</scope>
>>      </dependency>
>>      <!-- testing -->
>> @@ -103,50 +103,28 @@
>>      </dependency>
>>    </dependencies>
>>
>> -<build>
>> -<plugins>
>> -
>> -<!-- lets enhance the classes for OpenJPA (shame it can't do it at
>> runtime!) -->
>> -<plugin>
>> -<groupId>org.apache.maven.plugins</groupId>
>> -<artifactId>maven-antrun-plugin</artifactId>
>> -<executions>
>> -<execution>
>> -<phase>process-test-classes</phase>
>> -<configuration>
>> -<tasks>
>> -<path id="cp">
>> -<path refid="maven.test.classpath" />
>> -<path refid="maven.compile.classpath" />
>> -<path refid="maven.dependency.classpath" />
>> -</path>
>> -<taskdef name="openjpac"
>> classname="org.apache.openjpa.ant.PCEnhancerTask">
>> -<classpath refid="cp" />
>> -</taskdef>
>> -
>> -<mkdir dir="${basedir}/target/jpa-test-classes" />
>> -
>> -<openjpac directory="${basedir}/target/jpa-test-classes">
>> -<classpath refid="cp" />
>> -<fileset dir="${basedir}/target/classes">
>> -<include name="org/apache/camel/processor/**/MessageProcessed.class" />
>> -<include name="org/apache/camel/processor/**/JpaTraceEventMessage.class"
>> />
>> -</fileset>
>> -<config
>> propertiesFile="${basedir}/src/test/resources/META-INF/persistence.xml" />
>> -</openjpac>
>> -
>> -<copy overwrite="true" todir="${basedir}/target/test-classes">
>> -<fileset dir="${basedir}/target/jpa-test-classes" />
>> -</copy>
>> -</tasks>
>> -</configuration>
>> -<goals>
>> -<goal>run</goal>
>> -</goals>
>> -</execution>
>> -</executions>
>> -</plugin>
>> -</plugins>
>> -</build>
>> -
>> +<build>
>> +<plugins>
>> +<!-- lets enhance the classes for OpenJPA (shame it can't do it at
>> runtime!) -->
>> +<plugin>
>> +<groupId>org.codehaus.mojo</groupId>
>> +<artifactId>openjpa-maven-plugin</artifactId>
>> +<version>1.2</version>
>> +<configuration>
>> +<includes>org/apache/camel/examples/*.class</includes>
>> +<addDefaultConstructor>true</addDefaultConstructor>
>> +<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
>> +</configuration>
>> +<executions>
>> +<execution>
>> +<id>enhancer</id>
>> +<phase>process-test-classes</phase>
>> +<goals>
>> +<goal>test-enhance</goal>
>> +</goals>
>> +</execution>
>> +</executions>
>> +</plugin>
>> +</plugins>
>> +</build>
>>  </project>
>>
>> Modified:
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>> ---
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>> (original)
>> +++
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>> Tue Sep 13 08:18:08 2011
>> @@ -273,6 +273,11 @@ public class JpaConsumer extends Schedul
>>              if (LOG.isDebugEnabled()) {
>>                  LOG.debug("Failed to achieve lock on entity: " + entity +
>> ". Reason: " + e, e);
>>              }
>> +            //TODO: Find if possible an alternative way to handle results
>> of netive queries.
>> +            //Result of native queries are Arrays and cannot be locked by
>> all JPA Providers.
>> +            if (entity.getClass().isArray()) {
>> +                return true;
>> +            }
>>              return false;
>>          }
>>      }
>>
>> Modified: camel/trunk/parent/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>> --- camel/trunk/parent/pom.xml (original)
>> +++ camel/trunk/parent/pom.xml Tue Sep 13 08:18:08 2011
>> @@ -72,6 +72,7 @@
>>
>>  <geronimo-j2ee-management-spec-version>1.1</geronimo-j2ee-management-spec-version>
>>      <geronimo-jms-spec-version>1.1.1</geronimo-jms-spec-version>
>>      <geronimo-jpa-spec-version>1.1.1</geronimo-jpa-spec-version>
>> +<geronimo-jpa2-spec-version>1.1</geronimo-jpa2-spec-version>
>>      <geronimo-jsp-spec-version>1.0.1</geronimo-jsp-spec-version>
>>      <geronimo-jta-spec-version>1.1.1</geronimo-jta-spec-version>
>>      <geronimo-servlet-spec-version>1.1.1</geronimo-servlet-spec-version>
>> @@ -1016,6 +1017,11 @@
>>          <version>${geronimo-jpa-spec-version}</version>
>>        </dependency>
>>        <dependency>
>> +<groupId>org.apache.geronimo.specs</groupId>
>> +<artifactId>geronimo-jpa_2.0_spec</artifactId>
>> +<version>${geronimo-jpa2-spec-version}</version>
>> +</dependency>
>> +<dependency>
>>          <groupId>org.apache.servicemix.specs</groupId>
>>
>>  <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
>>          <version>${servicemix-specs-version}</version>
>>
>> Modified:
>> camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>> --- camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> (original)
>> +++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> Tue Sep 13 08:18:08 2011
>> @@ -371,7 +371,7 @@
>>      <bundle>mvn:org.apache.camel/camel-josql/${pom.version}</bundle>
>>    </feature>
>>    <feature name='camel-jpa' version='${pom.version}' resolver='(obr)'
>> start-level='50'>
>> -<bundle
>> dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.java-persistence-api-1.1.1/${servicemix-specs-version}</bundle>
>> +<bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
>>      <feature version="[3,4)">spring-tx</feature>
>>      <bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/${geronimo-el-version}</bundle>
>>      <bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${geronimo-jta-spec-version}</bundle>
>> @@ -383,7 +383,7 @@
>>      <bundle
>> dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/${ant-bundle-version}</bundle>
>>      <bundle
>> dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp-bundle-version}</bundle>
>>      <bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo-jms-spec-version}</bundle>
>>
>> -<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.openjpa/${openjpa-bundle-version}</bundle>
>> +<bundle>mvn:org.apache.openjpa/openjpa/${openjpa-version}</bundle>
>>      <feature version="[3,4)">spring-orm</feature>
>>      <feature version='${pom.version}'>camel-core</feature>
>>      <bundle>mvn:org.apache.camel/camel-jpa/${pom.version}</bundle>
>>
>> Modified: camel/trunk/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>> --- camel/trunk/pom.xml (original)
>> +++ camel/trunk/pom.xml Tue Sep 13 08:18:08 2011
>> @@ -49,7 +49,7 @@
>>      <jaxb-api-version>2.1</jaxb-api-version>
>>      <maven-bundle-version>2.3.5</maven-bundle-version>
>>
>> -<openjpa-version>1.2.2</openjpa-version>
>> +<openjpa-version>2.1.1</openjpa-version>
>>    </properties>
>>
>>    <mailingLists>
>>
>>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: svn commit: r1170077 - in /camel/trunk: components/camel-jpa/pom.xml components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java parent/pom.xml platforms/karaf/features/src/main/resources/features.xml pom.xml

Posted by Hadrian Zbarcea <hz...@gmail.com>.
https://builds.apache.org/job/Camel.trunk.fulltest/460/org.apache.camel$camel-jpa/testReport/



On 09/14/2011 09:34 PM, Hadrian Zbarcea wrote:
> I believe this patch broke 4 tests in camel-jpa. See test results below:
>
> Tests in error:
>
> testSendTraceMessage(org.apache.camel.processor.interceptor.JpaTraceEventMessageTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> testFileConsumerJpaIdempotent(org.apache.camel.processor.jpa.FileConsumerJpaIdempotentTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> testDuplicateMessagesAreFilteredOut(org.apache.camel.processor.jpa.JpaIdempotentConsumerTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> testFailedExchangesNotAdded(org.apache.camel.processor.jpa.JpaIdempotentConsumerTest):
> Could not open JPA EntityManager for transaction; nested exception is
> <openjpa-2.1.1-r422266:1148538 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
>
> Tests run: 42, Failures: 0, Errors: 4, Skipped: 0
>
>
>
> Hadrian
>
> On 09/13/2011 04:18 AM, davsclaus@apache.org wrote:
>> Author: davsclaus
>> Date: Tue Sep 13 08:18:08 2011
>> New Revision: 1170077
>>
>> URL: http://svn.apache.org/viewvc?rev=1170077&view=rev
>> Log:
>> CAMEL-3742: Upgraded camel-jpa to JPA2 spec. Thanks to Ioannis for the
>> patch.
>>
>> Modified:
>> camel/trunk/components/camel-jpa/pom.xml
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>>
>> camel/trunk/parent/pom.xml
>> camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> camel/trunk/pom.xml
>>
>> Modified: camel/trunk/components/camel-jpa/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>>
>> --- camel/trunk/components/camel-jpa/pom.xml (original)
>> +++ camel/trunk/components/camel-jpa/pom.xml Tue Sep 13 08:18:08 2011
>> @@ -66,8 +66,8 @@
>> <artifactId>spring-orm</artifactId>
>> </dependency>
>> <dependency>
>> -<groupId>org.apache.servicemix.specs</groupId>
>> -<artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
>>
>> +<groupId>org.apache.geronimo.specs</groupId>
>> +<artifactId>geronimo-jpa_2.0_spec</artifactId>
>> <scope>provided</scope>
>> </dependency>
>> <!-- testing -->
>> @@ -103,50 +103,28 @@
>> </dependency>
>> </dependencies>
>>
>> -<build>
>> -<plugins>
>> -
>> -<!-- lets enhance the classes for OpenJPA (shame it can't do it at
>> runtime!) -->
>> -<plugin>
>> -<groupId>org.apache.maven.plugins</groupId>
>> -<artifactId>maven-antrun-plugin</artifactId>
>> -<executions>
>> -<execution>
>> -<phase>process-test-classes</phase>
>> -<configuration>
>> -<tasks>
>> -<path id="cp">
>> -<path refid="maven.test.classpath" />
>> -<path refid="maven.compile.classpath" />
>> -<path refid="maven.dependency.classpath" />
>> -</path>
>> -<taskdef name="openjpac"
>> classname="org.apache.openjpa.ant.PCEnhancerTask">
>> -<classpath refid="cp" />
>> -</taskdef>
>> -
>> -<mkdir dir="${basedir}/target/jpa-test-classes" />
>> -
>> -<openjpac directory="${basedir}/target/jpa-test-classes">
>> -<classpath refid="cp" />
>> -<fileset dir="${basedir}/target/classes">
>> -<include name="org/apache/camel/processor/**/MessageProcessed.class" />
>> -<include
>> name="org/apache/camel/processor/**/JpaTraceEventMessage.class" />
>> -</fileset>
>> -<config
>> propertiesFile="${basedir}/src/test/resources/META-INF/persistence.xml" />
>>
>> -</openjpac>
>> -
>> -<copy overwrite="true" todir="${basedir}/target/test-classes">
>> -<fileset dir="${basedir}/target/jpa-test-classes" />
>> -</copy>
>> -</tasks>
>> -</configuration>
>> -<goals>
>> -<goal>run</goal>
>> -</goals>
>> -</execution>
>> -</executions>
>> -</plugin>
>> -</plugins>
>> -</build>
>> -
>> +<build>
>> +<plugins>
>> +<!-- lets enhance the classes for OpenJPA (shame it can't do it at
>> runtime!) -->
>> +<plugin>
>> +<groupId>org.codehaus.mojo</groupId>
>> +<artifactId>openjpa-maven-plugin</artifactId>
>> +<version>1.2</version>
>> +<configuration>
>> +<includes>org/apache/camel/examples/*.class</includes>
>> +<addDefaultConstructor>true</addDefaultConstructor>
>> +<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
>> +</configuration>
>> +<executions>
>> +<execution>
>> +<id>enhancer</id>
>> +<phase>process-test-classes</phase>
>> +<goals>
>> +<goal>test-enhance</goal>
>> +</goals>
>> +</execution>
>> +</executions>
>> +</plugin>
>> +</plugins>
>> +</build>
>> </project>
>>
>> Modified:
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>>
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>>
>> ---
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>> (original)
>> +++
>> camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
>> Tue Sep 13 08:18:08 2011
>> @@ -273,6 +273,11 @@ public class JpaConsumer extends Schedul
>> if (LOG.isDebugEnabled()) {
>> LOG.debug("Failed to achieve lock on entity: " + entity + ". Reason: "
>> + e, e);
>> }
>> + //TODO: Find if possible an alternative way to handle results of
>> netive queries.
>> + //Result of native queries are Arrays and cannot be locked by all
>> JPA Providers.
>> + if (entity.getClass().isArray()) {
>> + return true;
>> + }
>> return false;
>> }
>> }
>>
>> Modified: camel/trunk/parent/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>>
>> --- camel/trunk/parent/pom.xml (original)
>> +++ camel/trunk/parent/pom.xml Tue Sep 13 08:18:08 2011
>> @@ -72,6 +72,7 @@
>> <geronimo-j2ee-management-spec-version>1.1</geronimo-j2ee-management-spec-version>
>>
>> <geronimo-jms-spec-version>1.1.1</geronimo-jms-spec-version>
>> <geronimo-jpa-spec-version>1.1.1</geronimo-jpa-spec-version>
>> +<geronimo-jpa2-spec-version>1.1</geronimo-jpa2-spec-version>
>> <geronimo-jsp-spec-version>1.0.1</geronimo-jsp-spec-version>
>> <geronimo-jta-spec-version>1.1.1</geronimo-jta-spec-version>
>> <geronimo-servlet-spec-version>1.1.1</geronimo-servlet-spec-version>
>> @@ -1016,6 +1017,11 @@
>> <version>${geronimo-jpa-spec-version}</version>
>> </dependency>
>> <dependency>
>> +<groupId>org.apache.geronimo.specs</groupId>
>> +<artifactId>geronimo-jpa_2.0_spec</artifactId>
>> +<version>${geronimo-jpa2-spec-version}</version>
>> +</dependency>
>> +<dependency>
>> <groupId>org.apache.servicemix.specs</groupId>
>> <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
>>
>> <version>${servicemix-specs-version}</version>
>>
>> Modified:
>> camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>>
>> ---
>> camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> (original)
>> +++
>> camel/trunk/platforms/karaf/features/src/main/resources/features.xml
>> Tue Sep 13 08:18:08 2011
>> @@ -371,7 +371,7 @@
>> <bundle>mvn:org.apache.camel/camel-josql/${pom.version}</bundle>
>> </feature>
>> <feature name='camel-jpa' version='${pom.version}' resolver='(obr)'
>> start-level='50'>
>> -<bundle
>> dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.java-persistence-api-1.1.1/${servicemix-specs-version}</bundle>
>>
>> +<bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
>>
>> <feature version="[3,4)">spring-tx</feature>
>> <bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/${geronimo-el-version}</bundle>
>>
>> <bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${geronimo-jta-spec-version}</bundle>
>>
>> @@ -383,7 +383,7 @@
>> <bundle
>> dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/${ant-bundle-version}</bundle>
>>
>> <bundle
>> dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp-bundle-version}</bundle>
>>
>> <bundle
>> dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo-jms-spec-version}</bundle>
>>
>> -<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.openjpa/${openjpa-bundle-version}</bundle>
>>
>> +<bundle>mvn:org.apache.openjpa/openjpa/${openjpa-version}</bundle>
>> <feature version="[3,4)">spring-orm</feature>
>> <feature version='${pom.version}'>camel-core</feature>
>> <bundle>mvn:org.apache.camel/camel-jpa/${pom.version}</bundle>
>>
>> Modified: camel/trunk/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/camel/trunk/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
>>
>> ==============================================================================
>>
>> --- camel/trunk/pom.xml (original)
>> +++ camel/trunk/pom.xml Tue Sep 13 08:18:08 2011
>> @@ -49,7 +49,7 @@
>> <jaxb-api-version>2.1</jaxb-api-version>
>> <maven-bundle-version>2.3.5</maven-bundle-version>
>>
>> -<openjpa-version>1.2.2</openjpa-version>
>> +<openjpa-version>2.1.1</openjpa-version>
>> </properties>
>>
>> <mailingLists>
>>
>>