在web.xml中配置載入applicationContext.xml中總說找不到類?
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>
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>
相關文章
- 說說在 Python 中如何匯入類Python
- websphere中web.xml配置WebXML
- web.xml 檔案 配置載入順序WebXML
- web.xml中的shiroFilter配置WebXMLFilter
- Tomcat 7 中 web 應用載入原理(二)web.xml 解析TomcatWebXML
- web.xml 中的listener、 filter、servlet 載入順序及其詳解WebXMLFilterServlet
- 擁抱 invokedynamic,在 Java agent 中馴服類載入器Java
- 說說在 Python 中,如何寫入檔案Python
- web.xml檔案配置的說明WebXML
- 關於java中的類載入器Java
- 簡說Spring中的資源載入Spring
- web.xml中的contextConfigLocation在spring中的作用WebXMLContextSpring
- 如何用程式碼修改struts中的web.xml配置WebXML
- 說說在 Spring 中,如何基於 XML 來配置事務SpringXML
- web.xml 的載入過程WebXML
- 在Spring Boot中從類路徑載入檔案解決方案Spring Boot
- 在web.xml中配置過濾器WebXML過濾器
- JVM中的類載入器子系統JVM
- 類載入機制總結
- 關於在Flutter Web中載入html(持續更新中......)FlutterWebHTML
- java專案中的classpath和類載入器Java
- Java類載入知識總結Java
- Java類載入機制總結Java
- 【轉載】ArcGIS中topolopy說明
- web.xml中的servlet相關WebXMLServlet
- 在JAVA中將Elasticsearch索引載入到Lucene APIJavaElasticsearch索引API
- 在 Python 中儲存和載入機器學習模型Python機器學習模型
- 在web.xml檔案中配置Servlet時,主要配置哪些資訊?WebXMLServlet
- 深入理解 Laravel 中 config 配置載入原理Laravel
- springboot怎麼載入yml中的配置項Spring Boot
- spring application.xml中載入配置檔案SpringAPPXML
- maven打包報錯:在類路徑或引導類路徑中找不到程式包 java.langMavenJava
- JVM之類載入機制總結JVM
- 載入常量-從檔案中載入
- 說說在 Python 中如何遍歷字典Python
- 說說在 Python 中,如何讀取檔案中的資料Python
- Swift中懶載入Swift
- java URLClassLoader 載入外部jar包中的指定的類JavaJAR