当前位置: 首页 > 知识库问答 >
问题:

Amazon linux+java 1.8+tomcat8错误

农弘毅
2023-03-14

我使用EC2 amazon linux+Java1.8+Tomcat8。安装程序如下:

yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
yum install tomcat8-webapps tomcat8-admin-webapps 

但是我的spring mvc示例程序不工作,Tomcat8的示例程序也不工作。

我不知道为什么。请帮帮我

18-Jul-2016 01:24:20.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.35
18-Jul-2016 01:24:20.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jun 10 2016 17:49:21 UTC
18-Jul-2016 01:24:20.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.35.0
18-Jul-2016 01:24:20.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
18-Jul-2016 01:24:20.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.4.11-23.53.amzn1.x86_64
18-Jul-2016 01:24:20.098 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
18-Jul-2016 01:24:20.098 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.10.amzn1.x86_64/jre
18-Jul-2016 01:24:20.098 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_91-b14
18-Jul-2016 01:24:20.098 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
18-Jul-2016 01:24:20.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/share/tomcat8
18-Jul-2016 01:24:20.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/share/tomcat8
18-Jul-2016 01:24:20.104 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/tomcat8
18-Jul-2016 01:24:20.104 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat8
18-Jul-2016 01:24:20.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=
18-Jul-2016 01:24:20.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/var/cache/tomcat8/temp
18-Jul-2016 01:24:20.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat8/conf/logging.properties
18-Jul-2016 01:24:20.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
18-Jul-2016 01:24:20.106 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: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
18-Jul-2016 01:24:20.266 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
18-Jul-2016 01:24:20.297 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Jul-2016 01:24:20.301 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
18-Jul-2016 01:24:20.302 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Jul-2016 01:24:20.309 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 899 ms
18-Jul-2016 01:24:20.356 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
18-Jul-2016 01:24:20.356 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.35
18-Jul-2016 01:24:20.406 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /var/lib/tomcat8/webapps/fwarnotice.war
18-Jul-2016 01:24:23.966 INFO [localhost-startStop-1] 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.
18-Jul-2016 01:24:24.021 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started
18-Jul-2016 01:24:24.167 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Mon Jul 18 01:24:24 UTC 2016]; root of context hierarchy
18-Jul-2016 01:24:24.245 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/context.xml]
18-Jul-2016 01:24:24.416 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization completed in 394 ms
18-Jul-2016 01:24:24.778 INFO [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'globalWeb': initialization started
18-Jul-2016 01:24:24.781 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'globalWeb-servlet': startup date [Mon Jul 18 01:24:24 UTC 2016]; parent: Root WebApplicationContext
18-Jul-2016 01:24:24.783 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/globalWeb-servlet.xml]
18-Jul-2016 01:24:25.249 INFO [localhost-startStop-1] org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler Root mapping to handler 'webConteroller'
18-Jul-2016 01:24:25.483 INFO [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'globalWeb': initialization completed in 705 ms
18-Jul-2016 01:24:25.499 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /var/lib/tomcat8/webapps/fwarnotice.war has finished in 5,092 ms
18-Jul-2016 01:24:25.502 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /var/lib/tomcat8/webapps/spring_mvc_test.war
18-Jul-2016 01:24:26.521 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[/spring_mvc_test]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
    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.NullPointerException
    at org.apache.jasper.servlet.TldScanner$TldScannerCallback.scanWebInfClasses(TldScanner.java:401)
    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:208)
    at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262)
    at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
    at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:103)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    ... 10 more

18-Jul-2016 01:24:26.523 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /var/lib/tomcat8/webapps/spring_mvc_test.war
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/spring_mvc_test]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
    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)

18-Jul-2016 01:24:26.524 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /var/lib/tomcat8/webapps/spring_mvc_test.war has finished in 1,022 ms
18-Jul-2016 01:24:26.526 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/docs
18-Jul-2016 01:24:26.774 INFO [localhost-startStop-1] 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.
18-Jul-2016 01:24:26.775 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/docs has finished in 249 ms
18-Jul-2016 01:24:26.776 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/sample
18-Jul-2016 01:24:27.070 INFO [localhost-startStop-1] 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.
18-Jul-2016 01:24:27.075 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/sample has finished in 299 ms
18-Jul-2016 01:24:27.077 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/host-manager
18-Jul-2016 01:24:27.327 INFO [localhost-startStop-1] 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.
18-Jul-2016 01:24:27.339 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/host-manager has finished in 262 ms
18-Jul-2016 01:24:27.344 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/manager
18-Jul-2016 01:24:27.595 INFO [localhost-startStop-1] 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.
18-Jul-2016 01:24:27.597 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/manager has finished in 253 ms
18-Jul-2016 01:24:27.598 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/ROOT
18-Jul-2016 01:24:27.849 INFO [localhost-startStop-1] 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.
18-Jul-2016 01:24:27.854 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 255 ms
18-Jul-2016 01:24:27.854 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/examples
18-Jul-2016 01:24:27.862 WARNING [localhost-startStop-1] org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'allowLinking' to 'true' did not find a matching property.
18-Jul-2016 01:24:27.879 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[/examples]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
    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.NullPointerException
    at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:322)
    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:183)
    at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1887)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1127)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5171)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    ... 10 more

18-Jul-2016 01:24:27.880 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory /var/lib/tomcat8/webapps/examples
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/examples]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
    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)

18-Jul-2016 01:24:27.881 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/examples has finished in 27 ms
18-Jul-2016 01:24:27.889 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
18-Jul-2016 01:24:27.901 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
18-Jul-2016 01:24:27.902 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 7592 ms

共有1个答案

姜玉泽
2023-03-14

您实际上遇到了Tomcat 8.0.35中的一个bug。Tomcat 8.0将不会以纯Spring MVC模板开始,并在org.apache.jasper.servlet.TldScanner$TldScannerCallback.ScanWebInfClasss中提供NPE的实际bug报告

快速的解决方案是升级到Tomcat 8.0.36,或者在应用程序的WEB-INF/CLASSES/META-INF下创建一个空的Manifest.mf文件。

 类似资料:
  • 我的项目是在Windows-SpringIDE-TomcatV8上进行的。0用于windows,MySql5。该项目还涉及java7、Tomcat7。我所有的课都是自动注释的。问题是,当我在Centos上部署project时,我有java8、Tomcat8和一个异常。请提出一些解决问题的建议。 以下是linux上的例外情况: 组织。springframework。豆。工厂BeanCreationE

  • 我正在使用Vagrant部署到Ubuntu Linux,并尝试启动服务。 然后我跟踪,发现: ?tomcat8.service-lsb:启动tomcat。加载:加载(/etc/init.d/tomcat8) active:失败(结果:exit-code)自2016-03-28 09:44:17 GMT;5s前 文档:人:systemd-sysv-generator(8) 进程:884 execst

  • 我一直在尝试使用python3.6创建基于amazonlinux的docker图像。到目前为止,我还不是很成功。我用 启动交互式docker终端。在终端内部,我运行“yum安装python36”,并看到以下错误消息。请注意,我从旧的基于amazonlinux的Dockerfile中复制了这个步骤。此Dockerfile用于工作。所以我暂停我看到下面的错误是由于亚马逊更新了他们的docker lin

  • 我正在将tomcat服务器从tomcat7升级到Tomcat8。但Struts1.1似乎不能在Tomcat8上工作。有人知道Tomcat8不支持Struts1.1吗。 下面是堆栈跟踪

  • Java控制面板说我Java更新45。终端说: java版本"1.7.0_17"。Eclipse使用1.70_17-b02。在终端和Eclipse中,我可以从Java1.7切换到1.8吗? 首先,我试图在Java首选项中进行更改,但在实用程序中缺少。然后我发现在Mac OS X上安装了Java7,但终端仍在使用版本6,并已运行 现在终端返回java版本"1.8.0_45",但Eclipse不启动:

  • 我正在尝试创建一个新的JavaFX项目。我已经安装了1.8,我相信其中包括javafx包。在终端中运行将显示。我从这里安装的 当我转到时,选择的版本是。列表中没有版本。如果选择add new,并导航到,我会看到: 没有版本。 如何将IntelliJ更新到用户版本?