File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Naming Exception in tomcat-3.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Naming Exception in tomcat-3.3" Watch "Naming Exception in tomcat-3.3" New topic

Naming Exception in tomcat-3.3

Chandra Sekhar
Ranch Hand

Joined: Sep 26, 2003
Posts: 90

I got an issue with JNDI look up in jakarta-tomcat-3.3a version.(I cannot upgrade my tomcat version.)

I'm getting this error while trying to lookup my jndi name.

"javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial"

With jakarta-tomcat-5.0.18 version i'm able to lookup jndi name,but the sad story is is i need to make this work in jakarta-tomcat-3.3a

The steps followed
(1) Created one apps_myapp.xml(I tired adding the context in server.xml also.)
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context path="/myapp" docBase="webapps/myapp" debug="0">
<Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/mydb">
<name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>


` </parameter>







(2)Added to my web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
<description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>

Any one who worked with jakarta-tomcat-3.3a ,please help me

Thanks in Advance
Chandrasekhar S.

"Luck is when opportunity meets preparation"
I agree. Here's the link:
subject: Naming Exception in tomcat-3.3
It's not a secret anymore!