• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

NoInitialContextException

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends,
i am trying to configure DataSource with JBoss5.
i have a placed the connector jar file in the lib directory and the datasource file in the deploy directory.which is like-

but i get a NoInitialContextException. the code is-


the exception i get is-


please guide me regarding the env variable. which class name is to be specified in this variable and how can i do it?
this may be sounding a dumb question but please reply.

thank you.
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This will get you the InitialContext to lookup the JNDI object if and only if the Java Class that has this line of code deployed onto the Application server.

This will not work without supplying the InitialContextFactory and Provider URL ( Please check JBoss specific parameters and their values) if you have this line of code in a Java class that is running outside Server JVM.
 
amit daundkar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Amit,
thank you for the reply.
am i supposed to specify this class name in the environment variable inside the DataSource descriptor(mysql-ds.xml) file?
actually i am doing this for the first time.
as you can see, i have given the JNDI name as MySqlDS.
so what i dont understand is in the code-
,
what is this env variable. or shall i code it simply as-


please reply.
please give me an example if possible.
sorry to bother,
thank you again.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this http://www.jboss.org/community/wiki/GetquotjavaxnamingNoInitialContextExceptionquot
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic