File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get Intialcontext in a Java Class Outside container?

 
Vijay Shrivastava
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
elangovan
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic