* .war文件无法在Tomcat中创建任何内容的主要原因是什么?

时间:2017-12-25 12:28:13

标签: java maven tomcat war tomcat9

我尝试使用Oxalis,这是一种通过特定AS2协议发送和接收UBL文档的API。安装指南可在https://github.com/difi/oxalis找到。预先要求是Java 1.8,Maven 3.x和Tomcat 9.0。我的问题是,在安装指南的最后,我获得了一个oxalis.war文件(我已经尝试过其他指南,你可以在http://mmnclk.com/peppol-access-point-oxalis看到)。之后,我复制到Tomcat的webapps文件夹。但是当我启动Tomcat之后,正在创建oxalis文件夹。我希望在这个文件夹中看到不同的文件,但我只有META_INF和WEB_INF文件夹。这可能是什么原因?如果你们能帮助我,我会非常高兴。

编辑:在@slawek_k发布后,我得到了以下输出。

c:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps>jar tvf oxalis.war
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 META-INF/
   500 Mon Dec 25 12:34:16 GMT+03:00 2017 META-INF/MANIFEST.MF
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/no/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/no/difi/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/guice/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/servlet/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/lib/
  1831 Mon Dec 25 12:34:14 GMT+03:00 2017 WEB-INF/classes/logback-oxalis-inbound
.xml
  1614 Mon Dec 25 12:34:16 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/guice/OxalisInboundModule.class
   762 Mon Dec 25 12:34:16 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/OxalisGuiceContextListener.class
  1503 Mon Dec 25 12:34:16 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/servlet/HomeServlet.class
  2912 Mon Dec 25 12:34:16 GMT+03:00 2017 WEB-INF/classes/no/difi/oxalis/inbound
/servlet/StatusServlet.class
    87 Mon Dec 25 12:34:14 GMT+03:00 2017 WEB-INF/classes/reference.conf
  4467 Mon Dec 18 15:29:46 GMT+03:00 2017 WEB-INF/lib/aopalliance-1.0.jar
102291 Mon Dec 18 15:30:34 GMT+03:00 2017 WEB-INF/lib/bcmail-jdk15on-1.56.jar
685403 Mon Dec 18 15:30:44 GMT+03:00 2017 WEB-INF/lib/bcpkix-jdk15on-1.56.jar
3448507 Mon Dec 18 15:30:54 GMT+03:00 2017 WEB-INF/lib/bcprov-jdk15on-1.56.jar
 49742 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/brave-4.0.6.jar
132977 Mon Dec 18 15:31:12 GMT+03:00 2017 WEB-INF/lib/brave-core-4.0.6.jar
 10803 Mon Dec 18 15:31:22 GMT+03:00 2017 WEB-INF/lib/brave-http-4.0.6.jar
  9915 Mon Dec 18 15:31:22 GMT+03:00 2017 WEB-INF/lib/brave-web-servlet-filter-4
.0.6.jar
 80593 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/commons-certvalidator-2.1.
0.jar
 17576 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/commons-sbdh-0.9.4.jar
219554 Mon Dec 18 15:30:34 GMT+03:00 2017 WEB-INF/lib/config-1.2.1.jar
2521113 Mon Dec 18 15:30:46 GMT+03:00 2017 WEB-INF/lib/guava-21.0.jar
674028 Mon Dec 18 15:30:42 GMT+03:00 2017 WEB-INF/lib/guice-4.1.0.jar
 81866 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/guice-multibindings-4.1.0.
jar
 82179 Mon Dec 18 15:30:48 GMT+03:00 2017 WEB-INF/lib/guice-servlet-4.1.0.jar
  2497 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/javax.inject-1.jar
 16516 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/jcl-over-slf4j-1.7.24.jar
633290 Mon Dec 18 15:31:22 GMT+03:00 2017 WEB-INF/lib/joda-time-2.9.7.jar
310442 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/logback-classic-1.2.1.jar
473113 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/logback-core-1.2.1.jar
521157 Mon Dec 18 15:31:18 GMT+03:00 2017 WEB-INF/lib/mail-1.4.7.jar
 28773 Mon Dec 25 12:34:02 GMT+03:00 2017 WEB-INF/lib/oxalis-api-4.0.0-RC2.jar
 79435 Mon Dec 25 12:34:14 GMT+03:00 2017 WEB-INF/lib/oxalis-as2-4.0.0-RC2.jar
 74910 Mon Dec 25 12:34:12 GMT+03:00 2017 WEB-INF/lib/oxalis-commons-4.0.0-RC2.j
ar
 32676 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/peppol-common-0.9.7.jar
224405 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/peppol-evidence-0.9.7.jar
  4623 Mon Dec 18 15:30:32 GMT+03:00 2017 WEB-INF/lib/peppol-mode-0.9.7.jar
 29853 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/peppol-sbdh-0.9.7.jar
 24227 Mon Dec 18 15:31:10 GMT+03:00 2017 WEB-INF/lib/peppol-security-0.9.7.jar
 41205 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/slf4j-api-1.7.24.jar
164895 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/zipkin-1.19.2.jar
 30687 Mon Dec 18 15:29:32 GMT+03:00 2017 WEB-INF/lib/zipkin-reporter-0.6.12.jar

 10986 Mon Dec 18 15:31:12 GMT+03:00 2017 WEB-INF/lib/zipkin-sender-urlconnectio
n-0.6.12.jar
  2275 Mon Dec 25 12:34:18 GMT+03:00 2017 WEB-INF/web.xml
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 META-INF/maven/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 META-INF/maven/no.difi.oxalis/
     0 Mon Dec 25 12:34:18 GMT+03:00 2017 META-INF/maven/no.difi.oxalis/oxalis-i
nbound/
  6196 Wed Mar 01 05:17:12 GMT+03:00 2017 META-INF/maven/no.difi.oxalis/oxalis-i
nbound/pom.xml
   128 Mon Dec 25 12:34:18 GMT+03:00 2017 META-INF/maven/no.difi.oxalis/oxalis-i
nbound/pom.properties

编辑2:我有一些错误,我修复了它。但是在我的catalina.log记录中,如果你看看最后2行,我该怎么办?

INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/9.0.2
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Nov 25 2017 21:08:02 UTC
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         9.0.2.0
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 7
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.1
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_151\jre
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_151-b12
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Program Files\Apache Software Foundation\Tomcat 9.0
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 9.0
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\logging.properties
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 9.0
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp
INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_151\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;E:\app\admin\product\11.2.0\client_2;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files\Java\jdk-9.0.1;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\Apache Software Foundation\maven\bin;.]
INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-jsse-nio-443"]
INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1482 ms
INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.2
INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\oxalis.war]
INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

同时,正如您在以下链接中所看到的,我无法在Tomcat的管理器应用程序下的/ oxalis文件夹下启动应用程序。当我试图开始刷新页面时。

Manager App

注1:这是我在webapps文件夹中的oxalis文件夹。(这是在我将oxalis.war文件夹放入webapps后创建的)

My Oxalis Folder

编辑3:启动Tomcat服务器时,我得到了这个输出。

Tomcat Start Error

1 个答案:

答案 0 :(得分:0)

检查已创建.war文件的用户的环境。特别是许可权。 控制.war文件的内容。

jar tvf yourfile.war

所有文件的权限权限应与tomcat环境匹配。 检查正在运行的tomcat(tomcat或root)环境的权限,并将其与.war文件进行比较。