This week's giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP and have Lucian Maly on-line!
See this thread for details.
Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Naming Exception in tomcat-3.3

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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"?>
<webapps>
<Context path="/myapp" docBase="webapps/myapp" debug="0">
<Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/mydb">
<parameter>
<name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>

<parameter>
<name>maxActive</name>
<value>25</value>
</parameter>

<parameter>
<name>maxIdle</name>
<value>10</value>
` </parameter>

<parameter>
<name>username</name>
<value>admin</value>
</parameter>

<parameter>
<name>password</name>
<value>123</value>
</parameter>

<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>

<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/mydb</value>
</parameter>

<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams>

</Context>
</webapps>

(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"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
LoginInit
</servlet-name>
<servlet-class>
LoginInit
</servlet-class>
<load-on-startup>
1
</load-on-startup>
</servlet>
<resource-ref>
<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>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>

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

Thanks in Advance
Chandrasekhar S.
SCJP
 
You get good luck from rubbing the belly of a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic