1 Reply Latest reply: Nov 21, 2011 2:12 PM by Sreejith K T RSS

Exception in thread "main" java.lang.NoSuchMethodError: com.sun.xml.bind.api.JAXBRIContext.newInstance([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;

Sreejith K T Newbie

Hi,

 

I am getting the below exception while invoking the Web Service

 

log4j:WARN No appenders could be found for logger (org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder).

log4j:WARN Please initialize the log4j system properly.

Exception in thread "main" java.lang.NoSuchMethodError: com.sun.xml.bind.api.JAXBRIContext.newInstance([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;

          at org.jboss.ws.metadata.acessor.JAXBAccessor$1.create(JAXBAccessor.java:67)

          at org.jboss.ws.metadata.acessor.JAXBAccessor$1.create(JAXBAccessor.java:54)

          at org.jboss.ws.metadata.umdm.ParameterMetaData.eagerInitialize(ParameterMetaData.java:470)

          at org.jboss.ws.metadata.umdm.OperationMetaData.eagerInitialize(OperationMetaData.java:466)

          at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitializeOperations(EndpointMetaData.java:516)

          at org.jboss.ws.metadata.umdm.EndpointMetaData.initializeInternal(EndpointMetaData.java:502)

          at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitialize(EndpointMetaData.java:490)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDataBuilder.java:292)

          at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:274)

          at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:200)

          at javax.xml.ws.Service.getPort(Service.java:116)

          at tutorial.hanbo.webservice.jaws.GreetingService.getGreetingPort(GreetingService.java:56)

          at tutorial.hanbo.webservice.Client.main(Client.java:10)

 

 

 

My Webservice is up and running and client code as follows, Please help

 

 

 

          GreetingService service = new GreetingService();

          tutorial.hanbo.webservice.jaws.Greeting echo = service.getGreetingPort();

 

 

    /* Set NEW Endpoint Location */

    String endpointURL = "http://dskt:8080/greeting/GreetingWebService?wsdl";

    BindingProvider bp = (BindingProvider)echo;

    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);

 

 

    System.out.println("Server said: " + echo.greetClient("Sreejith"));