aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Netbeans & Tomcat Problem : Error messages included! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Netbeans & Tomcat Problem : Error messages included!" Watch "Netbeans & Tomcat Problem : Error messages included!" New topic
Author

Netbeans & Tomcat Problem : Error messages included!

Darren Wilkinson
Ranch Hand

Joined: May 22, 2007
Posts: 35
Hello :-)

I have been working on a simple Jsp and Servlets project in Netbeans 5.5 - just to get an idea of how the web side of Java works. I am using the bundled Tomcat and connecting to a remote MySQL database using ConnectJ (jdbc driver) and everything was going well - until Netbeans started to spit the following out.

Output : Browser

HTTP Status 404 - /TestWebApp/

type Status report

message /TestWebApp/

description The requested resource (/TestWebApp/) is not available.
Apache Tomcat/5.5.17

Output : TestWebApp

init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
do-dist:
dist:
Starting server Bundled Tomcat (5.5.17)
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
Incrementally deploying http://localhost:8084/TestWebApp
Completed incremental distribution of http://localhost:8084/TestWebApp
run-deploy:
Browsing: http://localhost:8084/TestWebApp/
run-display-browser:
run:
BUILD SUCCESSFUL (total time: 11 seconds)

Output : Bundled Tomcat 5.5.17 Log

28-Jul-2007 16:46:10 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class vanilla.test.pojos.MyServletContextListener
java.lang.NullPointerException
at vanilla.test.pojos.LocationsManager.updateLocationList(LocationsManager.java:39)
at vanilla.test.pojos.DatabaseManager.<init>(DatabaseManager.java:35)
at vanilla.test.pojos.MyServletContextListener.contextInitialized(MyServletContextListener.java:31)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)


Output : Bundled Tomcat 5.5.17

Using CATALINA_BASE: C:\Documents and Settings\Red Boffin\.netbeans\5.5.1\apache-tomcat-5.5.17_base
Using CATALINA_HOME: C:\Program Files\netbeans-5.5.1\enterprise3\apache-tomcat-5.5.17
Using CATALINA_TMPDIR: C:\Documents and Settings\Red Boffin\.netbeans\5.5.1\apache-tomcat-5.5.17_base\temp
Using JRE_HOME: C:\Program Files\Java\jdk1.6.0_01
28-Jul-2007 16:46:04 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_01\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\
28-Jul-2007 16:46:04 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
28-Jul-2007 16:46:04 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 454 ms
28-Jul-2007 16:46:04 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
28-Jul-2007 16:46:04 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
28-Jul-2007 16:46:04 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
28-Jul-2007 16:46:05 org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Documents and Settings\Red Boffin\My Documents\My Client Projects\Ivan\Websites\Vanilla\GenericWebsite\build\web\WEB-INF\lib\servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.
28-Jul-2007 16:46:10 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
28-Jul-2007 16:46:10 org.apache.catalina.core.StandardContext start
SEVERE: Context [/TestWebApp] startup failed due to previous errors
28-Jul-2007 16:46:10 org.apache.catalina.session.StandardManager stop
FINE: Stopping
28-Jul-2007 16:46:10 org.apache.catalina.session.StandardManager doUnload
FINE: Unloading persisted sessions
28-Jul-2007 16:46:10 org.apache.catalina.session.StandardManager doUnload
FINE: Saving persisted sessions to SESSIONS.ser
28-Jul-2007 16:46:10 org.apache.catalina.session.StandardManager doUnload
FINE: Unloading 0 sessions
28-Jul-2007 16:46:10 org.apache.catalina.session.StandardManager doUnload
FINE: Expiring 0 persisted sessions
28-Jul-2007 16:46:10 org.apache.catalina.session.StandardManager doUnload
FINE: Unloading complete
28-Jul-2007 16:46:10 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.net.BindException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:161)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2716)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1395)
at com.mysql.jdbc.Connection.realClose(Connection.java:4897)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2062)
at com.mysql.jdbc.Connection.finalize(Connection.java:3375)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
28-Jul-2007 16:46:10 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:187)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2716)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1395)
at com.mysql.jdbc.Connection.realClose(Connection.java:4897)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2062)
at com.mysql.jdbc.Connection.finalize(Connection.java:3375)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
28-Jul-2007 16:46:10 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
28-Jul-2007 16:46:10 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
28-Jul-2007 16:46:10 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63 config=null
28-Jul-2007 16:46:10 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
28-Jul-2007 16:46:10 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5828 ms

I honestly didn't mess with anything! One minute I could build, deploy and run my TestWebApp and then for some reason... I now can't.

Could someone help me understand what has gone wrong here.

Thank you.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

From the log, it seems the problem is in the vanilla.test.pojos.MyServletContextListener. I don't know what the listener is actually doing inside. Is it doing some DB stuff?

Alternatively, you can try to undeploy your web app and then restart the tomcat.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Darren Wilkinson
Ranch Hand

Joined: May 22, 2007
Posts: 35
Thank you for taking a look at this Freddy :-)

Here is the class...



I have been working on this all morning - methodically removing/inserting different elements on a trial and error basis and I have isolated the first problem to be related to this listener. When I comment it out (in web.xml) the test app works fine (so long as all my classes don't try to use the database connection).

Again, thanks for taking the time to help me with this.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959


Thank you for taking a look at this Freddy :-)

No problem at all, isn't it what this forum is for?

It's actually very hard to tell since I don't get to see the whole thing, but from the stack trace, it seems that this method (vanilla.test.pojos.LocationsManager.updateLocationList) is the one that's causing the problem. Maybe you should take a look at that code or anything related to your DatabaseManager class to see if there's a bug.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Red Boffin",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

Also, accounts with invalid display names are not included in promotions.

thanks,
Dave
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Netbeans & Tomcat Problem : Error messages included!