File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception" Watch "Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception" New topic
Author

Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception

Ted Addis
Greenhorn

Joined: Nov 19, 2008
Posts: 11
Hi all,
Please help what I am missing?
All I did was upgrade my tomcat from 5.0.17 to 5.5.27, the same application, same database and I am getting javax.naming.NamingException Name Jdbc is not bound in this context.

my context file is and already connect to the database through my oracle client.

<?xml version="1.0" encoding="UTF-8"?>
<!-- The contents of this file will be loaded for each web application -->
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<Resource name="mydb" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc racle:thin:@10.1.4.156:1521:kwdb01" username="abcd" password="abcd" maxActive="20" maxIdle="10" maxWait="-1"/>
</Context>


and my java source code for connection would be
try
{
InitialContext initialcontext = new InitialContext();
try
{
Context context = (Context)(new InitialContext()).lookup("java:comp/env");
conn = ((DataSource)context.lookup("mydb")).getConnection();
Bhaskar Rao
Greenhorn

Joined: Apr 25, 2005
Posts: 23
Hi,

I dont know if its a change from Tomcat 5.0 to Tomcat 5.5. Try defining the resource name for the jdbc resource as 'jdbc/mydb' instead of 'mydb'.

I vaguely remember changing the resource name when I migrated my web app.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception