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'm trying to write a tag that takes form input and inserts it into a database. (Perhaps not clean, but I'm playing around. )
I'm using Netbeans 4.x ( which includes Tomcat 5.5.x ).
WHen I submit the form I get the following error ( truncated )
I read the JNDI HOW-TO, other Tomcat documents relating to JDBC and JNDI naming, as well as other research. The result is a slightly mixed approach that closely matches the recommendations from the HOW-TO. Comparing what I have to the HOW-TO, I don't know where the issue is.
Here's the server.xml entry:
Here's the context.xml ( within the webapp file system ) entry :
Here's the deployment descriptor for the webapp:
and finally the code that's supposed to be initializing the DataSource
The line it specifically hiccups on is this one:
Any input would be appreciated, thanks!
-------<br /> Aodhan H - Ad Astra Per Aspera<br /> -------
The only start up errors I get has something to do with tomcat already using the port it wants to use. ( A perplexing error that doesn't seem to stop tomcat from launching. )
The context.xml file is in webapps/jobtracker/META-INF/context.xml.
For sanity, I quit NetBeans, went on with life for a couple of hours, read your post and tried again. THis time, it magically worked. NetBeans itself, not just Tomcat, must have needed a restart. An annoying lesson. I need to find out how to get netbeans to use MY tomcat installation...but that's a separate issue.
Regardless, I appreciate your time verifying my configuration.
Now, I am getting a 'connection pool exhausted' error on submitting the form.
The function in question is this:
The specific line is:
So I went back and confirmed the related information was specified in the server.xml file:
Now there should be more than enough connections. However, I am doing a batch. (One form entry is still only one query though. ) Could this be a problem? Is there somewhere else I should look for trouble?
Joined: Mar 19, 2002
How are you closing your connections, thus returning the connection back to the pool?
Is your connection object stored in a instance variable? I usually try to acquire a connection, run my query(s), close connection, resultsSet(s) all withing one method call.
Based on your suggestion Craig I rooted around and found the problem. I was stumbling over the connection pool concerns, just trying to get them to work, I missed the more basic JDBC related errors. Your mention regarding the Connection object got me back on track.
Many thanks for your time!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com