在web.xml中配置載入applicationContext.xml中總說找不到類?

xxxzheng發表於2006-03-20
11:53:49,541 INFO [/jsfDemo]:638 - Marking servlet SpringContextServlet as unavailable
11:53:49,556 ERROR [/jsfDemo]:667 - Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@12d3205
org.springframework.web.context.ContextLoaderServlet
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1034)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)

這是我每次重起伺服器不時候的異常資訊
web.xml
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
我也這樣寫是找不到這個類<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
applicationContext.xml.
<?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" destroy-method="close">
<property name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
<property name="url"><value>jdbc:jtds:sqlserver://192.168.60.214:1433/jobcn_boss_Tel</value></property>
<property name="username"><value>sa</value></property>
<property name="password"><value>develop</value></property>
</bean>
<bean id="teldao" class="jobcn.model.dao.jdbc.telDaoImpl">
<property name="dataSource"><ref bean="dataSource"/></property>
</bean>
<bean id="telservice" class="jobcn.model.service.impl.telServiceImpl">
<property name="teldao"><ref bean="teldao"/></property>
</bean>
</beans>

相關文章