• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoInitialContextException  RSS feed

 
Crystal Bazil
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the below error message when I try to run the testing class below that. I googled the exception and read:

This exception is thrown when no initial context implementation can be created. The policy of how an initial context implementation is selected is described in the documentation of the InitialContext class.

// then I read this: InitialContext

This exception can be thrown during any interaction with the InitialContext, not only when the InitialContext is constructed. For example, the implementation of the initial context might lazily retrieve the context only when actual methods are invoked on it.


I really dont understand what I read. Could someone please explain what my issue is and why it is occurring and how I could fix it.

Thank you in advance,
Crystal










[ June 01, 2006: Message edited by: Crystal Bazil ]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
InitialContext in JNDI is created under some framework, usually a server in J2EE but, it could be created using a different mechanism such as used by Jini. Inorder to simulate JNDI lookups in a test environment, you need to create your own.

A good place to start is Code Barn where we have a JNDITest helper, you can preuse the code to see how this is done.
 
Crystal Bazil
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Carl - I've done a bit of research and reading since I posted the orginal message. I finally realize what my issue is but I am still having trouble finding the proper solution. I have some questions perhaps if answered might lead me in the right direction

Tomcat 5.5.0
Jdk 1.5.0

Using the following example from : http://directory.apache.org/subprojects/naming/using.html



I get the following error:


So basically I am back to where I started from in my prior post.

Questions

1.) How do you know which INITIAL_CONTEXT_FACTORY you use. Is this a class you should be able to find in your Tomcat/common/lib directory in a jar?
2.) URL_PKG_PREFIXES - same question as above.



I guess this will get me started. I appreciate any direction. Thanks

Crystal
[ June 02, 2006: Message edited by: Crystal Bazil ]
 
Crystal Bazil
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still cannot figure this out!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!