即便是新建的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 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
 http://www.springframework.org/schema/tx 
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>。。</beans>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:context="http://www.springframework.org/schema/context"
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/context
http://www.springframework.org/schema/context/spring-context-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"> <context:annotation-config />
<context:component-scan base-package="com.cubesoft" />
<!-- 配置sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
</bean> <!-- 配置事务管理器 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean> <!-- 配置HibernateTemplate -->
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate"
destroy-method="close">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</beans>
QQ是943940384 愿意者远程帮我改
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 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
 http://www.springframework.org/schema/tx 
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>。。</beans>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:context="http://www.springframework.org/schema/context"
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/context
http://www.springframework.org/schema/context/spring-context-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"> <context:annotation-config />
<context:component-scan base-package="com.cubesoft" />
<!-- 配置sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
</bean> <!-- 配置事务管理器 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean> <!-- 配置HibernateTemplate -->
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate"
destroy-method="close">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</beans>
QQ是943940384 愿意者远程帮我改
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
应该是少包了吧,事务管理的包
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
需要包jta.jar.
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
除了需要commons-dbcp-1.2-1.jar之外还需要commons-pool.jar这个包
但是奇怪的是:
1、服务器上JBOSS里的项目的lib里面是31个包,我本机的tomcat里面的项目的lib是34个包,多出三个包,我怀疑是包冲突导致的,于是我把tomcat的文件放到JBOSS里面去并且去掉那多余的是那个包刚好就可以了好像就是因为多了这三个包:jsf-api.jar jsf-impl.jar jstl-1.2.jar我的web工程里面的lib里面并没有这是那个包,用myEclipse6.5部署后在tomcat的webapps里的项目里的lib里就多了这三个包,我仿造JBOSS里的操作那样把那三个多余的删掉后重启tomcat还是404错误难道又不是这三个包导致的?到底是不是的啊????急死了,QQ是943940384 愿意者远程帮我改