aspose file tools*
The moose likes JBoss/WildFly and the fly likes NoInitialContextException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "NoInitialContextException" Watch "NoInitialContextException" New topic
Author

NoInitialContextException

amit daundkar
Ranch Hand

Joined: Jan 24, 2009
Posts: 47
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.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 516
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.

Regards,
Amit
amit daundkar
Ranch Hand

Joined: Jan 24, 2009
Posts: 47
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.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10288
    
168

See this http://www.jboss.org/community/wiki/GetquotjavaxnamingNoInitialContextExceptionquot


[My Blog] [JavaRanch Journal]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: NoInitialContextException