You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/09/12 06:43:18 UTC

JavaMail and James SMPT Server

I have James-2.1.3 up and running.  In another DOS
window, I have successfully added two users: Gloria
and John, to James-2.1.3.

On the JavaMail part, I placed the activation.jar and
mail.jar in
C:\j2sdk1.4.1_02\jre\lib\ext

In another DOS window, I compiled the program
C:\javamail-1.3.1\demo>javac msgsend.java

When I tried to send message between James internal
users for testing purpose:

C:\javamail-1.3.1\demo>java msgsend -o John@localhost 
-M smtp.localhost Gloria@localhost

I got Exception in thread "main"
java.lang.NoClassDefFoundError: javax/mail/message

What is the cause of the problem?

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: JavaMail and James SMPT Server

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Put mail.jar and activation.jar explicitly in your classpath and
> everything will work.

The James binary distributions come with the mailet and activation jars
pre-installed in the right places.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: JavaMail and James SMPT Server

Posted by Caroline Jen <ji...@yahoo.com>.
Hi, Jens:

I tried your suggestion.  I have the Windows XP Pro
and in the CLASSPATH field, I add

C:\javamail-1.3.1\mail.jar;C:\jaf-1.0.2\activation.jar

I also removed mail.jar and activation.jar from 
C:\j2sdk1.4.1_02\jre\lib\ext

In a DOS window, I 
C:\javamail-1.3.1\demo>java msgsend -o John@localhost 
-M localhost Gloria@localhost

After I entered Subject and my messages followed by
Control-Z, "Mail was sent successfully" was prompted
to the consol.

I checked the FILESTREAMSTORE file in the
C:\james-2.1.3\apps\james\var\mail\inboxes\Gloria
folder, I was able to see the record of the message.

I then
C:\javamail-1.3.1\demo>java msgshow -L 
 pop3://Gloria:*****@localhost

This time, I got Exception in thread "main"
java.lang.NoClassDefFoundError: msgshow

Because I think I am using SMTP server, I modified the
command a little bit:

C:\javamail-1.3.1\demo>java msgshow -L 
 SMTP://Gloria:*****@localhost

The error message is the same.  

I think the mail server can be found because I
successfully sent a message according to the record. 
But, 'msgshow' cannot be recognized.  I am very
puzzled.  

-Caroline

--- "Jens A. Jensen" <ja...@swt.dk> wrote:
> 
> Caroline,
> 
> This is a classloader problem. For some reason
> mail.jar and 
> activation.jar do not work with the extensions
> classloader which is used 
> when you put the .jar files in the ext directory.
> (Classloading is a 
> *very* complicated area, some people think that it
> really is the 
> Achilles heel of  Java.)
> Put mail.jar and activation.jar explicitly in your
> classpath and 
> everything will work.
> BTW, when testing with msgsend you can use msgshow
> afterwards to see if 
> your message arrived, like this 'java msgshow -L 
> pop3://userid:password@localhost'.
> 
> Regards,
> jaj
> 
> Jens A. Jensen
> Sunway Software ApS
> 
> 
> Caroline Jen wrote:
> 
> >I have James-2.1.3 up and running.  In another DOS
> >window, I have successfully added two users: Gloria
> >and John, to James-2.1.3.
> >
> >On the JavaMail part, I placed the activation.jar
> and
> >mail.jar in
> >C:\j2sdk1.4.1_02\jre\lib\ext
> >
> >In another DOS window, I compiled the program
> >C:\javamail-1.3.1\demo>javac msgsend.java
> >
> >When I tried to send message between James internal
> >users for testing purpose:
> >
> >C:\javamail-1.3.1\demo>java msgsend -o
> John@localhost 
> >-M smtp.localhost Gloria@localhost
> >
> >I got Exception in thread "main"
> >java.lang.NoClassDefFoundError: javax/mail/message
> >
> >What is the cause of the problem?
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> >http://sitebuilder.yahoo.com
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> server-user-unsubscribe@james.apache.org
> >For additional commands, e-mail:
> server-user-help@james.apache.org
> >
> >
> >  
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> server-user-unsubscribe@james.apache.org
> For additional commands, e-mail:
> server-user-help@james.apache.org
> 



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: JavaMail and James SMPT Server

Posted by "Jens A. Jensen" <ja...@swt.dk>.
Caroline,

This is a classloader problem. For some reason mail.jar and 
activation.jar do not work with the extensions classloader which is used 
when you put the .jar files in the ext directory. (Classloading is a 
*very* complicated area, some people think that it really is the 
Achilles heel of  Java.)
Put mail.jar and activation.jar explicitly in your classpath and 
everything will work.
BTW, when testing with msgsend you can use msgshow afterwards to see if 
your message arrived, like this 'java msgshow -L 
pop3://userid:password@localhost'.

Regards,
jaj

Jens A. Jensen
Sunway Software ApS


Caroline Jen wrote:

>I have James-2.1.3 up and running.  In another DOS
>window, I have successfully added two users: Gloria
>and John, to James-2.1.3.
>
>On the JavaMail part, I placed the activation.jar and
>mail.jar in
>C:\j2sdk1.4.1_02\jre\lib\ext
>
>In another DOS window, I compiled the program
>C:\javamail-1.3.1\demo>javac msgsend.java
>
>When I tried to send message between James internal
>users for testing purpose:
>
>C:\javamail-1.3.1\demo>java msgsend -o John@localhost 
>-M smtp.localhost Gloria@localhost
>
>I got Exception in thread "main"
>java.lang.NoClassDefFoundError: javax/mail/message
>
>What is the cause of the problem?
>
>__________________________________
>Do you Yahoo!?
>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>http://sitebuilder.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org