This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I tried to make database connection pool using DataSource configuration in tomcat's server.xml file.But failed to access the data source from jsp's.
I am getting Exception "Name jdbc is not bound in this Context ".How to resolve it?
You're probably trying to look up the datasource using a URL such as "java:comp/env/jdbc/mydsrc". When JNDI cannot locate a named resource, it returns a message telling to at what point in the URL the trail ran out. It's saying that it couldn't find a "/jdbc" level node, so basically, you haven't managed to define the datasource to Tomcat in a way that's visible to that particular web application. Check your connection pool definition. It needs to be defining a resource named "jdbc/mydsrc".
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Jun 15, 2009
I am using tomcat6,NetBeans 6.8 and struts 1.3. I am trying to configure JNDI data source in tomcat's conf/server.xml file .Below giving the details.
vinod chemmi wrote:I am using tomcat6,NetBeans 6.8 and struts 1.3. I am trying to configure JNDI data source in tomcat's conf/server.xml file .Below giving the details.
Just for your information
For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.
Glad to see that someone's been reading the instructions.
Actually, it's reasonable to put something in server.xml if it's intended to apply to more than one Context. However, you're quite correct. Contexts and their sub-elements should not be placed within server.xml. Now somebody please tell the Eclipse WTP people that!
Joined: Jun 15, 2009
I resolved the issue.
1.add mysql-connector in lib.
2.check Tools->Server->classe node,for mysql-connector jar added or not. If not go back Project node and deploy.
this should be there in classes of Server.
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/Job">
<Resource name="jdbc/job" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="" driverClassName="com.mysql.jdbc.Driver"