tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shilpa Nalgonda" <>
Subject org.apache.jasper.JasperException: Name prototypedb is not bound in this Context
Date Tue, 27 Jul 2004 13:57:00 GMT
I am not able to set up datasource for connection pooling , i am using
tomcat 4.1.3, and connection to mysql database..
following is the code to retrieve the datasource...

			Context ctx = new InitialContext();
			Context env = (Context)ctx.lookup("java:comp/env");
			DataSource ds = (DataSource) env.lookup("jdbc/prototypedb");
			conn = ds.getConnection();

================================entry in server .xml

 <!-- JNDI datasource setup to connect to MYSQL database-->
     	<Context path="/PrototypeDBTest" docBase="PrototypeDBTest"
        	debug="5" reloadable="true" crossContext="true" useNaming="true">

  	<Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_PrototypeDBTest_log." suffix=".txt"
             <Resource name="jdbc/prototypedb"

  	<ResourceParams name="jdbc/prototypedb">

    	<!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.

    	<!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit.

   	 <!-- Maximum time to wait for a dB connection to become available
         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded.  Set to -1 to wait indefinitely.

    	<!-- MySQL dB username and password for dB connections  -->

    	<!-- Class name for mm.mysql JDBC driver -->

    	<!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed
         connection.  mysqld by default closes idle connections after 8


<!-- End of JNDI datasource setup -->

below is my web.xml......

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<description>PrototypeDB Test App</description>
 <description>DB Connection</description>

Please help: i have added the entry in server.xml between  context for
example... an d host variable.

-----Original Message-----
From: Shapira, Yoav []
Sent: Tuesday, July 27, 2004 9:06 AM
To: Tomcat Users List;
Subject: RE: Validating Users

Yup, you should be able to get to the admin app using the "richard"
user.  The file is case-sensitive, and you have to restart the server
after you edit it (with the default configuration).

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: Richard Crawford []
>Sent: Monday, July 26, 2004 5:41 PM
>Subject: Validating Users
>I have just installed Tomcat 5.0.27 on a Solaris 9 computer.  I've got
>it pointed at the right installation of Java, and when I go to
>http://localhost:8080 I see the Tomcat startup page come up, so I
>Tomcat is up and running properly.
>However, when I try to access the Tomcat Administration or Tomcat
>Manager pages, I get an "invalid user" error.  However, when I examine
>conf/tomcat-users.xml, I find that I am listed as an admin user:
>  <role rolename="standard"/>
>  <role rolename="manager"/>
>  <role rolename="admin"/>
>  <user username="richard" password="password"
>So, I *should* be able to get to the administration and management
>pages, right?
>I feel that I am missing something VERY basic...
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message