Embedded Tomcat failed to scan - java

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...

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

Jenkins cannot start process on Windows Slave

Jenkins build running on Windows slave throws following error when build starts:
Java.io.IOException: Cannot run program "tf" (in directory "c:\Jenkins\workspace\ProjectName-WindowsPhone"): CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessBuilder.start(Unknown Source)
What I tried:
1. specifying full path to the TF.exe
2. specifying path to the TF.exe in the PATH variable
3. setting PATH=. at the build process init stage
4. settings CLASSPATH=. at the build process init stage
5. setting CLASSPATH=. as environment variable on the slave.
TF.exe is resolved under Jenkins Slave service user in any directory, so it's not a problem of path to the TF.exe
Appreciate any help or thoughts on configuring Jenkins with Windows Slave and TFS.
Full error log is below (yes, it's Java stack trace ;))
$ tf workspaces -format:brief -server:https://cloudtfsname.visualstudio.com/DefaultCollection/ ********
java.io.IOException: Cannot run program "tf" (in directory "c:\Jenkins\workspace\ProjectName-WindowsPhone"): CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
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 hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)
at ......remote call to WindowsSlave(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
at hudson.remoting.Channel.call(Channel.java:752)
at hudson.Launcher$RemoteLauncher.launch(Launcher.java:916)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.plugins.tfs.TfTool.execute(TfTool.java:99)
at hudson.plugins.tfs.model.Server.execute(Server.java:120)
at hudson.plugins.tfs.model.Workspaces.getListFromServer(Workspaces.java:38)
at hudson.plugins.tfs.model.Workspaces.populateMapFromServer(Workspaces.java:50)
at hudson.plugins.tfs.model.Workspaces.exists(Workspaces.java:76)
at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:36)
at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:176)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
at hudson.model.Run.execute(Run.java:1750)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
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 hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)
"TF.exe is resolved under Jenkins Slave service user in any directory, so it's not a problem of path to the TF.exe"
You are not fully understanding how jenkins works. In fact the only env variables that are understanded are the global ones and the user one are not considered for clean builds.
There is no any magic in Jenkins You should have tried to set the PATH as a build stage, RESTART slave and then run the task.
another hint for anyone who comes across this:there are some known issues with jenkins plugins causing this.see JENKINS-22183, JENKINS-45128 or JENKINS-33159 for example...
or try Jenkins issue search

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.

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

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.

Categories