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@test.com test(a)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&...]