日期:2014-05-17  浏览次数:20833 次

SSH框架下的404错误
即便是新建的jsp文件在此工程下也会404错误。
web.xml里面关于struts及其过滤器的两段代码删除后就好了:它们是:
<!-- struts2的过滤器 -->
  <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中导入spring监听 -->
  <listener>
  <listener-class>
  org.springframework.web.context.ContextLoaderListener
  </listener-class>
  </listener>
tomcat启动时有error提示,我怀疑与错误有关系,提示如下:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cubeDateDictionaryEntriesDAOTarget' defined in file [F:\tomcat6.0\webapps\CubeEIS\WEB-INF\classes\applicationContext-dao.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager

这里面的applicationContext-dao.xml内容如下(第一个bean定义就是出问题的,我注释后就会提示第二个bean错误了):
<?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 &#xD;&#xA;http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&#xD;&#xA; http://www.springframework.org/schema/aop &#xD;&#xA;http://www.springframework.org/schema/aop/spring-aop-2.5.xsd&#xD;&#xA; http://www.springframework.org/schema/tx &#xD;&#xA;http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!--<bean id="cubeDateDictionaryDAOTarget"
class="com.cubesoft.project.dao.CubeDateDictionaryDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>-->
<bean id="cubeDateDictionaryEntriesDAOTarget"
class="com.cubesoft.project.dao.CubeDateDictionaryEntriesDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>
<bean id="cubeUserDAOTarget"
class="com.cubesoft.project.dao.CubeUserDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>
<bean id="cubeHardWareExpenDoTureDAOTarget"
class="com.cubesoft.project.dao.CubeHardWareExpenDoTureDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="hibernate