Reputation: 366
I have set the java home and classpath correctly.ie. JAVA_HOME - C:\Program Files\Java\jdk1.7.0_21 I am trying to generate classes out of wsdl available via http. Executing below from command line ie. wsimport -keep http://www.webservicemart.com/uszip.asmx?WSDL The below is the exception ie. parsing WSDL...
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.apache.xerces.dom.CoreDocumentImpl.createElementNS(Unknown Source) at com.sun.xml.internal.bind.marshaller.SAX2DOMEx.startElement(SAX2DOMEx.java:148) at com.sun.tools.internal.ws.wsdl.parser.DOMBuilder.startElement(DOMBuilder.java:82) at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551) at com.sun.tools.internal.ws.wsdl.parser.WhitespaceStripper.startElement(WhitespaceStripper.java:94) at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
I have added jar in my classpath variables as well but still getting the same exception. Thanks in advance.
Upvotes: 1
Views: 1247
Reputation: 366
This was bug with JDK1.7.21 version. I upgraded the JDK to 1.7.51 pointing the JAVA_HOME to this new JDK, tried the command -> wsimport -keep http://www.webservicemart.com/uszip.asmx?WSDL Issue resolved.
Upvotes: 1