ssh整合报错 Unable to load configuration.struts2-core-2.1.2.jar!/struts-default.xml

cyc123007512 2010-04-19 01:45:04
struts2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<constant name="struts.ui.theme" value="simple"/>
<package name="logincode" extends="struts-default">
<action name="login" class="loginAction">
<result name="success">oo.jsp</result>
<result name="input">index.jsp</result>
<result name="error">index.jsp</result>
</action>
</package>
</struts>

applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:test/spring/hibernate.cfg.xml</value>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="mylogin" class="com.zoye.oa.service.Login"/>
<bean id="loginAction" class= "com.zoye.oa.action.LoginAction" scope="prototype">
<property name="login" ref="mylogin"/>
</bean>

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2.0 test xp1204</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

</web-app>


报错信息:
严重: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/D:/javaProgramFiles/tomcat-6.0.20/webapps/zoyeoa/WEB-INF/lib/struts2-core-2.1.2.jar!/struts-default.xml:46:178
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
...全文
826 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
naruto__ 2010-04-19
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 cyc123007512 的回复:]
谢谢各位的关注。加上两个包就可以了:
commons-io-1.3.2.jar
commons-fileupload-1.2.1.jar

<include file="struts-default.xml"/>这行我也去掉了
[/Quote]

恩,我也出现过这情况
cyc123007512 2010-04-19
  • 打赏
  • 举报
回复
谢谢各位的关注。加上两个包就可以了:
commons-io-1.3.2.jar
commons-fileupload-1.2.1.jar

<include file="struts-default.xml"/>这行我也去掉了
cyc123007512 2010-04-19
  • 打赏
  • 举报
回复
没有。配置文件里本来没写<include file="struts-default.xml"/>的,报一样的错。
[Quote=引用 4 楼 nokia5320xm 的回复:]
src下有没有这个文件struts-default.xml?
[/Quote]
NOKIA5320XM 2010-04-19
  • 打赏
  • 举报
回复
src下有没有这个文件struts-default.xml?
cyc123007512 2010-04-19
  • 打赏
  • 举报
回复
我的就是struts.xml,放在src下面
[Quote=引用 2 楼 liuchuan12 的回复:]
楼主把struts2.xml改成struts.xml这个才是默认的,放到工程的src文件夹下
[/Quote]
angel 2010-04-19
  • 打赏
  • 举报
回复
楼主把struts2.xml改成struts.xml这个才是默认的,放到工程的src文件夹下
loocao 2010-04-19
  • 打赏
  • 举报
回复
http://blog.csdn.net/yexianyi/archive/2009/02/18/3905836.aspx

67,513

社区成员

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

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