Tomcat使用战争的JarResource部署它

时间:2018-12-05 18:18:17

标签: java tomcat

我有tomcat8。
我用JarResources元素声明了战争的上下文文件。
这场战争的部署失败了,因为其中一个jar与tomcat上下文中的jar发生冲突。 tomcat正在使用第一个jar部署战争。
我尝试在Loader中使用“委托”,但这没有帮助。

有一种方法可以配置tomcat,而在部署过程中它将仅使用其上下文中的库?

这是战争的背景:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context> <Resources>
<JarResources base="/usr/jars" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/lib"/><JarResources base="/usr/lib/zookeeper/lib" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/lib"/>
</Resources><Loader delegate="false"/></Context>

错误是:

SEVERE [localhost-startStop-1] 
org.apache.catalina.core.ContainerBase.addChildInternal 
ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component 
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/cmHadoop-919000]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:596)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1805)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(Ljava/lang/String;Ljava/io/InputStream;Z)Lorg/apache/jasper/xmlparser/TreeNode;
    at org.apache.jasper.runtime.TldScanner.scanTld(TldScanner.java:596)
    at org.apache.jasper.runtime.TldScanner.scanJar(TldScanner.java:453)
    at org.apache.jasper.runtime.TldScanner.scanJars(TldScanner.java:689)
    at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:350)
    at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:239)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
    ... 10 more


提前非常感谢!

0 个答案:

没有答案