Skip to main content

wsimport ant task

8 replies [Last post]
fmarceau
Offline
Joined: 2005-07-28

[wsimport] java.lang.NoClassDefFoundError: com/sun/tools/ws/WsImport
[wsimport] Exception in thread "main"
[wsimport] Command invoked: wsimport "C:\Program Files\Java\jre1.5.0_04\bin\java.exe" com.sun.tools.ws.WsImport -d "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\build" -g -keep -s "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\src\main" http://localhost:8080/AddressValidationWS/AddressValidationWS?wsdl -b "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\etc\custom-client.xml" -b "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\etc\custom-schema.xml"

BUILD FAILED
C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\build.xml:77: wsimport failed

There's no way to specify a classpath ?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fmarceau
Offline
Joined: 2005-07-28

doesn't change anything. I had to use jvmarg "-cp bla;bla;bla" to get it work.

[wsimport] Exception in thread "main" javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found

should be: com.xml.stream.MXParserFactory ?

kohlert
Offline
Joined: 2003-06-16

If you look at the samples included with JAX-WS, you can see how we use the wsimport ant task and how the classpath is set up. The ant task is defined in samples/etc/commmon-targets.xml file.

fmarceau
Offline
Joined: 2005-07-28

Another question... why jax-ws is using com.bea.xml.stream.MXParserFactory which is not part of jax-ws ?

[wsimport] Exception in thread "main" javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
[wsimport] at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
[wsimport] at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
[wsimport] at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
[wsimport] at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
[wsimport] at com.sun.xml.ws.streaming.StAXReader.getInputFactory(StAXReader.java:131)
[wsimport] at com.sun.xml.ws.streaming.StAXReader.(StAXReader.java:78)
[wsimport] at com.sun.xml.ws.streaming.XMLReaderFactoryImpl.createXMLReader(XMLReaderFactoryImpl.java:41)
[wsimport] at com.sun.xml.ws.streaming.XMLReaderFactoryImpl.createXMLReader(XMLReaderFactoryImpl.java:37)
[wsimport] at com.sun.xml.ws.streaming.XMLReaderFactoryImpl.createXMLReader(XMLReaderFactoryImpl.java:29)
[wsimport] at com.sun.tools.ws.processor.config.parser.Reader.validateInput(Reader.java:67)
[wsimport] at com.sun.tools.ws.processor.config.parser.Reader.parse(Reader.java:48)
[wsimport] at com.sun.tools.ws.wscompile.CompileTool.createConfiguration(CompileTool.java:508)
[wsimport] at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:264)
[wsimport] at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:43)
[wsimport] at com.sun.tools.ws.WsImport.main(WsImport.java:21)
[wsimport] Command invoked: wsimport "C:\Program Files\Java\jre1.5.0_04\bin\java.exe" -cp "C:/Program Files/Java/jaxws-2.0ea2/lib/jaxws-api.jar;C:/Program Files/Java/jaxws-2.0ea2/lib/jaxws-rt.jar;C:/Program Files/Java/jaxws-2.0ea2/lib/jaxws-tools.jar;C:\Program Files\Java\jaxws-2.0ea2\lib\jaxb-xjc.jar;C:\Program Files\Java\jaxws-2.0ea2\lib\saaj-impl.jar;C:\Program Files\Java\jaxws-2.0ea2\lib\jsr173_api.jar;C:\Program Files\Java\jaxws-2.0ea2\lib\jsr181-api.jar;C:/Program Files/Java/jdk1.5.0_04/lib/tools.jar" com.sun.tools.ws.WsImport -d "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\build" -g -keep -s "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\src\main" http://localhost:8080/AddressValidationWS/AddressValidationWS?wsdl -b "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\etc\custom-client.xml" -b "C:\Documents and Settings\fmarceau\Desktop\EclipseWorkspace\AddressValidationClient\etc\custom-schema.xml"

kohlert
Offline
Joined: 2003-06-16

do you have sjsxp.jar in your ant classpath?

fmarceau
Offline
Joined: 2005-07-28

yes

anyway there's no trace of com.bean.* in lib files from jax-ws EA 2.0

fmarceau
Offline
Joined: 2005-07-28

Fixed!

I cleaned it all. And reimport all libs in the project one by one and then it works.

Thanks

kohlert
Offline
Joined: 2003-06-16

That is good to hear. I was puzzled as to why you were seeing this. Thanks for the update!

kohlert
Offline
Joined: 2003-06-16

Use the classpath element in your taskdef for wsimport.