You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bocamel <jo...@gmail.com> on 2014/04/20 20:26:56 UTC

camel-mail and camel-cxf incompatible?

I am having a problem with a camel project that uses both camel-mail and
camel-cxf.  If only camel-mail is used, it can successfully consume emails
from an IMAP endpoint.  But if camel-cxf maven dependency is included, even
if there is no cxfendpoint route defined in Camel Context, the IMAP consumer
would not consume emails if mapMailMessage is set to false.  If
mapMailMessage is set to true, the IMAP consumer does consume emails, but I
get the null exchange exception because the emails may be multipart
messages.  When the IMAP consumer does not consume, there is no error
message in the log.  I am running Camel 2.13.0 and
cxf-rt-transports-http-jetty 2.7.10.  Any help would be greatly appreciated.
Another strange thing is that the application would work fine when running
under Eclipse.

Here is my camel-context:

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">

<bean id="myProc" class="com.pci.TestImapConsumer.MailProc" />
<bean id="myGroovyProc" class="com.pci.TestImapConsumer.GroovyMailProc" />

  <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
	<camel:route>
      <camel:from
uri="imaps://imap.gmail.com:993?username=test@e-bonding.com&amp;password=partners2014&amp;delete=true&amp;mapMailMessage=false&amp;closeFolder=false&amp;disconnect=false"/>
      <camel:log message="***** Email received from IMAP." />
      <camel:process ref="myGroovyProc" />
    </camel:route>
  </camel:camelContext>

</beans>




--
View this message in context: http://camel.465427.n5.nabble.com/camel-mail-and-camel-cxf-incompatible-tp5750386.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-mail and camel-cxf incompatible?

Posted by bocamel <jo...@gmail.com>.
Willem,  thank you very much for the quick response!  Your suggestion worked
perfectly.



--
View this message in context: http://camel.465427.n5.nabble.com/camel-mail-and-camel-cxf-incompatible-tp5750386p5750393.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-mail and camel-cxf incompatible?

Posted by Willem Jiang <wi...@gmail.com>.
It looks like there some conflict between the java mail jar and geronimo-javamail_1.4_spec.jar.
Can you try to exclude the org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1 just below the dependency of cxf-rt-transports-http-jetty.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On April 21, 2014 at 2:27:24 AM, bocamel (johnzyin@gmail.com) wrote:
> I am having a problem with a camel project that uses both camel-mail and
> camel-cxf. If only camel-mail is used, it can successfully consume emails
> from an IMAP endpoint. But if camel-cxf maven dependency is included, even
> if there is no cxfendpoint route defined in Camel Context, the IMAP consumer
> would not consume emails if mapMailMessage is set to false. If
> mapMailMessage is set to true, the IMAP consumer does consume emails, but I
> get the null exchange exception because the emails may be multipart
> messages. When the IMAP consumer does not consume, there is no error
> message in the log. I am running Camel 2.13.0 and
> cxf-rt-transports-http-jetty 2.7.10. Any help would be greatly appreciated.
> Another strange thing is that the application would work fine when running
> under Eclipse.
>  
> Here is my camel-context:
>  
>  
>  
>  
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:camel="http://camel.apache.org/schema/spring"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>  
>  
>  
>  
>  
>  
> > uri="imaps://imap.gmail.com:993?username=test@e-bonding.com&password=partners2014&delete=true&mapMailMessage=false&closeFolder=false&disconnect=false"/>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-mail-and-camel-cxf-incompatible-tp5750386.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>