Skip to main content

JDK 6 JAX-WS client throws java.lang.NullPointerException exception

9 replies [Last post]
dilipgowda
Offline
Joined: 2006-09-25

Hi there,
I have created a Web Service using start from WSDL, The web service client is throwing the following exception.
java.lang.NullPointerException
at com.sun.org.apache.xerces.internal.util.SymbolTable.hash(SymbolTable.java:196)
at com.sun.org.apache.xerces.internal.util.SymbolTable.addSymbol(SymbolTable.java:121)
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getNamespaceURI(XMLStreamReaderImpl.java:1277)
at com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.getNamespaceURI(TidyXMLStreamReader.java:226)
at com.sun.xml.internal.ws.wsdl.parser.ParserUtil.getQName(ParserUtil.java:56)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parsePortTypeOperationInput(RuntimeWSDLParser.java:511)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parsePortTypeOperation(RuntimeWSDLParser.java:500)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parsePortType(RuntimeWSDLParser.java:476)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:215)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:68)
at com.sun.xml.internal.ws.wsdl.WSDLContext.(WSDLContext.java:59)
at com.sun.xml.internal.ws.client.ServiceContextBuilder.build(ServiceContextBuilder.java:62)
at com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:125)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:52)
at javax.xml.ws.Service.(Service.java:57)
at org.dr.wsclient.AddEmployeeService.(AddEmployeeService.java:40)
at org.dr.emp.Employee.add(Employee.java:25)
at org.dr.emp.EmpFrame.btnOKActionPerformed(EmpFrame.java:265)
at org.dr.emp.EmpFrame.access$100(EmpFrame.java:18)
at org.dr.emp.EmpFrame$2.actionPerformed(EmpFrame.java:102)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Same error is thrown, if i try to test the web service in GlassFish.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jitu
Offline
Joined: 2003-06-14

Can you not use the JAX-WS 2.1.2 for the client side ? The following should help you to configure JAX-WS 2.1.x with JDK6.

https://jax-ws.dev.java.net/guide/Using_JAX_WS_2_1_with_JavaSE6.html

dilipgowda
Offline
Joined: 2006-09-25

Thanks for the help jitu, i will do that.

willy130683
Offline
Joined: 2008-03-11

Hi i´ve got the same Problem, but i´ve not the opportunity to change the wsdl because it is a build in WS of a BPEL product. Does using a newer JAX-WS Version help? Because in my case copying jaxws-api.jar and jaxb-api.jar of JAX-WS 2.1.3 to the endorsed directory didn´t help. Then the compiler can´t find other classes because the packages are diffrent in the rt.jar of the jre. I also tried a to reference .jar files of a newer xerces version because i read it can be a problem with the old 2.6.2 which is used in java, but there is the same problem with the package pathes of depending classes in rt.jar.

Please can somebody help me here i need this Service.

ramapulavarthi
Offline
Joined: 2004-06-01

Please file a bug with a testcase with wsdl. Which version of Glassfish are you using ?
When you say you have tried with Glassfish, is this a AppClient or something?
If not, unless your client is configured to use jax-ws jars in Glassfish, it might be using jax-ws runtime in JDK.
Can you try with standalone version of JAX-WS 2.1 (with JDK 5)and see if the problem still exists.

dilipgowda
Offline
Joined: 2006-09-25

Glassfish version: Sun Java System Application server PE 9.1

The Web Service has been deployed in this GlassFish server. But for web service client am using Java Swing apllication over JDK 6 .

I have uploaded the WSDL file.

dilipgowda
Offline
Joined: 2006-09-25

Can guide me on filing a bug? I dont know where to go about it.

vivekp
Offline
Joined: 2003-06-10

It is under Support of JAX-WS RI page. See https://jax-ws.dev.java.net/servlets/ProjectIssues.

dilipgowda
Offline
Joined: 2006-09-25

Hi there,
I filed a bug with issue# 423. Mean while is there any workaround for this?

regards,
dilip

blerik
Offline
Joined: 2007-09-27

JAX-WS has a problem with default namespaces. The wsdl you supply uses default namespaces to refer to the messages:






Just add emp: before request and response and to the binding and the service as well and it should work.

The final wsdl should look like:

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://dr.com/wsdl/company"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://www.w3.org/2001/XMLSchema/"
xmlns:emp="http://dr.com/wsdl/company"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CompanyWSDL"
targetNamespace="http://dr.com/wsdl/company">

xmlns:ns="http://xml.dr.org/schema/Employee"
targetNamespace="http://dr.com/wsdl/company">
schemaLocation="http://DEVIKA:8080/CompanyWS/addEmployeeService/__container$publ
ishing$subctx/WEB-INF/wsdl/CompanyWS/employee_for_wsdl.xsd"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>




















transport="http://schemas.xmlsoap.org/soap/http"/>










location="http://DEVIKA:8080/CompanyWS/addEmployeeService"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>