获取java.lang.NoClassDefFoundError:在Jboss上过滤异常

时间:2010-02-11 17:33:20

标签: java spring java-ee jboss

我一直在使用Tomcat 6进行我的所有应用程序开发和部署,但今天决定使用JBoss,因为它看起来更具可扩展性。

但是在我的eclipse上配置JBoss并部署我的应用程序后,我收到以下错误,

获取java.lang.NoClassDefFoundError:在Jboss上过滤异常

我在服务器类路径中添加了服务器库,错误消失了,但是仍然无法加载应用程序,因为spring没有初始化。

更新

现在我收到以下错误,应用程序在Tomcat 6中正常运行,这是我得到的堆栈跟踪,

2010-02-11 23:17:48,959 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/cric140].[action]] (http-127.0.0.1-8080-1) Servlet.service() for servlet action threw exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '/login' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:968)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:246)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:885)
    at org.springframework.web.struts.DelegatingActionProxy.getDelegateAction(DelegatingActionProxy.java:127)
    at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:109)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.indiagames.inrev.auth.IRAuthFilter.doFilter(IRAuthFilter.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)

似乎无法理解为什么spring无法加载,我在web.xml中有以下描述,

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring/*Context.xml</param-value>
</context-param>

1 个答案:

答案 0 :(得分:1)

检查classpath:spring/*Context.xml下每个xml文件中的所有spring bean配置是否已定义名为'/login'的bean。

如果spring bean xml定义文件位于jar文件中,请确保jar文件中的jar可用,并确保这些jar包含spring bean定义。