4 Replies Latest reply on Nov 7, 2006 8:24 AM by smilidon

    Problems consuming a Web Service

    rkisilenko2

      Hello,

      I'm trying to implement JSR-181 EJB webservice. It deploys fine, but when I trying to access it from client-side, I'm getting following Exception at client-side:

      java.lang.NoSuchFieldError: fFeatures
       at org.jboss.xb.binding.parser.xni.XniJBossXBParser$ParserConfiguration.configurePipeline(XniJBossXBParser.java:459)
       at org.apache.xerces.parsers.DTDConfiguration.reset(Unknown Source)
       at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
       at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.xni.XniJBossXBParser.parse(XniJBossXBParser.java:192)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:151)
       at org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory.parse(JavaWsdlMappingFactory.java:79)
       at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:73)
       at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:96)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
       at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:142)
       at session.SessionUnitTest.testLogin(SessionUnitTest.java:21)
      ...
      I have spend many hours trying to find any info in User's Guide, Wiki and Forums. But found nothing and still unable to resolve the problem. It seems error happens even before client connects to a web service.

      My web service code:
      package session;
      
      import javax.ejb.Stateless;
      import javax.jws.WebMethod;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      
      @WebService
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      @Stateless
      public class SessionBean implements Session {
      
       @WebMethod
       public void login() {
       System.out.println("call");
       }
      
      }

      My client code:
      ServiceFactoryImpl factory = new ServiceFactoryImpl();
       URL wsdlURL = new URL("http://localhost:8070/teststatelessendpoint/SessionBean?wsdl");
       URL mappingURL = new File("src-gen/jaxrpc-mapping.xml").toURL();
       QName qname = new QName("http://localhost:8070/teststatelessendpoint", "SessionBean");
       Service service = factory.createService(wsdlURL, qname, mappingURL);
       session.jaws.SessionBean port = (session.jaws.SessionBean)service.getPort(session.jaws.SessionBean.class);
       port.login();

      Possibly I'm missing something very simple or obvious. Hope for your help.

      Thank you in advance for your help,
      Roman

        • 1. Re: Problems consuming a Web Service
          rkisilenko2

          Hello all,

          I've resolved the problem. Possibly it will be interesting to others, so I'll explain the solution.

          I was running web service client from EJB3 project in Eclipse. JBoss Eclipse IDE 1.5.1 GA uses it's own set of AOP libraries instead of pulling them from JBoss runtime configuration. This set of libraries contains outdated jboss-commons.jar. This outdated jar in turn contains binaries for org.jboss.xb package which are incompatible with jboss-ws. So there was two ways to solve the problem:

          1. Move Eclipse IDE AOP library to the end of classpath.
          2. Replace preconfigured AOP library by manually adding relevant jars into classpath.

          Possibly it is worth including this information in Wiki. Possibly it is worth opening a bug on JBoss Eclipse IDE. Possibly this information is not of great use. I think this is up to JBoss developers to decide.

          Regards,
          Roman

          • 2. Re: Problems consuming a Web Service
            heiko.braun
            • 3. Re: Problems consuming a Web Service
              smilidon

              hi,

              i get this error in jboss eclipse ide 2.0 beta 2, too. can somebody explain how to use this workaround please?

              thx

              • 4. Re: Problems consuming a Web Service
                smilidon

                i tried jboss 4.0.5GA with JBossWS-1.0.3.GA with jboss-xml-binding.jar RC6 and RC7

                i also tried jboss 4.0.5GA with JBossWS-1.0.1.GA(original jboss-xml.binding.jar)

                what is the right JBossWS Version for jboss 4.0.5GA, and what jboss-xml-binding.jar do I have to use? i'm confused... but the error seems to be a conflict of the jboss-xml-binding.jar and xerces. Can somebody help please?