Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to configure a JNDI URL resource

 
Rohit David
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to replicate the Websphere's URL Resource provider functionality in Tomcat, but haven't been really successful. So what I would like to do is access a properties file from a URL. This provides a convenient approach to modifying prop files as apposed to residing within WAR file. Anyway back to my question, I have taken a stab at this and below is how my meta-inf\context.xml, web.xml, and jndi code snippet looks.

CONTEXT.XML


WEB.XML


JNDI Lookup code snippet



Its throwing an exception.

My question is if URL resource configuration is possible in Tomcat 5.5, and if so how.

thanks
 
Chandan Agrawal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Any luck with this problem?

Regards,
Chandan
 
Rohit David
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope. No one replied back. I am assuming you are trying to do something similar. However I found an alternative. I am configuring an env variable in the web xml. This url will offer more insight into this approach
http://wiki.metawerx.net/wiki/Web.xml.EnvEntry

After reading the url as string I conver it to a URL by doing a java.net.URL url = new URL (String value);

Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic