• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem usin JNDI  RSS feed

nisu pathak
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello i have configured JNDI.i have configured java Mail session into glashfish server named mail/MyMailConfig.the code for sending mail using jndi is given below :

though i am getting following error even if i have configured Mail Session Properly ::

Exception in thread "main" 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
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.main.Main.runTest(Main.java:22)
at org.main.Main.main(Main.java:58)

please help me i am stuck with it..
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!