Re: JavaMail Props Not Being Set
Re: JavaMail Props Not Being Set
- Subject: Re: JavaMail Props Not Being Set
- From: Chuck Hill <email@hidden>
- Date: Fri, 30 Jun 2006 17:37:00 -0700
On Jun 30, 2006, at 5:11 AM, Drew Thoeni wrote:
It appears the diagnosis is correct, it's not the code, it's that I
am missing (or have a conflict between) mail.jar and/or
activation.jar.
Confirmed this using debugging and this code
Transport transport = null;
transport = mailSession.getTransport("smtp");
transport.send(msg);
Program blows at getTransport("smtp") and debugger says the
variable is out of scope (meaning, I'm assuming, uninitialized).
I have looked at the classpath document in my .woa app and followed
each path (only three) to the Java->extentions folders and
WebObjects folders and have only found one copy of the latest
version of mail.jar and activation.jar.
The classpath file in the app points to the Java->extentions folders
and WebObjects->extensions folders? That does not sound right. If
you have done that, you hare probably having a classloader / security
problem that is getting mis-reported.
At this point the problem seems to have been isolated but the cause
is unclear. For what it is worth, I recently upgraded to the latest
Java version and developer tools.
Any suggestions?
I'll suggest what others have: undo all your changes related to this
(uninstalling the jars etc) and use the Wonder framework for mail.
Otherwise, Google is probably your best bet as this problem seems
unrelated to WO.
Chuck
On Jun 28, 2006, at 11:51 PM, Chuck Hill wrote:
On Jun 28, 2006, at 8:41 PM, Art Isbell wrote:
On Jun 28, 2006, at 4:55 PM, Drew Thoeni wrote:
So, I've tried the four suggestions:
Paul's "put in properties file": no effect.
This works for me. I added the following properties to my
Properties file:
# JavaMail
mail.store.protocol=smtp
mail.transport.protocol=smtp
mail.smtp.host=xxxx.xxxx.com
# Email address to which bounced messages should be sent
mail.smtp.from=email@hidden
JavaMail is complex. I understand only the bare minimum that
allowed me to build a replacement for WOMailDelivery which can be
unreliable. To make WOMailDelivery easily replaceable, I created
a JavaMailDelivery class that uses JavaMail underneath and
reimplemented WOMailDelivery.composePlainTextEmail() as
JavaMailDelivery.composePlainTextEmail(). I basically copied the
implementation of send() at <http://www.javaworld.com/javaworld/
jw-10-2001/jw-1026-javamail.html> adding exception handling where
needed and relying on properties in the Properties file rather
than hard-coding their values. It works fine.
SendFailedException: javax.mail.NoSuchProviderException: smtp
According to the JavaMail javadoc, NoSuchProviderException is
thrown when the JavaMail "Session attempts to instantiate a
Provider that doesn't exist." A Provider is the description of a
protocol implementation. In your case, the "smtp" protocol
implementation doesn't seem to exist. Maybe you need to set the
mail.store.protocol and mail.transport.protocol properties in
your Properties file or maybe your JavaMail implementation is
broken. I have no idea.
Art is correct. You are misinterpreting the meaning of the
exception. It is not saying that it can't find your SMTP server,
it is saying that it has no idea what SMTP _is_. My guess is that
this means one of:
1. You installed mail.jar and activation.jar in the wrong place.
They should be in one of /Library/Java/Extensions or Library/
WebObjects/Extensions.
2. You have conflicting versions of mail.jar and activation.jar in
the directories above or elsewhere
3. One of these files is missing or corrupt
Google http://www.google.com/search?q=NoSuchProviderException+smtp
+javamail
Google Knows All!
:-)
Chuck
--
Coming sometime... - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems. http://www.global-village.net/products/
practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40pobox.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming sometime... - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden