Tomcat is something of which I both understand and am mystified by at the same time. It has confounded me and been a breeze! "and she's always a woman to me...."!
I am working on an application in which I want to use Tomcat to manage my connection pooling. I am getting the following error:
I am using MySql database and have installed mysql-connector-java-3.1.3-beta-bin.jar in the **".. jakarta-tomcat-5.0.19\webapps\FamilyViolence\WEB-INF\lib" directory. I am using NetBeans 3.6 as my IDE.
I appreciate the assistance on this!!
Tom Boyce
Angel Dobbs-Sciortino
Ranch Hand
Joined: Sep 10, 2003
Posts: 101
posted
0
Is the lib directory is in your classpath?
Tom Boyce
Greenhorn
Joined: Jul 03, 2003
Posts: 24
posted
0
Yes, it is in my environment variable classpath. I just saw this error when netbeans runs tomcat:
LifecycleException: Container StandardContext[/FamilyViolence/jsp] has not been started at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4400) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4298) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126) at org.apache.catalina.core.StandardHost.start(StandardHost.java:832) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345) at org.apache.catalina.startup.Catalina.start(Catalina.java:594) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
Angel Dobbs-Sciortino
Ranch Hand
Joined: Sep 10, 2003
Posts: 101
posted
0
Try copying your jar file to common/lib in the tomcat directory. If that fixes it, then it's a classpath issue.
somkiat puisungnoen
Ranch Hand
Joined: Jul 04, 2003
Posts: 1312
posted
0
Step for config Datasource
1. don't forget to copy the JDBC Driver's jar into $CATALINA_HOME/common/lib.
2. server.xml configuration Configure the JNDI DataSource in Tomcat by adding a declaration for your resource to $CATALINA_HOME/conf/server.xml.
3. web.xml configuration -config in WEB-INF/web.xml
My environment classpath is as follows: .;C:\j2sdk1.4.2_05\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet.jar;c:\javamail-1.3.1\mail.jar;c:\jaf-1.0.1\activation.jar;c:\javamail-1.3.1\lib\imap.jar;c:\javamail-1.3.1\lib\mailapi.jar:c:\javamail-1.3.1\lib\pop3.jar;c:\javamail-1.3.1\lib\smtp.jar;C:\TIBCO\TIBRV\LIB\tibrvj.jar;C:\Program Files\NetBeans3.6\jakarta-tomcat-5.0.19\webapps\FamilyViolence\WEB-INF\lib\mysql-connector-java-3.1.3-beta-bin.jar;C:\j2sdk1.4.2_05\jre\bin;C:\mssqlserver.jar
Root Directory for project under NetBeans is: C:\Program Files\NetBeans3.6\jakarta-tomcat-5.0.19\webapps
Properties of http://localhost:8084/ Home directory: C:\Program Files\NetBeans3.6\jakarta-tomcat-5.0.19
Base Directory: C:\Documents and Settings\Administrator\.netbeans\3.6\jakarta-tomcat-5.0.19_base
I am truely at a loss!!!
Angel Dobbs-Sciortino
Ranch Hand
Joined: Sep 10, 2003
Posts: 101
posted
0
It looks like it should work. Have you tried the latest non-beta jdbc driver instead of the beta version? mysql-connector-java-3.0.15-ga-bin.jar
Tom Boyce
Greenhorn
Joined: Jul 03, 2003
Posts: 24
posted
0
No, I haven't tried the other jar file, but I have been fooling around with file structure. NetBeans creates an instance of tomcat under docs&settings/.netbeans directory, but it did not have any of the project within, so I copied the project into that directory. I am now getting this error:
I think I've seen this before, but not sure what I did to fix it. Any ideas?
gayathri sridhar
Greenhorn
Joined: Sep 15, 2004
Posts: 13
posted
0
Originally posted by Tom Boyce: [QB]StandardServer.await: create[8005]: java.net.BindException: Address already in use: JVM_Bind java.net.BindException: Address already in use: JVM_Bind [QB]
So another tomcat instance is already running? shut it down and try starting again. Try logging off and then start tomcat. If even taht does not work i think the port at which tomcat binds (guess is specified in the server.xml in tomcat needs to be changed to something different).
Cool, thanks for the links - I'll study on them and see if I can get it running! Changing the classpaths blew out every instance of tomcat I had so that's not going to work.
About instances. I have installed 3 seperate tomcats - one version 4.1 and two version 5.0XX. One of those came pre-packaged with netbeans, the other I needed for a project and has been serving as my main instance. But since I am doing connection pooling, I decided to try and use the instance under Netbeans. I only run one instance at a time!
Netbeans creates yet another version of Tomcat (albeit - truncated) under docsandsettings/.netbeans From what I've read so far, netbeans ignores the classpath in the environment variable and creates it own per project (I like this, just haven't figured out how to use it effectively yet). I am hoping these links you provided will help.
I do appreciate everyones assistance. Please standby while I study up to make another run at it!!!