7 Replies Latest reply on Dec 3, 2010 2:36 AM by marsim86

    Application with ws client return an exception with spring

    marsim86

      Hi,

       

      I got an application that runs over JBoss 6 M4, with Spring and JSF that works fine.

      But now I got other applicaction (that will run in the same server) that I have to install spring.  This application call to webservice and it do well, but when I put spring jar file (just only the file, without change the configurations), the application returns an exception:

       

      javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
      at javax.faces.component.MethodBindingMethodExpressionAdapter.i nvoke(MethodBindingMethodExpressionAdapter.java:102)
      at com.sun.faces.application.ActionListenerImpl.processAction(A ctionListenerImpl.java:102)
      at javax.faces.component.UICommand.broadcast(UICommand.java:315 )
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot. java:775)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRo ot.java:1267)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(Invok eApplicationPhase.java:82)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl. java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:31 2)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:324)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:242)
      at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.d oFilter(FilterDispatcher.java:63)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:274)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:242)
      at org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:275)
      at org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invok e(SecurityAssociationValve.java:181)
      at org.jboss.modcluster.catalina.CatalinaContext$RequestListene rValve.event(CatalinaContext.java:285)
      at org.jboss.modcluster.catalina.CatalinaContext$RequestListene rValve.invoke(CatalinaContext.java:261)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccCo ntextValve.java:88)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentVa lve.invoke(SecurityContextEstablishmentValve.java:93)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invok e(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
      at org.jboss.web.tomcat.service.request.ActiveRequestResponseCa cheValve.invoke(ActiveRequestResponseCacheValve.java:53)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:362)
      at org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:877)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:653)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:951)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
      at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFacto ry.getSpringBusFactory(JBossWSBusFactory.java:121)
      at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFacto ry.createBus(JBossWSBusFactory.java:54)
      at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)& lt; br /> at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.jav a:106)
      at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.jav a:97)
      at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate( ProviderImpl.java:62)
      at javax.xml.ws.Service.(Service.java:57)
      at diz.relev3.integ.sicof2.IntegSicof2.(IntegSicof2.jav a:43)
      at com.datinza.web.beans.PacienteBean.conexionGAIA(PacienteBean .java:190)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.el.parser.AstValue.invoke(AstValue.java:196)
      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionIm pl.java:276)
      at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMeth odExpression.java:98)
      at javax.faces.component.MethodBindingMethodExpressionAdapter.i nvoke(MethodBindingMethodExpressionAdapter.java:88)
      ... 30 more
      Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from BaseClassLoader@1069693{vfs:///C:/Desarrollo/jboss-6.0.0.201 00721-M4/server/default/conf/jboss-service.xml}
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(Bas eClassLoader.java:480)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      ... 47 more

       

      My code just call IngegSicof2 constructor, and as I said before it works fine if the spring isn't loaded.  I´ve configure correctly spring (unless as I think is the correct form) but the exception goes on.

       

       

      /**
       * This class was generated by the JAX-WS RI.
       * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
       * Generated source version: 2.2
       * 
       */
      //@WebServiceClient(name = "integ-sicof2", targetNamespace = "diz.relev3.integ.sicof2", wsdlLocation = "http://localhost:8080/integ_sicof2/servicios?wsdl")
      @WebServiceClient(name = "integ-sicof2", targetNamespace = "diz.relev3.integ.sicof2", wsdlLocation = "http://10.1.1.2:8080/integ_sicof2/servicios?wsdl")
      public class IntegSicof2
          extends Service
      {
      
          private final static URL INTEGSICOF2_WSDL_LOCATION;
          private final static WebServiceException INTEGSICOF2_EXCEPTION;
          private final static QName INTEGSICOF2_QNAME = new QName("diz.relev3.integ.sicof2", "integ-sicof2");
      
          static {
              URL url = null;
              WebServiceException e = null;
              try {
                  url = new URL("http://10.1.1.2:8080/integ_sicof2/servicios?wsdl");
                  
              } catch (MalformedURLException ex) {
                       e.printStackTrace();
                  e = new WebServiceException(ex);
              }
              INTEGSICOF2_WSDL_LOCATION = url;
              INTEGSICOF2_EXCEPTION = e;
          }
      
          public IntegSicof2() {
              super(__getWsdlLocation(), INTEGSICOF2_QNAME);
          }
       ... 
      }
      

       

      package diz.relev3.integ.sicof2;
      import java.net.MalformedURLException;
      import java.net.URL;
      import javax.xml.namespace.QName;
      import javax.xml.ws.Service;
      import javax.xml.ws.WebEndpoint;
      import javax.xml.ws.WebServiceClient;
      import javax.xml.ws.WebServiceException;
      import javax.xml.ws.WebServiceFeature;
      /**
      * This class was generated by the JAX-WS RI.
      * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
      * Generated source version: 2.2
      *
      */
      //@WebServiceClient(name = "integ-sicof2", targetNamespace = "diz.relev3.integ.sicof2", wsdlLocation = "http://localhost:8080/integ_sicof2/servicios?wsdl")
      //@WebServiceClient(name = "integ-sicof2", targetNamespace = "diz.relev3.integ.sicof2", wsdlLocation = "http://10.1.1.2:8080/integ_sicof2/servicios?wsdl")
      public class IntegSicof2
          extends Service
      {
          private final static URL INTEGSICOF2_WSDL_LOCATION;
          private final static WebServiceException INTEGSICOF2_EXCEPTION;
          private final static QName INTEGSICOF2_QNAME = new QName("diz.relev3.integ.sicof2", "integ-sicof2");
          static {
               System.out.println("URL url = null;");
              URL url = null;
              System.out.println(" WebServiceException e = null;");
              WebServiceException e = null;
              System.out.println("try");
              try {
                   System.out.println("url = new URL(\"http://10.1.1.2:8080/integ_sicof2/servicios?wsdl\");");
                  url = new URL("http://10.1.1.2:8080/integ_sicof2/servicios?wsdl");
                  System.out.println("Ha hecho la url ok.");
               
              } catch (MalformedURLException ex) {
                   System.out.println("catch (MalformedURLException ex) {");
                   e.printStackTrace();
                  e = new WebServiceException(ex);
              }
              System.out.println("INTEGSICOF2_WSDL_LOCATION = url;");
              INTEGSICOF2_WSDL_LOCATION = url;
              System.out.println("INTEGSICOF2_EXCEPTION = e;");
              INTEGSICOF2_EXCEPTION = e;
              System.out.println("He llegado al final del static");
          }
          public IntegSicof2() {
              super(__getWsdlLocation(), INTEGSICOF2_QNAME);
              System.out.println("super(__getWsdlLocation(), INTEGSICOF2_QNAME);");
          }
      /*
          public IntegSicof2(WebServiceFeature... features) {
              super(__getWsdlLocation(), INTEGSICOF2_QNAME, features);
          }
      */
          public IntegSicof2(URL wsdlLocation) {
              super(wsdlLocation, INTEGSICOF2_QNAME);
          }
      /*
          public IntegSicof2(URL wsdlLocation, WebServiceFeature... features) {
              super(wsdlLocation, INTEGSICOF2_QNAME, features);
          }
      */
          public IntegSicof2(URL wsdlLocation, QName serviceName) {
              super(wsdlLocation, serviceName);
          }
      /*
          public IntegSicof2(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
              super(wsdlLocation, serviceName, features);
          }
      */
          /**
           *
           * @return
           *     returns IntegSicof2SOAP
           */
          //@WebEndpoint(name = "integ-sicof2SOAP")
          public IntegSicof2SOAP getIntegSicof2SOAP() {
              return super.getPort(new QName("diz.relev3.integ.sicof2", "integ-sicof2SOAP"), IntegSicof2SOAP.class);
          }
          /**
           *
           * @param features
           *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
           * @return
           *     returns IntegSicof2SOAP
           */
          //@WebEndpoint(name = "integ-sicof2SOAP")
          public IntegSicof2SOAP getIntegSicof2SOAP(WebServiceFeature... features) {
              return super.getPort(new QName("diz.relev3.integ.sicof2", "integ-sicof2SOAP"), IntegSicof2SOAP.class, features);
          }
          private static URL __getWsdlLocation() {
              if (INTEGSICOF2_EXCEPTION!= null) {
                  throw INTEGSICOF2_EXCEPTION;
              }
              return INTEGSICOF2_WSDL_LOCATION;
          }
      }

       

       

      This class was generated automaticaly by the JAX-WS, and I try to quit annotations and other changes, but nothing.

       

      An other thing that I don`t understand is although I put the call into try/catch block, the exception is not catched, and it goes up until the navigator.

      I think the exception isn't launched by webservice call, but if it don't launch the exception, what do it?, when I debug (and the stacktrace says the same) the exception appears when this code line is executed.

       

      I will be very grateful with any help, I think I will go mad.