It's not a secret anymore!*
The moose likes Tomcat and the fly likes how to configure a JNDI URL resource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to configure a JNDI URL resource" Watch "how to configure a JNDI URL resource" New topic
Author

how to configure a JNDI URL resource

Rohit David
Greenhorn

Joined: Feb 18, 2008
Posts: 12
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

Joined: Mar 13, 2008
Posts: 1
Hi,

Any luck with this problem?

Regards,
Chandan
Rohit David
Greenhorn

Joined: Feb 18, 2008
Posts: 12
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to configure a JNDI URL resource
 
Similar Threads
Define DataSource in META-INF/context.xml ?
How to JNDI-Cannot create resource instance
how to configure a JNDI URL resource
Tomcat application won't start with MySQL Connection Pooling
JNDI problem