You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Glebow, Philip" <Ph...@blackrock.com> on 2010/07/09 18:29:12 UTC

Camel 2.3.0 & Spring 3.0.3

I had some difficulty getting Camel 2.3.0 and Spring 3.0.3 to work
together when deploying as a WAR file built by Maven.  I've resolved the
problem and wanted to share the solution with the group:

*	When deploying as a WAR file under Tomcat, I received several
different error messages.  For example, the method getServletContext()
could not be found.
*	The cause was a different version of Spring on the classpath.
*	To resolve the problem, I edited my POM file to exclude the
Spring dependencies for camel-core and camel-jms.
*	I added the latest version of the excluded dependencies in my
POM

  This resolved the problem and I'm now able to deploy to Tomcat.  

Phil
===

Here is the snippet from my POM:

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jms</artifactId>
      <version>${camel.version}</version>
      <exclusions>
      	<exclusion>
      		<artifactId>spring-jms</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      	<exclusion>
      		<artifactId>spring-tx</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      	<exclusion>
      		<artifactId>spring-beans</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      	<exclusion>
      		<artifactId>spring-core</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      	<exclusion>
      		<artifactId>spring-context</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring</artifactId>
      <version>${camel.version}</version>
      <exclusions>
      	<exclusion>
      		<artifactId>spring-tx</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      	<exclusion>
      		<artifactId>spring-aop</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      	<exclusion>
      		<artifactId>spring-context</artifactId>
      		<groupId>org.springframework</groupId>
      	</exclusion>
      </exclusions>
    </dependency>
    <dependency>
    	<groupId>org.springframework</groupId>
    	<artifactId>spring-webmvc</artifactId>
    	<version>3.0.3.RELEASE</version>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.springframework</groupId>
    	<artifactId>spring-web</artifactId>
    	<version>3.0.3.RELEASE</version>
    	<type>pom</type>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.springframework</groupId>
    	<artifactId>spring-context-support</artifactId>
    	<version>3.0.3.RELEASE</version>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.springframework</groupId>
    	<artifactId>spring-tx</artifactId>
    	<version>3.0.3.RELEASE</version>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.springframework</groupId>
    	<artifactId>spring-jms</artifactId>
    	<version>3.0.3.RELEASE</version>
    	<scope>compile</scope>
    </dependency>

THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED.  If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BlackRock.  Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.


   

Re: Camel 2.3.0 & Spring 3.0.3

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Thanks for sharing this solution with us.
FYI, we just changed the spring default version to Spring 3.0.3 for the 
Camel 2.4.0-SNAPSHOT, please feel free to try it out.
In this way you don't need to write a bunch of <exclusions>.

Willem
----------------------------------
Apache Camel, Apache CXF committer
Open SOA http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang

Glebow, Philip wrote:
> I had some difficulty getting Camel 2.3.0 and Spring 3.0.3 to work
> together when deploying as a WAR file built by Maven.  I've resolved the
> problem and wanted to share the solution with the group:
> 
> *	When deploying as a WAR file under Tomcat, I received several
> different error messages.  For example, the method getServletContext()
> could not be found.
> *	The cause was a different version of Spring on the classpath.
> *	To resolve the problem, I edited my POM file to exclude the
> Spring dependencies for camel-core and camel-jms.
> *	I added the latest version of the excluded dependencies in my
> POM
> 
>   This resolved the problem and I'm now able to deploy to Tomcat.  
> 
> Phil
> ===
> 
> Here is the snippet from my POM:
> 
>     <dependency>
>       <groupId>org.apache.camel</groupId>
>       <artifactId>camel-jms</artifactId>
>       <version>${camel.version}</version>
>       <exclusions>
>       	<exclusion>
>       		<artifactId>spring-jms</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       	<exclusion>
>       		<artifactId>spring-tx</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       	<exclusion>
>       		<artifactId>spring-beans</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       	<exclusion>
>       		<artifactId>spring-core</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       	<exclusion>
>       		<artifactId>spring-context</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       </exclusions>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.camel</groupId>
>       <artifactId>camel-spring</artifactId>
>       <version>${camel.version}</version>
>       <exclusions>
>       	<exclusion>
>       		<artifactId>spring-tx</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       	<exclusion>
>       		<artifactId>spring-aop</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       	<exclusion>
>       		<artifactId>spring-context</artifactId>
>       		<groupId>org.springframework</groupId>
>       	</exclusion>
>       </exclusions>
>     </dependency>
>     <dependency>
>     	<groupId>org.springframework</groupId>
>     	<artifactId>spring-webmvc</artifactId>
>     	<version>3.0.3.RELEASE</version>
>     	<scope>compile</scope>
>     </dependency>
>     <dependency>
>     	<groupId>org.springframework</groupId>
>     	<artifactId>spring-web</artifactId>
>     	<version>3.0.3.RELEASE</version>
>     	<type>pom</type>
>     	<scope>compile</scope>
>     </dependency>
>     <dependency>
>     	<groupId>org.springframework</groupId>
>     	<artifactId>spring-context-support</artifactId>
>     	<version>3.0.3.RELEASE</version>
>     	<scope>compile</scope>
>     </dependency>
>     <dependency>
>     	<groupId>org.springframework</groupId>
>     	<artifactId>spring-tx</artifactId>
>     	<version>3.0.3.RELEASE</version>
>     	<scope>compile</scope>
>     </dependency>
>     <dependency>
>     	<groupId>org.springframework</groupId>
>     	<artifactId>spring-jms</artifactId>
>     	<version>3.0.3.RELEASE</version>
>     	<scope>compile</scope>
>     </dependency>
> 
> THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED.  If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BlackRock.  Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
> 
> 
>    
>