aspose file tools*
The moose likes Tomcat and the fly likes How to get Intialcontext in a Java Class Outside container? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get Intialcontext in a Java Class Outside container?" Watch "How to get Intialcontext in a Java Class Outside container?" New topic
Author

How to get Intialcontext in a Java Class Outside container?

Vijay Shrivastava
Ranch Hand

Joined: Nov 15, 2001
Posts: 64
I want to obtain the IntialContext in a standalone Java class from the Tomcat which is running on port 8080 on local m/c.
When I try something like this
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.naming.java.javaURLContextFactory");
ht.put("java.naming.factory.url.pkgs",
"org.apache.naming");
Context ctx = new InitialContext(ht);
It gives error Cannot instantiate class: org.apache.naming.java.javaURLContextFactory. What should be passed as parameter when Intial context is to be abtained from Tomcat outside the webapplication( not in servlet or JSP page)?
Thanks!


Vijay shrivastava
elangovan
Greenhorn

Joined: May 28, 2002
Posts: 2
Hello Vijay, Did you have any success on this? I am trying to do the same thing and i am getting the same problem. Could you please mail me if you solved this problem with how you did that. Thanks
Elango. You can send me email at "kelango27@yahoo.com".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Intialcontext in a Java Class Outside container?