当前位置:编程学习 > JAVA >>

SSH框架整合 tomcat启动报错的异常

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: com.accp.action.InformationsAction; nested exception is java.io.FileNotFoundException: class path resource [com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:180)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:132)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:584)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:405)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.io.FileNotFoundException: class path resource [com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:141)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:45)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:82)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:110)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:85)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:176)
... 21 more
用的是注解注入

<struts>
<package name="project" extends="struts-default">
<global-results>
<result>${result}</result>
<result name="error">${result}</result>
<result name="input">${result}</result>
<result name="login">/toLogin.jsp</result>
<result name="none">${result}</result>
</global-results>
<action name="info_*" class="informationsAction"/>
</package>
</struts>
下面是action
@Controller("informationsAction")
@Scope("prototype")
public class InformationsAction extends GenericAction{
/**
 * 
 */
private static final long serialVersionUID = 1L;
private IIformationsService infoservice;
private List<Informations> list;

@Autowired
public void setInfoservice(IIformationsService infoservice) {
this.infoservice = infoservice;
}

public List<Informations> getList() {
return list;
}

public void setList(List<Informations> list) {
this.list = list;
}

public String sel(){
list=infoservice.allinfor();
result="/index.jsp";
return SUCCESS;
}

GenericAction是工具类 --------------------编程问答-------------------- jar包加入了吗?

Caused by: java.io.FileNotFoundException: class path resource [com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist --------------------编程问答--------------------  class path resource [com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist

找不到类,很明显的错误 --------------------编程问答-------------------- xwork-core-2.。。.jar加到你的项目中去 --------------------编程问答-------------------- 少包吧com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist --------------------编程问答--------------------
引用 3 楼 fudongrifdr 的回复:
xwork-core-2.。。.jar加到你的项目中去

包是有的
struts2-core-2.1.8.1.jar
--------------------编程问答--------------------
引用 2 楼 ygycomon 的回复:
 class path resource [com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist

找不到类,很明显的错误

我用的是工具类没有调用这个类
怎么整 --------------------编程问答--------------------
引用 1 楼 huxiweng 的回复:
jar包加入了吗?

Caused by: java.io.FileNotFoundException: class path resource [com/opensymphony/xwork2/ActionSupport.class] cannot be opened because it does not exist

这个jar包名字是什么 --------------------编程问答--------------------
引用 5 楼 Yesm_ 的回复:
Quote: 引用 3 楼 fudongrifdr 的回复:

xwork-core-2.。。.jar加到你的项目中去

包是有的
struts2-core-2.1.8.1.jar

是xwork-core这个包呢 --------------------编程问答--------------------
引用 8 楼 fudongrifdr 的回复:
Quote: 引用 5 楼 Yesm_ 的回复:

Quote: 引用 3 楼 fudongrifdr 的回复:

xwork-core-2.。。.jar加到你的项目中去

包是有的
struts2-core-2.1.8.1.jar

是xwork-core这个包呢

\xwork-core-2.1.6.jar
这个的话也有噢
补充:Java ,  Eclipse
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,