在web.xml中配置加载applicationContext.xml中总说找不到类?

06-03-20 xxxzheng
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>

1
banq
2006-03-20 20:10
这是一个普通的无法找到类的问题。

你确保你的类在系统的classpath中,或者在J2EE服务器的内置classpath中即可。

猜你喜欢