users@jax-ws.java.net

NullPointerException: charsetName

From: Mike Feldmeier <mfeldmeier_at_metadata.com>
Date: Fri, 18 Nov 2005 10:38:15 -0800

I have been unable to tell if this is a JAX-WS problem or a Stax problem (or maybe both). I have generated a doc/lit web service and have in JBoss. When I try to access it with the following code:

 

        ServiceFactory serviceFactory = ServiceFactory.newInstance();

        OutputService service = (OutputService)serviceFactory.createService((URL)null, OutputService.class);

        port = service.getOutputServicePort();

 

I get the following exception:

 

java.lang.NullPointerException: charsetName

      at java.io.InputStreamReader.<init>(Unknown Source)

      at com.bea.xml.stream.MXParserFactory.createXMLStreamReader(MXParserFactory.java:49)

      at com.sun.xml.ws.streaming.StAXReader.<init>(StAXReader.java:78)

      at com.sun.xml.ws.streaming.XMLReaderFactoryImpl.createXMLReader(XMLReaderFactoryImpl.java:41)

      at com.sun.xml.ws.streaming.XMLReaderFactoryImpl.createXMLReader(XMLReaderFactoryImpl.java:37)

      at com.sun.xml.ws.streaming.XMLReaderFactoryImpl.createXMLReader(XMLReaderFactoryImpl.java:29)

      at com.sun.xml.ws.wsdl.parser.WSDLParser.parse(WSDLParser.java:106)

      at com.sun.xml.ws.client.WebService.parseWSDL(WebService.java:104)

      at com.sun.xml.ws.client.WebService.preProcess(WebService.java:120)

      at com.sun.xml.ws.client.WebService.createEndpointIFBaseProxy(WebService.java:192)

      at com.sun.xml.ws.client.WebService.getPort(WebService.java:186)

      at com.sun.xml.ws.client.ServiceInvocationHandler.getPort(ServiceInvocationHandler.java:68)

      at com.sun.xml.ws.client.ServiceInvocationHandler.getXXXPort(ServiceInvocationHandler.java:48)

      at com.sun.xml.ws.client.ServiceInvocationHandler.invokeSIMethod(ServiceInvocationHandler.java:37)

      at com.sun.xml.ws.client.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:29)

      at $Proxy0.getOutputServicePort(Unknown Source)

      at com.metadata.output.client.impl.WSOutputClient.<init>(WSOutputClient.java:29)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

      at java.lang.reflect.Constructor.newInstance(Unknown Source)

      at com.metadata.output.client.OutputClientFactory.getClient(OutputClientFactory.java:40)

      at com.metadata.output.client.OutputClientFactory.main(OutputClientFactory.java:81)

 

It is occurring after I get the service, when I am retrieving the port. Apparently the InputStreamReader is being passed a null charsetName, and its explicit response is a NPE. I don’t see anything on the service where I can configure a character set. I’ve tried playing with the encoding in the XML header with no avail.

 

Could anyone point me in the right direction?

 

Thanks,

Mike

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 11/17/2005