Hi Freeman, Thanks for your reply.
I am using FUSE ESB 4.0.0.4 and I can find org.apache.servicemix.specs.activation-api-1.1 bundle already installed in OSGi environment. Then I explicity install geronimo-javamail_1.4_provider-1.6 from maven. The same error comes up when I start the bundle, however. Are there any packages I need to import in my OSGi bundle? Freeman Fang wrote: > > Hi, > > Which SMX4 version are you use? > You shouldn't use sun mail.jar and activation.jar, since they don't work > in OSGI env. > You should use geronimo-javamail_1.4_provider-1.6 bundle and > org.apache.servicemix.specs.activation-api-1.1 bundle instead, which > already shipped with SMX4 latest SNAPSHOT, can you try with SMX4 latest > SNAPSHOT from [1]? > [1]http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/features/apache-servicemix/4.0-m2-SNAPSHOT/ > > Freeman > > I am Noob wrote: >> Dear All, >> >> I have difficulties in using Camel Mail Component in my custom bundle. >> When I start the bundle in ServiceMix, I always get the following error: >> >> javax.mail.NoSuchProviderException: Unable to locate provider for >> protocol: >> imap >> at javax.mail.Session.getProvider(Session.java:241) >> at javax.mail.Session.getStore(Session.java:282) >> at >> org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:127) >> at >> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:72) >> at >> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66) >> at >> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) >> [...] >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >> at java.lang.Thread.run(Thread.java:619) >> >> Here is my route: >> <route> >> <from >> uri="imap://imap.myserver.com:143/INBOX?username=noob&password=abcd1234" >> /> >> <process ref="mailAttachmentProcessor" /> >> <to uri="activemq:Mail.Queue" /> >> >> <bean id="mailAttachmentProcessor" >> class="org.mydomain.camel.processor.MailAttachmentProcessor"> >> <property name="logDir" value="/home/noob/tmp/mail" /> >> </bean> >> >> <bean id="activemq" >> class="org.apache.activemq.camel.component.ActiveMQComponent"> >> <property name="brokerURL" value="tcp://localhost:61616" /> >> </bean> >> >> And in my pom.xml, I have the following dependencies declared: >> camel-core, camel-spring, camel-mail, camel-jms, activemq-core, >> activemq-pool, activemq-camel >> I also have dependencies on mail.jar and activation.jar (not sure if >> they >> are necessary) >> >> And my bundle plugin configures as follow: >> >> <plugin> >> <groupId>org.apache.felix</groupId> >> <artifactId>maven-bundle-plugin</artifactId> >> <extensions>true</extensions> >> <configuration> >> <instructions> >> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> >> <Import-Package> >> *, >> org.apache.camel.osgi, >> org.apache.activemq.camel.component, >> org.apache.camel.component.jms, >> javax.xml.parsers, >> javax.xml.transform, >> org.apache.activemq.pool >> </Import-Package> >> <Private-Package> >> org.mydomain.camel.processor >> </Private-Package> >> </instructions> >> </configuration> >> </plugin> >> >> When I google on this issue, I found somebody resolve that problem. >> Here >> is the link: >> http://fusesource.com/forums/thread.jspa?messageID=1723 >> >> Thanks. >> >> >> ----- >> Regards, >> ServiceMix Noob =^D >> > > > ----- Regards, ServiceMix Noob =^D -- View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22435729.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
