• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Naming Exception in tomcat-3.3

Chandra Sekhar
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic