启动时报错,怎么回事啊,看着像是过滤器错误,但是我跟老师用的是一样的啊

来源:2-2 Struts2 案例代码实现

Atheny

2016-11-17 22:59

跟着老师做的,用的一样的jar包,可是我的启动时报错:

怎么回事


十一月 17, 2016 10:51:03 下午 org.apache.catalina.core.StandardService startInternal

INFO: Starting service Catalina

十一月 17, 2016 10:51:03 下午 org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.72

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.TldConfig execute

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

十一月 17, 2016 10:51:07 下午 org.apache.catalina.core.StandardContext filterStart

SEVERE: Exception starting filter struts2

java.lang.ExceptionInInitializerError

at org.apache.struts2.dispatcher.ng.InitOperations.createDispatcher(InitOperations.java:110)

at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:73)

at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)

at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "xwork.loggerFactory" "read")

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)

at java.security.AccessController.checkPermission(AccessController.java:559)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1298)

at java.lang.System.getProperty(System.java:708)

at com.opensymphony.xwork2.util.logging.LoggerFactory.createLoggerFactory(LoggerFactory.java:84)

at com.opensymphony.xwork2.util.logging.LoggerFactory.getLoggerFactory(LoggerFactory.java:75)

at com.opensymphony.xwork2.util.logging.LoggerFactory.getLogger(LoggerFactory.java:56)

at org.apache.struts2.dispatcher.Dispatcher.<clinit>(Dispatcher.java:80)

... 15 more


十一月 17, 2016 10:51:07 下午 org.apache.catalina.core.StandardContext startInternal

SEVERE: One or more Filters failed to start. Full details will be found in the appropriate container log file

十一月 17, 2016 10:51:07 下午 org.apache.catalina.core.StandardContext startInternal

SEVERE: Context [/HelloWorld] startup failed due to previous errors

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory D:\Tomcat7\webapps\docs

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.TldConfig execute

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

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deployment of web application directory D:\Tomcat7\webapps\docs has finished in 111 ms

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory D:\Tomcat7\webapps\host-manager

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

SEVERE: The web application with context path [/host-manager] was not deployed because it contained a deployment descriptor [D:\Tomcat7\webapps\host-manager\META-INF\context.xml] which may include configuration necessary for the secure deployment of the application but processing of deployment descriptors is prevented by the deployXML setting of this host. An appropriate descriptor should be created at [D:\Tomcat7\conf\Catalina\localhost\host-manager.xml] to deploy this application.

十一月 17, 2016 10:51:07 下午 org.apache.catalina.core.ContainerBase addChildInternal

SEVERE: ContainerBase.addChild: start: 

org.apache.catalina.LifecycleException: Failed to start component [/host-manager]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)

at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:133)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:156)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the [/host-manager] Context cannot be started.

at org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:158)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

... 14 more


十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

SEVERE: Error deploying web application directory D:\Tomcat7\webapps\host-manager

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [/host-manager]

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)

at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:133)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:156)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)


十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deployment of web application directory D:\Tomcat7\webapps\host-manager has finished in 17 ms

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory D:\Tomcat7\webapps\JspViewListDemo2

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.TldConfig execute

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

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deployment of web application directory D:\Tomcat7\webapps\JspViewListDemo2 has finished in 128 ms

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory D:\Tomcat7\webapps\manager

十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

SEVERE: The web application with context path [/manager] was not deployed because it contained a deployment descriptor [D:\Tomcat7\webapps\manager\META-INF\context.xml] which may include configuration necessary for the secure deployment of the application but processing of deployment descriptors is prevented by the deployXML setting of this host. An appropriate descriptor should be created at [D:\Tomcat7\conf\Catalina\localhost\manager.xml] to deploy this application.

十一月 17, 2016 10:51:07 下午 org.apache.catalina.core.ContainerBase addChildInternal

SEVERE: ContainerBase.addChild: start: 

org.apache.catalina.LifecycleException: Failed to start component [/manager]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)

at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:133)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:156)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the [/manager] Context cannot be started.

at org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:158)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

... 14 more


十一月 17, 2016 10:51:07 下午 org.apache.catalina.startup.HostConfig deployDirectory

SEVERE: Error deploying web application directory D:\Tomcat7\webapps\manager

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [/manager]

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)

at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:133)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:156)

at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)


写回答 关注

3回答

  • 饮尽天下鸡汤
    2016-12-01 11:46:57

    http://img.mukewang.com/583f9cd40001361302990097.jpg最新的2.5.5中,这个类在org.apache.struts2.dispatcher.filter中,和老师讲的版本略有不同。

    <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>


  • java_forever
    2016-11-29 21:49:20

    如果是版本2.5以上 应该是这样配置的:rg.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

  • Atheny
    2016-11-17 23:02:04

    过滤器这样配的啊

    <filter>

      <filter-name>struts2</filter-name>

      <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>

      </filter>

      <filter-mapping>

      <filter-name>struts2</filter-name>

      <url-pattern>/*</url-pattern>  

      </filter-mapping>


Struts2入门

本教程带你踏上Struts2学习之旅,对Struts2进行更深入讲解

95062 学习 · 456 问题

查看课程

相似问题