Encountered exception javax.management.RuntimeOperationsException: Exception invoking method check - java

I have been getting a series of error messages when trying to deploy a web application to an instance of tomcat 7.0.35 server installed on my computer. The application is developed in jsp using eclipse.
The first error message I received was:
FAIL - Encountered exception javax.management.RuntimeOperationsException: Exception invoking method check
The above error message came after I tried to deploy the application in the tomcat manager application.
I have an xml file named myapp.xml placed in the root folder of the application in the workspace, and its contents are:
<Context path="/myapp" docBase="d:\path\to\myapp"/>
I tried to resolve this error message a number of different ways, with no effect. After some time, an error message started to appear as well.
Finally, every few seconds, the console is refreshing with a large batch of new error messages from its continued retries, and those error messages include the following:
Feb 8, 2013 10:38:19 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor d:\mypath\apache-tomcat-7.0.35\conf\Catalina\localhost\myapp.xml
Feb 8, 2013 10:38:19 PM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor d:\mypath\apache-tomcat-7.0.35\conf\Catalina\localhost\myapp.xml
java.io.FileNotFoundException: d:\mypath\apache-tomcat-7.0.35\conf\Catalina\localhost\myapp.xml (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Feb 8, 2013 10:38:19 PM org.apache.catalina.startup.HostConfig deployDescriptors
SEVERE: Error waiting for multi-thread deployment of context descriptors to complete
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:579)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1449)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.apache.catalina.startup.HostConfig.addWatchedResources(HostConfig.java:1172)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:706)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more
It seems to be throwing a null pointer error when tomcat looks for myapp.xml within a tomcat folder. But it does not seem to be seeing that myapp.xml is located in my eclipse workspace, at the d:\path\to\myapp url that I gave in the tomcat manager application, as shown above. And it seems like the problem is getting worse as I keep trying new things.
Can anyone show me how to fix all this so that I can deploy my application on tomcat? I have deployed other application on this server using similar methods without problems before this.

I got around this error by uninstalling and then re-installing both eclipse and tomcat.

Related

how to resolve "java.util.zip.ZipException:duplicate entry: org/apache/xmlbeans/xml/stream/Location.class" issue while hosting springboot in tomcat 10

I am trying to host spring boot rest api in Apache Tomcat 10, but it is not getting hosted, I had placed my spring boot application in webapps-javaee folder, as tomcat 10 default support jakartaee
When I checked logs I am getting this err
23-Mar-2022 19:48:49.103 SEVERE [Catalina-utility-2] org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming Failed to migrate archive [webService-0.0.1-SNAPSHOT-exec.war]. Using the "-zipInMemory" option may help.
java.util.zip.ZipException: duplicate entry: org/apache/xmlbeans/xml/stream/Location.class
at java.util.zip.ZipOutputStream.putNextEntry(Unknown Source)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:228)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:229)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:200)
at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:166)
at org.apache.catalina.startup.HostConfig.migrateLegacyApp(HostConfig.java:1298)
at org.apache.catalina.startup.HostConfig$MigrateApp.run(HostConfig.java:2048)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.migrateLegacyApps(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1757)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:316)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1162)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1365)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1369)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1347)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
my Spring boot application is working fine in tomcat 9, but for tomcat 10 it is giving this error
You have to convert the war file manually, go to https://tomcat.apache.org/download-migration.cgi and download the migration tool, then run the command java -jar jakartaee-migration-1.0.0-shaded.jar -zipInMemory oldFile.war newFile.war, the -zipInMemory option will take care of duplicated files in your war file, then you can put the new war file directly in the webapps folder.

Problem with dependencies in ResourceConfig on Jersey

I have a Jersey / Spring project (Project A : com.project.a) on Eclipse that depends on another (Project B : com.project.b).
Eclipse does not show any error on the projects until building and running the application on a local Tomcat server.
It throws this error:
SEVERE: StandardWrapper.Throwable
MultiException stack 1 of 1
java.lang.NoClassDefFoundError: com/project/b/SomeClassToRegister
at com.project.a.CustomApplication.<init>(CustomApplication.java:31)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1129)
at org.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:1009)
at org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:905)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:997)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:989)
at org.glassfish.jersey.server.ApplicationHandler.createApplication(ApplicationHandler.java:340)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:319)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:336)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1228)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5449)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5747)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.project.b.SomeClassToRegister
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1955)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1798)
... 28 more
Jul 09, 2019 5:52:13 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [com.project.a.CustomApplication] in web application [/someApplication] threw load() exception
java.lang.ClassNotFoundException: com.project.b.SomeClassToRegister
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1955)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1798)
at com.project.a.CustomApplication.<init>(CustomApplication.java:31)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1129)
at org.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:1009)
at org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:905)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:997)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:989)
at org.glassfish.jersey.server.ApplicationHandler.createApplication(ApplicationHandler.java:340)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:319)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:336)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1228)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5449)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5747)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
CustomApplication extends org.glassfish.jersey.server.ResourceConfig and is trying to register that class as follows:
public class CustomApplication extends ResourceConfig {
public CustomApplication() {
// Specify packages of java code.
packages("com.project.a");
packages("com.project.b"); //>>> Line 30
register(com.project.b.SomeClassToRegister.class); //>>> Line 31
}
}
Interestingly, Line 30 calls the main package of com.project.b with no problem, but the code crashes on line 31. com.project.b.SomeClassToRegister exists on the dependency com.project.b .
After the error is shown, the welcome-file jsp page for the server is shown normally, but every endpoint throws the same NoClassDefFoundError error when accessed.
The build path of Project A has Project B as a listed dependency and Project B is also listed as part of the Web Deployment Assembly packaging of Project A.
I am currently running it on a local Tomcat server with the following resource configuration. I have tried to remove the duplicate appearance of Project B with the same result.
Am I missing anything about linking the two projects together that might be the cause of the error?
After fiddling a lot with the configurations of both projects, what worked for me was :
Go to Properties of Project A
Java Build Path
Source
Add folder src/main/java of Project B
Apply and close
Clean projects and run

Embedded Tomcat failed to scan

I work on Eclipse with an embedded Tomcat (8.0.24). I ran mvn clean package install and got a build success.
However, when I start tomcat by running a main method in Eclipse (as it's an embedded Tomcat), I got lots of error like :
mai 11, 2018 3:26:20 PM org.apache.tomcat.util.scan.StandardJarScanner processURLs
WARNING: Failed to scan [file:/C:/Users/username/.m2/repository/com/sun/xml/ws/jaxws-rt/2.1.7/saaj-impl.jar] from classloader hierarchy
java.io.FileNotFoundException: C:\Users\username\.m2\repository\com\sun\xml\ws\jaxws-rt\2.1.7\saaj-impl.jar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:188)
at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:65)
at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49)
at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:374)
at org.apache.tomcat.util.scan.StandardJarScanner.processURLs(StandardJarScanner.java:309)
at org.apache.tomcat.util.scan.StandardJarScanner.doScanClassPath(StandardJarScanner.java:266)
at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:229)
at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1888)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1116)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:765)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5138)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I listed some of the concerned .jar :
com\sun\xml\bind\jaxb-xjc\2.1.7\jsr173_1.0_api.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\activation.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\jaxb-impl.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\jaxb-api.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\activation.jar
com\sun\xml\bind\jaxb-impl\2.1.7\jaxb1-impl.jar
com\sun\xml\bind\jaxb-impl\2.1.7\jsr173_1.0_api.jar
com\sun\xml\bind\jaxb-impl\2.1.7\activation.jar
com\sun\xml\bind\jaxb-impl\2.1.7\jaxb-api.jar
com\sun\xml\messaging\saaj\saaj-impl\1.3.3\activation.jar
com\sun\xml\messaging\saaj\saaj-impl\1.3.3\saaj-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\stax-utils.jar
com\sun\xml\ws\jaxws-rt\2.1.7\streambuffer.jar
com\sun\xml\ws\jaxws-rt\2.1.7\stax-ex.jar
com\sun\xml\ws\jaxws-rt\2.1.7\activation.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jaxb-impl.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jaxb-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\resolver.jar
com\sun\xml\ws\jaxws-rt\2.1.7\woodstox.jar
com\sun\xml\ws\jaxws-rt\2.1.7\sjsxp.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jsr173_api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\saaj-impl.jar
com\sun\xml\ws\jaxws-rt\2.1.7\saaj-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jsr250-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jsr181-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jaxws-api.jar
javax\xml\soap\saaj-api\1.3\servlet.jar
javax\xml\soap\saaj-api\1.3\jax-qname.jar
javax\xml\soap\saaj-api\1.3\activation.jar
javax\xml\soap\saaj-api\1.3\jaxp-api.jar
I already deleted the content of repository in .m2 and eclipse->project->maven->update project->update project (and force update of snapshot/release).
I checked in the indicated locations and indeed those .jar don't exist. I am a maven's beginner so maybe my error is stupid...

Error Deploying a WAR file in tomcat 7.0.50

I had previously deployed a WAR file in tomcat installed on my local computer and it worked really fine. I am deploying the same WAR file on tomcat installed in my windows 2003 server and i get the following error. Below is my logfile.
INFO: Deploying web application archive C:\ProgramFiles\ApacheSoftwareFoundatio\Tomcat 7.0\webapps\xxxxxxx.war
Sep 17, 2014 9:40:33 AM org.apache.catalina.startup.ContextConfig beforeStart
SEVERE: Exception fixing docBase for context [/dstvNickGateway]
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\dstvNickGateway.war (The process cannot access the file because it is being used by another process)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:111)
at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:719)
at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:847)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:373)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Sep 17, 2014 9:40:33 AM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\dstvNickGateway.war (The process cannot access the file because it is being used by another process)
at org.apache.naming.resources.WARDirContext.setDocBase(WARDirContext.java:136)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5089)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Sep 17, 2014 9:40:33 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xxxxxx]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Error in resourceStart()
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5270)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Sep 17, 2014 9:40:33 AM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\dstvNickGateway.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dstvNickGateway]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
it seems there is already tomcat process running on your system. Try to kill java.exe from task manager and restart tomcat
Try to kill all processes that could be locking the war file and restart your Tomcat.
The error say The process cannot access the file because it is being used by another process. So it looks like you have another instance of Tomcat running. Kill all processes which may access the f
tomcat is probably trying to unpack your war file while it's still being transferred. stop the server while you're uploading the file to avoid it doing this. when you're done with the ftp, then restart the tomcat server and hopefully it'll all be ok.

error while deploy app with tomcat

I have developed an app and now am trying to deployed it on Tomcat. when I start start.bat file in Tomcat directory. My console doesn't display any errors and when I open log files, I see this error:
java.lang.ClassNotFoundException: com.sun.xmk.ws.transport.http.servlet.WSServletContextListener
On many forums people say that I didn't add jaxws-rt.jar lib. But I have added it. First I added it as a dependency in maven. After that I deleted the dependency and downloaded the library from official site and added it to my lib folder. This too didn't help. So how can I fix this error?
UPDATE
full stacktrace
SEVERE: Error configuring application listener of class
com.sun.xmk.ws.transport.http.servlet.WSServletContextListener
java.lang.ClassNotFoundException: com.sun.xmk.ws.transport.http.servlet.WSServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Instead of putting the jars in your app's WEB-INF/lib dir, put it under the lib dir under Tomcat install directory. That should fix the error.

Categories