Bug 1043663 - ClassNotFoundExceptions when deploying idempotent consumer with JpaMessageIdRepository
Summary: ClassNotFoundExceptions when deploying idempotent consumer with JpaMessageIdR...
Keywords:
Status: MODIFIED
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DR1
: 6.1.0
Assignee: Tomohisa Igarashi
QA Contact: Matej Melko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-16 20:52 UTC by Daniel Tschan, Puzzle ITC
Modified: 2021-11-08 10:23 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If you attempt to run an Idempotent JPA consumer, ClassNotFoundExceptions will be raised for the Spring and Hibernate components. To work around this problem, you must make two changes, the first being to a Camel module within the server and the second to your application: Edit the JBOSS_HOME/modules/system/layers/soa/org/apache/camel/jpa/main/module.xml file to include the following module dependencies: <programlisting> <![CDATA[ <module name="org.hibernate"/> <module name="org.javassist"/> ]]> </programlisting> Secondly, modify your application so that it contains a APP/src/main/resources/META-INF/jboss-deployment-structure.xml file, (specifying a dependency on the Spring framework). <programlisting> <![CDATA[ <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"> <deployment> <dependencies> <module name="org.springframework"/> </dependencies> </deployment> </jboss-deployment-structure> ]]> </programlisting>
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SWITCHYARD-1912 0 Major Resolved camel-jpa missing dependency on hibernate & javassist 2014-08-29 22:48:18 UTC

Description Daniel Tschan, Puzzle ITC 2013-12-16 20:52:41 UTC
Description of problem:
When trying to deploying an idempotent consumer with a JpaMessageIdRepository to JBoss Fuse ServiceWorks multiple ClassNotFoundExceptions occur.

Version-Release number of selected component (if applicable):
JBoss Fuse ServiceWorks Beta (Build ER6)

How reproducible:
Always, see test case here: https://github.com/dtschan/switchyard-idempotent-jpa

Steps to Reproduce:
1. Set JBOSS_HOME to an installation of JBoss Fuse ServiceWorks Beta
1. "mvn package -DskipTest"
2. "mvn test" or run test in JBoss Developer Studio

Actual results:
Test fails because of multiple ClassNotFoundExceptions. Various Spring classes required by the Camel version used by JBoss FSW, like PlatformTransactionManager or JpaTemplate, cannot be found.
Additionally a ClassNotFoundException regarding HibernateProxy is thrown.

Expected results:
Test succeeds.

Additional info:
Workaround:
In the file "modules/system/layers/soa/org/apache/camel/jpa/main/module.xml"
replace the line
  <module name="org.springframework"/> 
with
  <module name="org.springframework" export="true"/> 
 
Now the test succeeds. However this is not a good solution, as now the whole spring stack is exported. Additionally the ClassNotFoundException regarding HibernateProxy is still thrown.

Comment 3 Tomohisa Igarashi 2013-12-18 04:28:51 UTC
Your application works with following 2 changes:

1) Add ${APP}/src/main/resources/META-INF/jboss-deployment-structure.xml:
----------
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">  
    <deployment>  
        <dependencies>  
            <module name="org.springframework"/>  
        </dependencies>  
    </deployment>
</jboss-deployment-structure>  
----------

2) Modify ${JBOSS_HOME}/modules/system/layers/soa/org/apache/camel/jpa/main/module.xml:
----------
@@ --- org.apache.camel.jpa-module.xml.orig	2013-12-18 13:14:36.338589593 +0900
+++ jboss-eap-6.1/modules/system/layers/soa/org/apache/camel/jpa/main/module.xml	2013-12-18 13:17:58.502034223 +0900 -23,6 +23,8
         <module name="org.apache.camel.core"/>
         <module name="org.apache.camel.spring"/>
         <module name="org.apache.commons.logging"/>
+        <module name="org.hibernate"/>
+        <module name="org.javassist"/>
         <module name="org.springframework"/>
         <module name="org.slf4j"/>
     </dependencies>
----------

Maybe we can add 2) by default in the FSW at some point.


Note You need to log in before you can comment on or make changes to this bug.