Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JavaMail Naming Exception

8 views
Skip to first unread message

ShadowPhoenix

unread,
Oct 22, 2007, 12:08:44 PM10/22/07
to
I'm trying to do a simple lookup of a mail session in WebLogic. This
is the code I'm using:

InitialContext ic = new InitialContext();
session = (Session) ic.lookup("fooMailSession");

Pretty simple. However, The following Exception gets thrown:

class javax.naming.NamingException: Unable to resolve
'subscriptionsMailSession'. Resolved ''

And this is the stack trace:

javax.naming.NamingException: Unable to resolve
'subscriptionsMailSession'. Resolved '' at com.me.mail.Mail.(Unknown
Source) at com.me.subscriptions.Subscriptions.runSubscriptions(Unknown
Source) at com.me.subscriptions.Subscriptions.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at
weblogic.servlet.internal.StubSecurityHelper
$ServletServiceAction.run(StubSecurityHelper.java:223) at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:
125) at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:
283) at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:
175) at weblogic.servlet.internal.WebAppServletContext
$ServletInvocationAction.run(WebAppServletContext.java:3245) at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:
321) at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121) at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:
2003) at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:
1909) at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:
1359) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

I double and triple checked that the mail session name that I'm
looking up is correct, and right now I'm out of ideas.

ShadowPhoenix

unread,
Oct 22, 2007, 1:05:10 PM10/22/07
to

Er, sorry, the code I'm using is actually:

InitialContext ic = new InitialContext();

session = (Session) ic.lookup("subscriptionsMailSession");

ShadowPhoenix

unread,
Oct 22, 2007, 4:01:42 PM10/22/07
to

Yeah I'm awesome. Turns out I was configuring the mail session on the
wrong server.

0 new messages