You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Donald Whytock <dw...@gmail.com> on 2011/07/05 23:10:06 UTC

JavaMail and Felix

Hi all...

I'm having a problem with JavaMail running under Felix.

I have a simple application that fetches a
"multipart/alternative"-type email from a POP3 server.  If I run this
application standalone, I see the message correctly, with its content
as class MimeMultipart.  If I run this application as a bundle in
Felix, I see the message incorrectly, with its content as class
SharedByteArrayInputStream.

None of the bundles involved, including mine, are complaining about
classdefs not being found, so I assume all the appropriate Sun code is
in place.  But what about resources in the jars?  mailapi.jar has, for
example, a mailcap file, which I think is used by
javax.activation.DataHandler, which is in javaee.jar.  Is that
something that could work in CLI Java and not in Felix?

Don

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: JavaMail and Felix

Posted by Nick Wilson <ni...@weareact.com>.
As a possible alternative the Jetty distribution contains OSGi versions of the mail and activation jars (in the lib/jndi folder). These have work ok for me.
Regards,

Nick


-----Original Message-----
From: Caspar MacRae [mailto:earcam@gmail.com] 
Sent: 06 July 2011 10:56
To: users@felix.apache.org
Subject: Re: JavaMail and Felix

I had similar sounding problems with this.

Try adding the JavaMail (1.4.4) jar to your classpath and then put this into the parameters for launching Felix,

org.osgi.framework.system.packages.extra=com.sun.mail.auth;version=1.4.4, \  com.sun.mail.handlers;version=1.4.4, \  com.sun.mail.iap;version=1.4.4, \  com.sun.mail.imap;version=1.4.4, \  com.sun.mail.imap.protocol;version=1.4.4, \  com.sun.mail.pop3;version=1.4.4, \  com.sun.mail.smtp;version=1.4.4, \  com.sun.mail.util;version=1.4.4, \  com.sun.mail.util.logging;version=1.4.4, \  javax.mail;version=1.4.4, \  javax.mail.event;version=1.4.4, \  javax.mail.internet;version=1.4.4, \  javax.mail.search;version=1.4.4, \
 javax.mail.util;version=1.4.4


It means you won't be able to hotdeploy JavaMail, but it should work more like CLI wrt mailcap etc.

HTH,

Caspar


On 5 July 2011 22:10, Donald Whytock <dw...@gmail.com> wrote:

> Hi all...
>
> I'm having a problem with JavaMail running under Felix.
>
> I have a simple application that fetches a 
> "multipart/alternative"-type email from a POP3 server.  If I run this 
> application standalone, I see the message correctly, with its content 
> as class MimeMultipart.  If I run this application as a bundle in 
> Felix, I see the message incorrectly, with its content as class 
> SharedByteArrayInputStream.
>
> None of the bundles involved, including mine, are complaining about 
> classdefs not being found, so I assume all the appropriate Sun code is 
> in place.  But what about resources in the jars?  mailapi.jar has, for 
> example, a mailcap file, which I think is used by 
> javax.activation.DataHandler, which is in javaee.jar.  Is that 
> something that could work in CLI Java and not in Felix?
>
> Don
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


________________________________________________________________________
This e-mail has been scanned for all viruses.
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: JavaMail and Felix

Posted by Caspar MacRae <ea...@gmail.com>.
I had similar sounding problems with this.

Try adding the JavaMail (1.4.4) jar to your classpath and then put this into
the parameters for launching Felix,

org.osgi.framework.system.packages.extra=com.sun.mail.auth;version=1.4.4, \
 com.sun.mail.handlers;version=1.4.4, \
 com.sun.mail.iap;version=1.4.4, \
 com.sun.mail.imap;version=1.4.4, \
 com.sun.mail.imap.protocol;version=1.4.4, \
 com.sun.mail.pop3;version=1.4.4, \
 com.sun.mail.smtp;version=1.4.4, \
 com.sun.mail.util;version=1.4.4, \
 com.sun.mail.util.logging;version=1.4.4, \
 javax.mail;version=1.4.4, \
 javax.mail.event;version=1.4.4, \
 javax.mail.internet;version=1.4.4, \
 javax.mail.search;version=1.4.4, \
 javax.mail.util;version=1.4.4


It means you won't be able to hotdeploy JavaMail, but it should work more
like CLI wrt mailcap etc.

HTH,

Caspar


On 5 July 2011 22:10, Donald Whytock <dw...@gmail.com> wrote:

> Hi all...
>
> I'm having a problem with JavaMail running under Felix.
>
> I have a simple application that fetches a
> "multipart/alternative"-type email from a POP3 server.  If I run this
> application standalone, I see the message correctly, with its content
> as class MimeMultipart.  If I run this application as a bundle in
> Felix, I see the message incorrectly, with its content as class
> SharedByteArrayInputStream.
>
> None of the bundles involved, including mine, are complaining about
> classdefs not being found, so I assume all the appropriate Sun code is
> in place.  But what about resources in the jars?  mailapi.jar has, for
> example, a mailcap file, which I think is used by
> javax.activation.DataHandler, which is in javaee.jar.  Is that
> something that could work in CLI Java and not in Felix?
>
> Don
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>