camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: what jars are needed to use a smtp endpoint in a route
Date Thu, 20 Sep 2012 07:37:25 GMT
Hi

It depends on the version of Camel. The one you use seems to require
spring framework as well. So you need to add those Spring JARs back.



On Thu, Sep 20, 2012 at 9:16 AM, Sura Monday <sura.monday@yahoo.com> wrote:
> Hi All,
> I have been trying to use a smtp endpoint in a route.
> I have camel-mail.jar in my class path. However, I get this exception:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Authenticator
>     at org.apache.camel.component.mail.MailComponent.<init>(MailComponent.java:35)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>     at java.lang.reflect.Constructor.newInstance(Unknown Source)
>     at java.lang.Class.newInstance0(Unknown Source)
>     at java.lang.Class.newInstance(Unknown Source)
>     at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:1119)
>     at org.apache.camel.util.ReflectionInjector.newInstance(ReflectionInjector.java:32)
>     at org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:88)
>     at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:296)
>     at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:433)
>     at org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:424)
>     at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:216)
>     at main.java.bdi.BdiCamel.main(BdiCamel.java:42)
> Caused by: java.lang.ClassNotFoundException: javax.mail.Authenticator
>     at java.net.URLClassLoader$1.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     ... 15 more
>
>
> I added mailapi.jar to my class path. But now I am getting  the exception
>
> Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/mail/javamail/JavaMailSender
>     at org.apache.camel.component.mail.MailComponent.createEndpoint(MailComponent.java:73)
>     at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
>     at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:438)
>     at org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:424)
>     at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:216)
>     at main.java.bdi.BdiCamel.main(BdiCamel.java:42)
> Caused by: java.lang.ClassNotFoundException: org.springframework.mail.javamail.JavaMailSender
>     at java.net.URLClassLoader$1.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     ... 6 more
>
>
> Seems like it is referring to a jar related to the spring framework. So I removed all
the spring related jars from my classpath. But still this exception keeps coming.
>
> Can somebody please tell me what jars i should or should not have? I am NOT using Maven.
>
> Many thanks,
> Sura



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message