myeclipse struts2

NetMatrix 2010-04-02 11:06:26
我用myeclipse7.0配置struts2
web.xml内容如下
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>
</web-app>
只建一个小测试项目的话可以正常运行,但是如果再建一个项目的话运行Tomcat却出现以下错误,大家帮我看一下是什么原因,WEB-INF下的lib中并没有导入struts2-spring-plugin-2.0.6.jar
2010-4-2 22:58:36 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\StudySoftware\myeclipse\bin;D:\StudySoftware\Tomcat\Tomcat 6.0\bin
2010-4-2 22:58:36 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-4-2 22:58:36 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 592 ms
2010-4-2 22:58:36 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-4-2 22:58:36 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.20
2010-4-2 22:58:38 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2010-4-2 22:58:38 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2010-4-2 22:58:38 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2010-4-2 22:58:38 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts.xml]
2010-4-2 22:58:38 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.i18n.reload - old value: false new value: true
2010-4-2 22:58:38 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.configuration.xml.reload - old value: false new value: true
2010-4-2 22:58:41 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2010-4-2 22:58:41 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2010-4-2 22:58:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts.xml]
2010-4-2 22:58:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.i18n.reload - old value: false new value: true
2010-4-2 22:58:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.configuration.xml.reload - old value: false new value: true
2010-4-2 22:58:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Initializing Struts-Spring integration...
2010-4-2 22:58:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger fatal
严重: ********** FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION **********
Looks like the Spring listener was not configured for your web app!
Nothing will work until WebApplicationContextUtils returns a valid ApplicationContext.
You might need to add the following to web.xml:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
2010-4-2 22:58:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Dispatcher initialization failed
java.lang.NullPointerException
at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:209)
at .....................(内容过长省略不写了)
2010-4-2 22:58:42 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter Struts2
Class: com.opensymphony.xwork2.spring.SpringObjectFactory
File: SpringObjectFactory.java
Method: getClassInstance
Line: 209 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:209:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
............................(内容过长省略不写了)
Caused by: java.lang.NullPointerException
at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:209)
.............................(内容过长省略不写了)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
... 29 more
2010-4-2 22:58:42 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2010-4-2 22:58:42 org.apache.catalina.core.StandardContext start
严重: Context [/struts2_2] startup failed due to previous errors
2010-4-2 22:58:44 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2010-4-2 22:58:45 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2010-4-2 22:58:45 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/46 config=null
2010-4-2 22:58:45 org.apache.catalina.startup.Catalina start
信息: Server startup in 8626 ms
...全文
547 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧