[jboss-dev-forums] [JBoss AS 7 Development] - javax.naming.NoInitialContextException in WebApp

Mitchell Ackerman do-not-reply at jboss.com
Mon Jul 30 14:10:01 EDT 2012


Mitchell Ackerman [https://community.jboss.org/people/mackerman] created the discussion

"javax.naming.NoInitialContextException in WebApp"

To view the discussion, visit: https://community.jboss.org/message/751055#751055

--------------------------------------------------------------
Hi, I have a webapp, running in JBoss AS7.1.1.Final.  In it, I am attempting to send an email, but am getting javax.naming.NoInitialContextException when trying to lookup SMTP:

| 
 | 
 | 
 | InitialContext ic = new InitialContext(); |
| 
 | 
 | 
 | Session mailSession = (Session)ic.lookup("java:/Mail"); |

my standalone.xml contains:

        <subsystem xmlns="urn:jboss:domain:naming:1.1"/>

        <subsystem xmlns="urn:jboss:domain:mail:1.0">
                                        <mail-session debug="true" jndi-name="java:/Mail" from=" mailto:test at test.com test at test.com" >
                                                       <smtp-server outbound-socket-binding-ref="mail-smtp"/>
                                        </mail-session>
                         </subsystem>

the complete error is:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial

Anyone have any idea what is going on here?

thanks, Mitchell
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/751055#751055]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120730/885f267c/attachment.html 


More information about the jboss-dev-forums mailing list