

这两个项目的环境,包,配置,内容,完全都一模一样,为什么其中一个启动Tomcat要报错
其中一个项目是能运行的,没有问题,然而另一个就报这个错

web.xml配置
<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>
       <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>
applicationContext.xml配置如下
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName">
            <value>com.mysql.jdbc.Driver</value>
        </property>
        <property name="url">
            <value>jdbc:mysql://localhost:3306/hotel</value>
        </property>
        <property name="username">
            <value>root</value>
        </property>
        <property name="password">
            <value>mysql</value>
        </property>
    </bean>
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref local="dataSource" />
        </property>
        <property name="mappingResources">
            <list>
                <value>com/integration/entity/Order.hbm.xml</value>
                <value>com/integration/entity/Admin.hbm.xml</value>
                <value>com/integration/entity/Room.hbm.xml</value>
                <value>com/integration/entity/User.hbm.xml</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.MySQLDialect
                </prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    </bean>
    <bean id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>
不可能,明显的找不到实体类User
不能啊,其中一个项目是可以的
@LuoBaiLin: 你弄个比较工具比较下
这错误我之前也遇到过,写代码不细心造成的,忘了当时怎么解决的。