错误原因:我看不懂...
java 代码
- type?Exception?report ??
- ??
- message? ??
- ??
- description?The?server?encountered?an?internal?error?()?that?prevented?it?from?fulfilling?this?request. ??
- ??
- exception? ??
- ??
- javax.servlet.ServletException:?No?WebApplicationContext?found:?no?ContextLoaderListener?registered? ??
- ????org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545) ??
- ????org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486) ??
- ????org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) ??
- ????org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) ??
- ????org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) ??
- ????javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ??
- ????javax.servlet.http.HttpServlet.service(HttpServlet.java:803) ??
- ??
- ??
- root?cause? ??
- ??
- java.lang.IllegalStateException:?No?WebApplicationContext?found:?no?ContextLoaderListener?registered? ??
- ????org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:84) ??
- ????org.springframework.web.struts.DelegatingActionUtils.findRequiredWebApplicationContext(DelegatingActionUtils.java:122) ??
- ????org.springframework.web.struts.DelegatingActionProxy.getWebApplicationContext(DelegatingActionProxy.java:139) ??
- ????org.springframework.web.struts.DelegatingActionProxy.getDelegateAction(DelegatingActionProxy.java:120) ??
- ????org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:105) ??
- ????org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) ??
- ????org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) ??
- ????org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) ??
- ????org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) ??
- ????javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ??
- ????javax.servlet.http.HttpServlet.service(HttpServlet.java:803) ??
- ??
- ??
- note?The?full?stack?trace?of?the?root?cause?is?available?in?the?Apache?Tomcat/5.5.23?logs. ??
[b]web.xml:[/b]
java 代码
- <?xml?version="1.0"?encoding="UTF-8"?> ??
- <web-app?xmlns="http://java.sun.com/xml/ns/j2ee"?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?version="2.4"?xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee???http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> ??
- ??<servlet> ??
- ????<servlet-name>action</servlet-name> ??
- ????<servlet-class>org.apache.struts.action.ActionServlet</servlet-class> ??
- ????<init-param>??? ??
- ????????<param-name>contextConfigLocation</param-name>??? ??
- ????????<param-value>classpath:applicationContext.xml</param-value>??? ??
- ????</init-param> ??
- ????<init-param> ??
- ??????<param-name>config</param-name> ??
- ??????<param-value>/WEB-INF/struts-config.xml</param-value> ??
- ????</init-param> ??
- ???? ??
- ????<init-param> ??
- ??????<param-name>debug</param-name> ??
- ??????<param-value>3</param-value> ??
- ????</init-param> ??
- ????<init-param> ??
- ??????<param-name>detail</param-name> ??
- ??????<param-value>3</param-value> ??
- ????</init-param> ??
- ????<load-on-startup>0</load-on-startup> ??
- ??</servlet> ??
- ??<servlet-mapping> ??
- ????<servlet-name>action</servlet-name> ??
- ????<url-pattern>*.do</url-pattern> ??
- ??</servlet-mapping> ??
- </web-app> ??
[[b]struts-config.xml:[/b]
java 代码
- <?xml?version="1.0"?encoding="UTF-8"?> ??
- <!DOCTYPE?struts-config?PUBLIC?"-//Apache?Software?Foundation//DTD?Struts?Configuration?1.1//EN"?"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> ??
- ??
- <struts-config> ??
- ??<data-sources?/> ??
- ??<form-beans?> ??
- ????<form-bean?name="loginForm"?type="com.dn.struts.form.LoginForm"?/> ??
- ??
- ??</form-beans> ??
- ??
- ??<global-exceptions?/> ??
- ??<global-forwards?/> ??
- ??<action-mappings?> ??
- ????<action ??
- ??????attribute="loginForm"??
- ??????input="/form/login.jsp"??
- ??????name="loginForm"??
- ??????parameter="parm"??
- ??????path="/login"??
- ??????scope="request"??
- ??????type="org.springframework.web.struts.DelegatingActionProxy"?> ??
- ??????<forward?name="success"?path="/form/success.jsp"?/> ??
- ??????<forward?name="error"?path="/form/error.jsp"?/> ??
- ????</action> ??
- ??
- ??
- ??</action-mappings> ??
- ??
- ??<message-resources?parameter="com.dn.struts.ApplicationResources"?/> ??
- </struts-config> ??
[b]applicationContext.xml:[/b]
java 代码
- <?xml?version="1.0"?encoding="UTF-8"?> ??
- <!DOCTYPE?beans?PUBLIC?"-//SPRING//DTD?BEAN//EN"?"http://www.springframework.org/dtd/spring-beans.dtd"> ??
- ??
- <beans> ??
- ??
- ????<!--数据源datasource的声明--> ??
- ????<bean?id="dataSource"?class="org.apache.commons.dbcp.BasicDataSource"?destroy-method="close"> ??
- ????????<property?name="driverClassName"><value>oracle.jdbc.driver.OracleDriver</value></property> ??
- ????????<property?name="url"><value>jdbc:oracle:thin:@127.0.0.1:1521:datanew</value></property> ??
- ????????<property?name="username"><value>test</value></property> ??
- ????????<property?name="password"><value>test</value>???</property>????? ??
- ????</bean> ??
- ???? ??
- ????<!--Session?Factory声明--> ??
- ????<bean?id="sessionFactory"?class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> ??
- ????????<property?name="dataSource"> ??
- ????????????<ref?local="dataSource"?/> ??
- ????????</property> ??
- ????????<property?name="mappingResources"> ??
- ????????????<list> ??
- ????????????<value>com/dn/struts/entity/Login.hbm.xml</value> ??
- ????????????</list> ??
- ????????</property> ??
- ????????<property?name="hibernateProperties"> ??
- ????????????<props> ??
- ????????????????<prop?key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop> ??
- ????????????????<prop?key="hibernate.show_sql">true</prop> ??
- ????????????</props> ??
- ????????</property> ??
- ????</bean> ??
- ???? ??
- ????<!--定义一个hibernate?拦截器?--> ??
- ????<bean?id="hibernateInterceptor"?class="org.springframework.orm.hibernate3.HibernateInterceptor"> ??
- ????????<property?name="sessionFactory"> ??
- ????????????<ref?bean="sessionFactory"?/> ??
- ????????</property> ??
- ????</bean> ??
- ??
- ????<!--?hibernate?事务--> ??
- ????<bean?id="myTransactionManager"?class="org.springframework.orm.hibernate3.HibernateTransactionManager"> ??
- ????????<property?name="sessionFactory"> ??
- ????????????<ref?local="sessionFactory"?/> ??
- ????????</property> ??
- ????</bean> ??
- ???? ??
- ????<!--真正的DAO层--> ??
- ????<bean?id="basedaoTarget"?class="com.dn.dao.BaseDAO"> ??
- ????????<property?name="sessionFactory"> ??
- ????????????<ref?bean="sessionFactory"?/> ??
- ????????</property> ??
- ????</bean> ??
- ??
- ????<!--代理的DAO层?--> ??
- ????<bean?id="basedao"?class="org.springframework.aop.framework.ProxyFactoryBean"> ??
- ????????<property?name="proxyInterfaces"> ??
- ????????????<value>com.dn.dao.IBaseDAO</value> ??
- ????????</property> ??
- ????????<property?name="interceptorNames"> ??
- ????????????<list> ??
- ????????????????<value>hibernateInterceptor</value> ??
- ????????????????<value>basedaoTarget</value> ??
- ????????????</list> ??
- ????????</property> ??
- ????</bean> ??
- ???? ??
- ????<!--?真正的服务层?修改bean中id属性和class属性--> ??
- ????<bean?id="userServiceTarget"?class="com.dn.struts.service.UserService"> ??
- ????????<property?name="basedao"> ??
- ????????????<ref?bean="basedao"?/> ??
- ????????</property> ??
- ????</bean> ??
- ??
- ????<!--?代理的服务层?修改bean中id属性和ref中的bean的属性并且等于真正的服务层的bean的id属性--> ??
- ????<bean?id="userService"?class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> ??
- ????????<property?name="transactionManager"> ??
- ????????????<ref?bean="myTransactionManager"?/> ??
- ????????</property> ??
- ????????<property?name="target"> ??
- ????????????<ref?bean="userServiceTarget"?/> ??
- ????????</property> ??
- ????????<property?name="transactionAttributes"> ??
- ????????????<props> ??
- ????????????????<prop?key="get*">PROPAGATION_SUPPORTS</prop> ??
- ????????????????<prop?key="*">PROPAGATION_REQUIRED</prop> ??
- ????????????</props> ??
- ????????</property> ??
- ????</bean> ??
- ???? ??
- ????<!--?strtus控制器的配置?ref中的bean属性等于代理层中的bean中的id属性--> ??
- ????<bean?name="/login"?class="com.dn.struts.action.LoginAction"> ??
- ????????<property?name="iUserService"> ??
- ????????????<ref?bean="userService"?/> ??
- ????????</property> ??
- ????</bean> ??
- ???? ??
- </beans> ??
请各位大侠告诉小弟该怎么解决丫!还有我这种结构在ssh架构的基础上合理吗?
谢谢啦!...
[附件注释:项目的源代码.但是lib目录下面的jar包都没有.大家自己导入.我的开发工具是eclipse3.2.开发环境是struts1.1+Spring1.2 Core Libraries+Hibernate3.1 Core Libraries.数据库在applicationContext.xml文件中配置.当前数据库是oracle9i.数据库有3列.id是用序列自动增长的.]
1 楼
neitnaco
2007-10-25
为什么没人帮我解决呢..我都放好几天了耶..郁闷中...
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html