使用spring中,出现深恶痛绝的Error listenerStart!!
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">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
applicationContext.xml在src下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/study" />
<property name="username" value="root" />
<property name="password" value="admin" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="mappingResources">
<list>
<value>/org/study/domain/hbm/Test1.hbm.xml</value>
<value>/org/study/domain/hbm/Test2.hbm.xml</value>
</list>
</property>
</bean>
</beans>
这样的话,启动tomcat便出现熟悉的:
2006-9-30 21:50:30 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2006-9-30 21:50:30 org.apache.catalina.core.StandardContext start
严重: Context [/yumen] startup failed due to previous errors
如果将applicationContext当中的:
<property name="mappingResources">
<list>
<value>/org/study/domain/hbm/Test1.hbm.xml</value>
<value>/org/study/domain/hbm/Test2.hbm.xml</value>
</list>
</property>
去掉就没有问题了,但是我确信目录没有错。
请问这是怎么回事??