【发布时间】:2012-10-07 05:23:31
【问题描述】:
我使用 jboss6.1。当我尝试部署 web 应用程序时,它说尝试加载 spring 时找不到类。
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
错误是
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationListener
我把弹簧放在WEB/lib 中。那是错的吗?还是应该是别的?
感谢您的友好回复。让我感到困惑的是,我将弹簧罐放在了我的 webapp 的 WEB/lib 文件夹中。这还不够吗?
以下是 web.xml 和 jars。 (我把抓到的都放在spring3.1的dist文件夹中)
但我想知道可能是因为我使用 jboss 并且其中有一些特别之处?我谷歌了一些帖子类加载器,但不明白。
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="CMDB_WS_HOST" version="3.0">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>99999999</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>com.inspur.cmdb.system.StartupListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
web/lib 中的弹簧罐
org.springframework.aop-3.1.0.M2.jar
org.springframework.asm-3.1.0.M2.jar
org.springframework.aspects-3.1.0.M2.jar
org.springframework.beans-3.1.0.M2.jar
org.springframework.context.support-3.1.0.M2.jar
org.springframework.context-3.1.0.M2.jar
org.springframework.core-3.1.0.M2.jar
org.springframework.expression-3.1.0.M2.jar
org.springframework.instrument.tomcat-3.1.0.M2.jar
org.springframework.instrument-3.1.0.M2.jar
org.springframework.jdbc-3.1.0.M2.jar
org.springframework.jms-3.1.0.M2.jar
org.springframework.orm-3.1.0.M2.jar
org.springframework.oxm-3.1.0.M2.jar
org.springframework.test-3.1.0.M2.jar
org.springframework.transaction-3.1.0.M2.jar
org.springframework.web.portlet-3.1.0.M2.jar
org.springframework.web.servlet-3.1.0.M2.jar
org.springframework.web.struts-3.1.0.M2.jar
org.springframework.web-3.1.0.M2.jar
【问题讨论】:
-
您使用的是哪个版本的 Spring?你可以在你的类路径中发布这些 jar 包吗?
标签: spring jakarta-ee jboss