0 Replies Latest reply on Oct 31, 2005 11:41 AM by Juan Garcia Baldasano

    java.lang.NoClassDefFoundError

    Juan Garcia Baldasano Newbie


      Hi:

      After wasting all day trying to find out what is going on, it is time to ask for help. The issue: I get java.lang.NoClassDefFoundError even when the jar file is in web-inf\lib directory.

      I've got one web application called A.war that I want to deploy in jboss 3.2.6. I copy it to JBOSS_HOME\server\default\deploy and the unpacking process is successful. I type http://localhost:8080/A on the web explorer and start navigating through this webapp. The problem comes up when I generate a business action of my application; this action needs axis as a technological component. The class implementing that business action makes use of axis binding, so that in its internal process I get the error as shown below:

      AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
      faultSubcode:
      faultString: Failure trying to get the Call object; nested exception is:
      java.lang.NoClassDefFoundError: org/apache/axis/encoding/ser/BaseSerializerFactory
      faultActor:
      faultNode:
      faultDetail:

      Failure trying to get the Call object; nested exception is:
      java.lang.NoClassDefFoundError: org/apache/axis/encoding/ser/BaseSerializerFactory
      at es.liberty.institucional.services.cotizacion.CotizacionSoapBindingStub.createCall(CotizacionSoapBindingStub.java:440)
      at es.liberty.institucional.services.cotizacion.CotizacionSoapBindingStub.cotizacion(CotizacionSoapBindingStub.java:448)
      at es.liberty.institucional.servicios.struts.action.RiesgoAutosAction.cotizar(RiesgoAutosAction.java:499)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
      at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
      at com.cgey.j2ee.struts.base.BaseRequestProcessor.processActionPerform(BaseRequestProcessor.java)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NoClassDefFoundError: org/apache/axis/encoding/ser/BaseSerializerFactory
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:300)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(UnifiedLoaderRepository3.java:267)
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:163)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:186)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:136)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:171)
      at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:112)
      at org.apache.axis.deployment.wsdd.WSDDTypeMapping.getSerializer(WSDDTypeMapping.java:255)
      at org.apache.axis.deployment.wsdd.WSDDDeployment.deployMapping(WSDDDeployment.java:341)
      at org.apache.axis.deployment.wsdd.WSDDDeployment.getTypeMappingRegistry(WSDDDeployment.java:520)
      at org.apache.axis.configuration.FileProvider.getTypeMappingRegistry(FileProvider.java:287)
      at org.apache.axis.AxisEngine.getTypeMappingRegistry(AxisEngine.java:293)
      at org.apache.axis.MessageContext.getTypeMappingRegistry(MessageContext.java:419)
      at org.apache.axis.client.Call.getTypeMapping(Call.java:2066)
      at org.apache.axis.client.Call.registerTypeMapping(Call.java:2101)
      at org.apache.axis.client.Call.registerTypeMapping(Call.java:2127)
      at es.liberty.institucional.services.cotizacion.CotizacionSoapBindingStub.createCall(CotizacionSoapBindingStub.java:433)
      ... 45 more

      The quick answer: axis.jar is not on the web-inf\lib directory. It is there. I have also tried to leave it server\default\lib and it didn´t work either.

      It is very strange. It looks like it doesn't exist. I have tried everything and cannot think of anything else. Can anybody give me a hand?

      Thanks a lot,





      Juan.