我在tomcat中部署war文件,我得到java.lang.ClassNotFoundException:oracle.i18n.util.LocaleMapper exception。
Tomcat Dockerfile定义了类路径
ENV JAVA_HOME /usr/jdk1.8.0_161
ENV CLASSPATH ${JAVA_HOME}/lib/orai18n-11.2.0.3.jar
在Docker实例中,接受类路径:
root@aa649d0d1b5e:/usr/local/tomcat# export
.....
declare -x CLASSPATH="/usr/jdk1.8.0_161/lib/orai18n-11.2.0.3.jar"
.....
以下是docker实例异常。
tomcat_1 | 06-Feb-2018 05:39:34.138 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
tomcat_1 | org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/abc]]
tomcat_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
tomcat_1 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
tomcat_1 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
tomcat_1 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
tomcat_1 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
tomcat_1 | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
tomcat_1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
tomcat_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
tomcat_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
tomcat_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
tomcat_1 | at java.lang.Thread.run(Thread.java:748)
tomcat_1 | Caused by: java.lang.NoClassDefFoundError: oracle/i18n/util/LocaleMapper
tomcat_1 | at oracle.xml.parser.v2.XMLReader.setEncoding(XMLReader.java:985)
tomcat_1 | at oracle.xml.parser.v2.XMLReader.checkXMLDecl(XMLReader.java:3367)
tomcat_1 | at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:575)
tomcat_1 | at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:279)
tomcat_1 | at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:240)
tomcat_1 | at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1521)
tomcat_1 | at org.apache.tomcat.util.descriptor.web.WebXmlParser.parseWebXml(WebXmlParser.java:119)
tomcat_1 | at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1114)
tomcat_1 | at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
tomcat_1 | at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
tomcat_1 | at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
tomcat_1 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5105)
tomcat_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
tomcat_1 | ... 10 more
tomcat_1 | Caused by: java.lang.ClassNotFoundException: oracle.i18n.util.LocaleMapper
tomcat_1 | at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
tomcat_1 | at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
tomcat_1 | ... 23 more
tomcat_1 |
tomcat_1 | 06-Feb-2018 05:39:34.153 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/loca
/tomcat/webapps/abc.war]
tomcat_1 | java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina
.StandardHost[localhost].StandardContext[/abc]]
tomcat_1 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
tomcat_1 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
tomcat_1 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
tomcat_1 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
tomcat_1 | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
tomcat_1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
tomcat_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
tomcat_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
tomcat_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
tomcat_1 | at java.lang.Thread.run(Thread.java:748)
tomcat_1 |
tomcat_1 | 06-Feb-2018 05:39:34.157 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/to
cat/webapps/abc.war] has finished in [8,864] ms
tomcat_1 | 06-Feb-2018 05:39:34.160 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/loca
/tomcat/webapps/host-manager]
我们非常感谢您解决此问题的任何帮助。
答案 0 :(得分:0)
您必须在库中包含orai18n-mapping.jar。
查看此博客: http://tomacree.blogspot.pe/2010/09/running-oracle-mapviewer-in-apache.html
你可以在JDev版本11.2中找到orai18n-mapping.jar(你可以下载Java版,它是一个112MB的zip文件,不需要安装)。
Jar位置:../ modules / oracle.nlsrtl_11.1.0 / orai18n-mapping.jar
JDev:http://www.oracle.com/technetwork/developer-tools/jdev/downloads/jdev11124download-1970562.html
以下是我的Google云端硬盘上的orai18n-mapping.jar:https://drive.google.com/open?id=1g3C-rEh0iTM6wxtivKueeVAumm04gmV1