Eclipse - web app Tomcat deployment borked - java

Any help will be much appreciated. I am running a web application which depends on two other projects in my work space. These two projects further depend on 3 other projects in my workspace. There are no errors with any of the projects within the work space. Running the web app within Tomcat produces the following error:
java.lang.NoClassDefFoundError: com/tele/misc/DefaultApplicationModule
Which is a class within the first level of dependent projects. All was working fine up until recently. This is obviously some sort of classpath issue? Any suggestions on how to find this within Eclipse metadata and fix this?
More detail:
Console:
*******************************************************************
*** WARNING: Apache MyFaces-2 is running in DEVELOPMENT mode. ***
*** ^^^^^^^^^^^ ***
*** Do NOT deploy to your live server(s) without changing this. ***
*** See Application#getProjectStage() for more information. ***
*******************************************************************
Feb 13, 2014 1:41:18 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Feb 13, 2014 1:41:18 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/CRGen] startup failed due to previous errors
Feb 13, 2014 1:41:18 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class za.co.huge.processor.CRToolContextListener
java.lang.NoClassDefFoundError: com/tele/misc/DefaultApplicationModule
at za.co.huge.processor.ReportProcessor.<init>(ReportProcessor.java:30)
at za.co.huge.processor.ReportProcessor.getInstance(ReportProcessor.java:41)
at za.co.huge.processor.CRToolContextListener.contextDestroyed(CRToolContextListener.java:22)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4927)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5573)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Feb 13, 2014 1:41:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Feb 13, 2014 1:41:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Feb 13, 2014 1:41:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2547 ms
All of this originating from my servlet context listener:
<!-- CRTool Context listener starts report processing Engine -->
<listener>
<listener-class>za.co.huge.processor.CRToolContextListener</listener-class>
</listener>
Which fails when init on Guice modules from the dependant project:
/* singleton design pattern - so only one service thread can be running */
private ReportProcessor(final long sleepTime){
serviceThread = new ServiceThread(sleepTime);
thread = new Thread(serviceThread);
thread.setPriority(Thread.MIN_PRIORITY);
final Injector injector = Guice.createInjector(new DefaultApplicationModule());
// final Injector injector = Guice.createInjector(new CommissionsModule(), new DefaultApplicationModule());
// ci = injector.getInstance(CommissionsImpl.class);
}

After you compile your code, you end up with .class files for each class in your program. These binary files are the bytecode that Java interprets to execute your program. The NoClassDefFoundError indicates that the classloader, which is responsible for dynamically loading classes, cannot find the .class file for the class that you're trying to use. It probably indicates that you haven't set the classpath option when executing your code. This link explains how to set the classpath when you execute.
http://en.wikipedia.org/wiki/Classpath_%28Java%29

Related

Why my Tomcat 7 stop working after deploy

I have a grails app that runs on dev environment and I crated the war without problems.
In the server, I stop the service using "sudo service tomcat7 stop" command and put the war file into the server folder "/var/lib/tomcat7/webapps" and start the server again with the command "sudo service tomcat7 start".
For checking the state of the server I run "sudo service tomcat7 status" and get the "Tomcat servlet engine is running with pid 19169" response, and check if the application deploys correctly on the folder "/var/lib/tomcat7/webapps" and I see the project's folder there.
Right now, if I check the catalina.out file, I can't see any deploy error having this:
May 27, 2020 9:04:31 PM org.apache.coyote.AbstractProtocol init INFO:
Initializing ProtocolHandler ["http-bio-80"] May 27, 2020 9:04:31 PM
org.apache.catalina.startup.Catalina load INFO: Initialization
processed in 1280 ms May 27, 2020 9:04:31 PM
org.apache.catalina.core.StandardService startInternal INFO: Starting
service Catalina May 27, 2020 9:04:31 PM
org.apache.catalina.core.StandardEngine startInternal INFO: Starting
Servlet Engine: Apache Tomcat/7.0.26 May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/docs.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/host-manager.xml May 27, 2020 9:04:33
PM org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/manager.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/examples.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web
application archive /var/lib/tomcat7/webapps/fleetcontroller.war
log4j:WARN No appenders could be found for logger
(net.bull.javamelody). log4j:WARN Please initialize the log4j system
properly. log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
But if I wait a while, the tomcat service is stoped.
When I check the server status with "sudo service tomcat7 status" I get this msg
Tomcat servlet engine is not running, but pid file exists.
And the catalina.out show me:
WARN intercept.RequestmapFilterInvocationDefinition - Exception
initializing; this is ok if it's at startup and due to GORM not being
initialized yet since the first web request will re-initialize. Error
message is: {0} 2020-05-27 21:14:13,192 [pool-2-thread-1] WARN
module.ModuleDeclarationsFactory - resources artefact
KickstartResources does not define any modules | Using LESS files to
generating CSS files!
Please, if someone can help with that, because I don't know how to find the problem.
Really thanks for your time.
It was a virtual machine size problem.
I checked some server parameters and see that they was lower than production. infrastructure office changed the virtual server size and it starts to work!
Thanks you for your time!

How to prevent Tomcat from shutting down when saxon xslt processor throws runtime errors?

I am using saxon to transform a .xhtml file in my web application. When saxon tries to transform a .xhtml document which is not well formed....it throws the following error :-
Error on line 665 column 231 of ABXDE123nual-Filing.xhtml:
SXXP0003: Error reported by XML parser: Element type "span" must be followed by either
attribute specifications, ">" or "/>".
Recoverable error on line 62 of someXSLT.xsl:
SXXP0003: org.xml.sax.SAXParseException; systemId:
file:/C:/Users/ruowier/AppData/Local/Temp/temp1231700079536768843678/ABXDE123nual-Filing.xhtml; lineNumber: 665; columnNumber: 231; Element type "span" must be followed by either attribute specifications, ">" or "/>".
Error on line 62 of someXSLT.xsl:
FODC0002: Failed to load document
file:/C:/Users/ruowier/AppData/Local/Temp/temp1231700079536768843678/ABXDE123nual-Filing.xhtml
Transformation failed: Run-time errors were reported
and soon after tomcat server gets stopped....
Aug 26, 2019 10:20:16 AM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
INFO: Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir
Aug 26, 2019 10:20:30 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-apr-8080"]
Aug 26, 2019 10:20:30 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-apr-8009"]
Aug 26, 2019 10:20:30 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Aug 26, 2019 10:20:30 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated for Servlet [default]
Aug 26, 2019 10:20:31 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated for Servlet [default]
Aug 26, 2019 10:20:32 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated for Servlet [default]
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/somePortal] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/somePortal] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#5179827b]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#381bab5]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/somePortal] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#5179827b]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#cb13461]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/somePortal] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal#4c2bf1fc]) and a value of type [org.apache.struts2.dispatcher.Dispatcher] (value [org.apache.struts2.dispatcher.Dispatcher#51dcc858]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/somePortal] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal#5f8694c4]) and a value of type [com.opensymphony.xwork2.ActionContext] (value [com.opensymphony.xwork2.ActionContext#5a91a169]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/somePortal] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal#49260fd6]) and a value of type [net.sf.saxon.expr.sort.LRUCache] (value [net.sf.saxon.expr.sort.LRUCache#7e8f80a2]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Aug 26, 2019 10:20:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/somePortal] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#5179827b]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#15440b03]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Aug 26, 2019 10:20:32 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-apr-8080"]
Aug 26, 2019 10:20:37 AM org.apache.tomcat.util.net.AbstractEndpoint shutdownExecutor
WARNING: The executor associated with thread pool [http-apr-8080] has not fully shutdown. Some application threads may still be running.
Aug 26, 2019 10:20:37 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-apr-8009"]
Aug 26, 2019 10:20:38 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-apr-8080"]
Aug 26, 2019 10:20:38 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-apr-8009"]
I tried to catch the errors by surrounding the transformation statements with catch block as follows....but it doesn't seem to work....
try {
.
.
.
.
String[] args = new String[7];
args[0] = "-xsl:"+xsltPath;
args[1] = "-o:"+outputPath;
args[2] = "-it:main";
args[3] = "delimiter="+delimiter;
args[4] = "errPropPath="+errPropPath;
args[5] = "xsltFolderPath="+xsltFolderPath;
args[6] = "inputfiles="+inputPath+"";
//SAXON gets called over here...
Transform.main(args);
.
.
.
.
} catch (Exception e1) {
logger.debug("exception",e1);
}catch(Error e ){
logger.debug("error",e);
}
You are invoking the transformation using the command line interface:
Transform.main(args);
By default this closes the Java VM (using quit()) when a dynamic error occurs in the transformation. There is an option -quit:off to change this behaviour.
However, this is not the recommended way to invoke Saxon from a Java application. The recommended ways are to use either the JAXP API or the s9api API. Both are documented at http://www.saxonica.com/documentation/index.html#!using-xsl/embedding
Using an API gives you far more control over the way the transformation runs. For starters, if you use the same stylesheet once to transform multiple documents, it allows you to compile the stylesheet once and use it repeatedly. This is important because compiling the stylesheet often dominates the transformation time.

Liferay 6.2 - tomcat bundle shutdown issue

I am running into an issue where I am unable to shutdown the Liferay 6.2 tomcat bundle on the server via the bundled shutdown script on the new linux server.
The steps I took are:
Installed the bundle by unziping it.
Uploaded the custom portal-ext.properties in the default liferay home folder
Change the memory args as defined in the deployment best practices guide in the tomcat home/bin/setenv.sh
Added Oracle custom data source in the tomcat home/conf/context.xml
JDK - jdk1.7.0_75
Navigate to the tomcat home/bin folder -> run ./startup.sh
Liferay and the bundle comes up.
To shutdown - Navigate to the tomcat home/bin folder -> run ./shutdown.sh
This displays the following but the tomcat is not shutdown:
$ ./shutdown.sh
Using CATALINA_BASE: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42
Using CATALINA_HOME: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42
Using CATALINA_TMPDIR: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42/temp
Using JRE_HOME: /.../java/jdk1.7.0_75
Using CLASSPATH: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42/bin/bootstrap.jar:/.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42/bin/tomcat-juli.jar
I see the following in the Tomcat logs.
apr 27, 2015 1:18:23 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [org.python.google.common.base.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:23 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [MulticastListener-239.255.0.523305] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:23 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [pool-3-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:29 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/opensocial-portlet] appears to have started a thread named [com.google.inject.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
The tomcat process is still showing after a few minutes as an active process and needs to be killed manually. Liferay seems to be down after the shutdown script is run within a minute or so.
I need this to work so all the resources are released cleanly and I can script the startup and shutdown as needed.
Has anyone seen this and resolved this behavior? Any insight would be much appreciated.
Thanks!
After working through this issue and following the steps below, the tomcat process shuts down within a minute or so with the shutdown script and there is no need to kill the process manually.
increased maxpermsize catalina_opts argument to 512m (was 200m) in the setenv.sh - this resolved 2 of the memory leak messages in the logs at shutdown and also resulted in the tomcat process shutdown properly.
removing the opensocial-portlet removed 1 memory leak error prior to the maxpermsize change but the process was still not shutdown properly.
there is 1 remaining memory leak error in the logs on shutdown but that for now is not preventing the tomcat from shutting down and seems to be part of tomcat not necessarily caused by liferay. This message for now seems safe to ignore per this LPS issue below
https://issues.liferay.com/browse/LPS-34498
Hope this helps someone.

ClassNotFoundException while starting the Tomcat 7 Server in MyEclipse

I am using MyEclipse 9 and Tomcat7.0 . I have taken latest code and deployed in Tomcat 7 and started the server. Immediately i got an error log as mentioned below.
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.aap.apweb.servlet.APServletContextListener
java.lang.ClassNotFoundException: com.aap.apweb.servlet.APServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.aap.apweb.servlet.APHTTPSessionListener
java.lang.ClassNotFoundException: com.aap.apweb.servlet.APHTTPSessionListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/apweb] startup failed due to previous errors
Jan 10, 2014 5:53:41 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/apweb] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jan 10, 2014 5:53:41 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Jan 10, 2014 5:53:41 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jan 10, 2014 5:53:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13243 ms
I think the jars path has to be set. But i am not able to find it.
Is com.aap.apweb.servlet.APHTTPSessionListener one of your classes? I don't get any hits on Google so I'm guessing it is. You need to ensure that you have set all dependencies in your build path and set deployment policies accordingly. Deployment policies for the project can be adjusted by right clicking on the project, selecting Properties, then going to the MyEclipse/Web page and clicking the Deployment tab. On that tab, you can choose to use the workbench settings (in which case most fields will be grayed out) or not (just deselect the "Use workbench default settings").
Note that the most recent release of MyEclipse gives you more explicit control over deployment, via a deployment assembly. A license for MyEclipse 9 also applies to MyEclipse 2014, which can be downloaded from the www.myeclipseide.com web site.
Right click on project
then go to build path -> add library in libraries pane.
then select server run time then add apache tomcat and then try to run your application.
You can export the required projects as jar files and place them in your .WAR file in WEB-INF\lib .This ensures that your classes from your jar files get loaded during application startup.
As per this line from the log:
The web application [/apweb] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
I have added db2 jdbc 1.6 jars(db2jcc4.jar and db2jcc4_license_cisuz.jar)to my project build path. These jars solved my problem while restarting the server. It started without any issue.
Thanks for all the geeks to responding me.
I am getting the same error when I started tomcat server in Eclipse Luna environment. And my OS is Ubuntu.
Actually the problem is when I build the project the web module not create the M2e-wtp maven folder. When we start the tomcat server it could not see the maven dependencies. That's while the exception came.
I resolve this issue by Downloading the latest Mars eclipse. And again I checked out my project.
After clean installed my project the issue was resolved. It's working fine.

Tomcat Java GC Issue Linux

I am running a Tomcat Web Server(7.0) on Ubuntu. I have the same War file using Java 1.6 in my local Windows machine and I face no issues whatsoever. However, on the linux machine my tomcat fails after some time or stops working and I get Java GC exceptions. It starts with these errors :
Jul 10, 2011 4:29:05 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/manager]
Jul 10, 2011 4:29:05 PM org.apache.catalina.session.StandardManager doUnload
SEVERE: IOException while saving persisted sessions: java.io.FileNotFoundException: /home/infocomm/tomcat/work/Catalina/localhost/manager/SESSIONS.ser (No such file or directory)
java.io.FileNotFoundException: /home/infocomm/tomcat/work/Catalina/localhost/manager/SESSIONS.ser (No such file or directory)
Then these errors:
Jul 10, 2011 4:29:05 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
WARNING: JDBC driver de-registration failed for web application [/manager]
java.lang.NullPointerException
at org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc(WebappClassLoader.java:2012)
at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1948)
at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1860)
at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:659)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5032)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:952)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1199)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1360)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:290)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1228)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1394)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1373)
at java.lang.Thread.run(Thread.java:619)
Jul 10, 2011 4:29:05 PM org.apache.catalina.util.LifecycleBase destroy
INFO: The destroy() method was called on component [StandardContext[/manager]] after destroy() had already been called. The second call will be ignored.
Jul 10, 2011 4:29:05 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context []
Jul 10, 2011 4:29:05 PM org.apache.catalina.session.StandardManager doUnload
Then Finally TOmcat stops responding with these errors:
Jul 10, 2011 5:07:44 PM org.apache.catalina.util.LifecycleBase destroy
INFO: The destroy() method was called on component [StandardContext[/host-manager]] after destroy() had already been called. The second call will be ignored.
Jul 10, 2011 6:31:44 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor rcbp.xml from /home/infocomm/tomcat/conf/Catalina/localhost
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
Would Appreciate any help.
This only happens after I exit the remote shell with which I started the Tomcat Application.
does tomcat (when running with a specific user account) has access to this file, it should have enough privilege create, update & delete the file.
/home/infocomm/tomcat/work/Catalina/localhost/manager/SESSIONS.ser
in windows its very rare for this scenario to surface unless you've started tomcat as an unprivileged user.

Categories