You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by I am Noob <se...@ml.sme.outblaze.com> on 2009/03/10 11:22:05 UTC

Using camel-mail in OSGi bundle

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&amp;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
-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22431428.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Using camel-mail in OSGi bundle

Posted by I am Noob <se...@ml.sme.outblaze.com>.
Hi Gnodet,

  Thanks for the solution. It solves the current problem but I face another
problem now.

10:34:11,069 | WARN  | omponent@1220c1b | ScheduledPollConsumer            |
camel.impl.ScheduledPollConsumer   68 | An
exception occured while polling: Endpoint[imap://
> imap.myserver.com:143/INBOX?username=noob&amp;password=abcd1234]:
> Unexpected command IMAP command error
org.apache.geronimo.javamail.util.InvalidCommandException: Unexpected
command IMAP command error
        at
org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.receiveResponse(IMAPConnection.java:406)
        at
org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.sendCommand(IMAPConnection.java:324)
        at
org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.list(IMAPConnection.java:1098)
        at
org.apache.geronimo.javamail.store.imap.IMAPFolder.checkExistance(IMAPFolder.java:252)
        at
org.apache.geronimo.javamail.store.imap.IMAPFolder.exists(IMAPFolder.java:232)
        at
org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:136)
        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.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

  Suppose my imap server (Sorry for using dummy domain above) is working
fine (I can fetch email using Thunderbird), what is the possible cause of
the above exception?

  Thanks in advance.


gnodet wrote:
> 
> I think there was some problem with the geronimo javamail bundle.
> You could try with the latest one:
> 
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/bundles/org.apache.servicemix.bundles.geronimo-javamail_1.4_provider/1.6_2-SNAPSHOT/org.apache.servicemix.bundles.geronimo-javamail_1.4_provider-1.6_2-20090310.115801-37.jar
> 
> On Tue, Mar 10, 2009 at 15:59, I am Noob
> <se...@ml.sme.outblaze.com>wrote:
> 
>>
>> Hi Ashwin,
>>
>>  Thanks for your reply.
>>  I edited the import packages as follows:
>>
>>  <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,
>>    javax.mail.search,
>>    javax.mail.util,
>>    javax.mail.event,
>>    javax.mail.internet,
>>    javax.mail,
>>     org.apache.geronimo.mail.util
>>   </Import-Package>
>>
>>  Besides, I followed Freeman's instruction to use
>> geronimo-javamail_1.4_provider-1.6 bundle and
>> org.apache.servicemix.specs.activation-api-1.1 bundle instead of mail.jar
>> and activation.jar.
>>  Unluckily, I am still facing the same error.
>> ----------------------------------------------
>>
>>
>> Ashwin Karpe wrote:
>> >
>> > Hi,
>> >
>> > You might want to add javax.mail and other mail related packages to the
>> > imported packages in the maven bundle plugin and then associate with
>> the
>> > following bundle list below that is instantiated by Servicemix
>> >
>> > Hope this helps.
>> >
>> > Cheers,
>> >
>> > Ashwin...
>> >
>> > ----------------------------------------------
>> > servicemix> packages exports | utils grep mail
>> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.search;
>> > version=1.4.
>> > 0
>> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.util;
>> > version=1.4.0
>> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.event;
>> > version=1.4.0
>> >
>> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.internet;
>> > version=1.
>> > 4.0
>> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail;
>> > version=1.4.0
>> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60):
>> > org.apache.geronimo.mail.util;
>> > version=0.0.0
>> > --------------------------------------------------------------
>> >
>> > 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&amp;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
>> --
>> View this message in context:
>> http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22436133.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
> 
> 


-----
Regards,
ServiceMix Noob =^D
-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22447854.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Using camel-mail in OSGi bundle

Posted by Guillaume Nodet <gn...@gmail.com>.
I think there was some problem with the geronimo javamail bundle.
You could try with the latest one:

http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/bundles/org.apache.servicemix.bundles.geronimo-javamail_1.4_provider/1.6_2-SNAPSHOT/org.apache.servicemix.bundles.geronimo-javamail_1.4_provider-1.6_2-20090310.115801-37.jar

On Tue, Mar 10, 2009 at 15:59, I am Noob <se...@ml.sme.outblaze.com>wrote:

>
> Hi Ashwin,
>
>  Thanks for your reply.
>  I edited the import packages as follows:
>
>  <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,
>    javax.mail.search,
>    javax.mail.util,
>    javax.mail.event,
>    javax.mail.internet,
>    javax.mail,
>     org.apache.geronimo.mail.util
>   </Import-Package>
>
>  Besides, I followed Freeman's instruction to use
> geronimo-javamail_1.4_provider-1.6 bundle and
> org.apache.servicemix.specs.activation-api-1.1 bundle instead of mail.jar
> and activation.jar.
>  Unluckily, I am still facing the same error.
> ----------------------------------------------
>
>
> Ashwin Karpe wrote:
> >
> > Hi,
> >
> > You might want to add javax.mail and other mail related packages to the
> > imported packages in the maven bundle plugin and then associate with the
> > following bundle list below that is instantiated by Servicemix
> >
> > Hope this helps.
> >
> > Cheers,
> >
> > Ashwin...
> >
> > ----------------------------------------------
> > servicemix> packages exports | utils grep mail
> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.search;
> > version=1.4.
> > 0
> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.util;
> > version=1.4.0
> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.event;
> > version=1.4.0
> >
> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.internet;
> > version=1.
> > 4.0
> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail;
> > version=1.4.0
> > Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60):
> > org.apache.geronimo.mail.util;
> > version=0.0.0
> > --------------------------------------------------------------
> >
> > 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&amp;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
> --
> View this message in context:
> http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22436133.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Using camel-mail in OSGi bundle

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Looks like Guillaume has point out with the mail component above. Please
ignore my earlier entry.

- Ashwin...


Ashwin Karpe wrote:
> 
> Hi,
> 
> Are you sure you see the Java mail bundle as deployed when you run the
> following command
> 
>    packages exports | util grep mail
> 
> Cheers,
> 
> Ashwin...
> 
> 
> I am Noob wrote:
>> 
>> Hi Ashwin,
>> 
>>   Thanks for your reply.
>>   I edited the import packages as follows:
>> 
>>   <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,
>>     javax.mail.search,
>>     javax.mail.util,
>>     javax.mail.event,
>>     javax.mail.internet,
>>     javax.mail,
>>     org.apache.geronimo.mail.util
>>   </Import-Package>
>> 
>>   Besides, I followed Freeman's instruction to use
>> geronimo-javamail_1.4_provider-1.6 bundle and
>> org.apache.servicemix.specs.activation-api-1.1 bundle instead of mail.jar
>> and activation.jar.
>>   Unluckily, I am still facing the same error.
>> ----------------------------------------------
>> 
>> 
>> Ashwin Karpe wrote:
>>> 
>>> Hi,
>>> 
>>> You might want to add javax.mail and other mail related packages to the
>>> imported packages in the maven bundle plugin and then associate with the
>>> following bundle list below that is instantiated by Servicemix
>>> 
>>> Hope this helps.
>>> 
>>> Cheers,
>>> 
>>> Ashwin...
>>> 
>>> ----------------------------------------------
>>> servicemix> packages exports | utils grep mail
>>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.search;
>>> version=1.4.
>>> 0
>>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.util;
>>> version=1.4.0
>>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.event;
>>> version=1.4.0
>>> 
>>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.internet;
>>> version=1.
>>> 4.0
>>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail;
>>> version=1.4.0
>>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60):
>>> org.apache.geronimo.mail.util;
>>> version=0.0.0
>>> --------------------------------------------------------------
>>> 
>>> 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&amp;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.
>>>>   
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22436542.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Using camel-mail in OSGi bundle

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Are you sure you see the Java mail bundle as deployed when you run the
following command

   packages exports | util grep mail

Cheers,

Ashwin...


I am Noob wrote:
> 
> Hi Ashwin,
> 
>   Thanks for your reply.
>   I edited the import packages as follows:
> 
>   <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,
>     javax.mail.search,
>     javax.mail.util,
>     javax.mail.event,
>     javax.mail.internet,
>     javax.mail,
>     org.apache.geronimo.mail.util
>   </Import-Package>
> 
>   Besides, I followed Freeman's instruction to use
> geronimo-javamail_1.4_provider-1.6 bundle and
> org.apache.servicemix.specs.activation-api-1.1 bundle instead of mail.jar
> and activation.jar.
>   Unluckily, I am still facing the same error.
> ----------------------------------------------
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> You might want to add javax.mail and other mail related packages to the
>> imported packages in the maven bundle plugin and then associate with the
>> following bundle list below that is instantiated by Servicemix
>> 
>> Hope this helps.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> ----------------------------------------------
>> servicemix> packages exports | utils grep mail
>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.search;
>> version=1.4.
>> 0
>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.util;
>> version=1.4.0
>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.event;
>> version=1.4.0
>> 
>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.internet;
>> version=1.
>> 4.0
>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail;
>> version=1.4.0
>> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60):
>> org.apache.geronimo.mail.util;
>> version=0.0.0
>> --------------------------------------------------------------
>> 
>> 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&amp;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.
>>>   
>>> 
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22436471.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Using camel-mail in OSGi bundle

Posted by I am Noob <se...@ml.sme.outblaze.com>.
Hi Ashwin,

  Thanks for your reply.
  I edited the import packages as follows:

  <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,
    javax.mail.search,
    javax.mail.util,
    javax.mail.event,
    javax.mail.internet,
    javax.mail,
    org.apache.geronimo.mail.util
  </Import-Package>

  Besides, I followed Freeman's instruction to use
geronimo-javamail_1.4_provider-1.6 bundle and
org.apache.servicemix.specs.activation-api-1.1 bundle instead of mail.jar
and activation.jar.
  Unluckily, I am still facing the same error.
----------------------------------------------


Ashwin Karpe wrote:
> 
> Hi,
> 
> You might want to add javax.mail and other mail related packages to the
> imported packages in the maven bundle plugin and then associate with the
> following bundle list below that is instantiated by Servicemix
> 
> Hope this helps.
> 
> Cheers,
> 
> Ashwin...
> 
> ----------------------------------------------
> servicemix> packages exports | utils grep mail
> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.search;
> version=1.4.
> 0
> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.util;
> version=1.4.0
> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.event;
> version=1.4.0
> 
> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.internet;
> version=1.
> 4.0
> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail;
> version=1.4.0
> Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60):
> org.apache.geronimo.mail.util;
> version=0.0.0
> --------------------------------------------------------------
> 
> 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&amp;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
-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22436133.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Using camel-mail in OSGi bundle

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

You might want to add javax.mail and other mail related packages to the
imported packages in the maven bundle plugin and then associate with the
following bundle list below that is instantiated by Servicemix

Hope this helps.

Cheers,

Ashwin...

----------------------------------------------
servicemix> packages exports | utils grep mail
Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.search;
version=1.4.
0
Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.util;
version=1.4.0
Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.event;
version=1.4.0

Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail.internet;
version=1.
4.0
Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60): javax.mail; version=1.4.0
Apache ServiceMix Specs :: JAVAMAIL API 1.4 (60):
org.apache.geronimo.mail.util;
version=0.0.0
--------------------------------------------------------------

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&amp;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.
>   
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p22432179.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Using camel-mail in OSGi bundle

Posted by I am Noob <se...@ml.sme.outblaze.com>.
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&amp;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.


Re: Using camel-mail in OSGi bundle

Posted by Freeman Fang <fr...@gmail.com>.
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&amp;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
>   


Re: Using camel-mail in OSGi bundle

Posted by Bruno Ledesma <le...@gmail.com>.
I facing problems like this one with the geronimo mail bundle, .
I cant find 1_6_2 on the http://people.apache.org/repo/. In this repo we can
find 1.8-r755222_1-SNAPSHOT/   and  1.8-r755223_2-SNAPSHOT/ .
The first one, still have the "unable to locate provider problem". The
second is not deleting messages and is throwing an exception : Error
accessing headers due to: Error issuing POP3 command: TOP 1 0. Another
problem im facing is that in the first polling , the poller cant found the
INBOX folder. 
The funny thing is that when i stop geronimo mail bundle and stop my mail
consumer bundle, the messages are deleted. 

My guess is that the folder INBOX is not been closed. And the Sun's PO3 Mail
API describes: "POP3 does not support the Folder.expunge() method. To delete
and expunge messages, set the Flags.Flag.DELETED flag on the messages and
close the folder using the Folder.close(true) method. You cannot expunge
without closing the folder. "

Maybe the bundle is mantaining the INBOX folder open after the polling,
consenquentially is not deleting the messages.

Does anyone have an idea of what is going on?

Thanks for your atention!


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&amp;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.
>   
> 

-- 
View this message in context: http://www.nabble.com/Using-camel-mail-in-OSGi-bundle-tp22431428p23196450.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.