Grails-Plugin-Consortium / grails-cxf

CXF Plugin for the Grails web framework
http://grails.org/plugin/cxf
38 stars 46 forks source link

wsdl-to-java errors #30

Closed zyro23 closed 9 years ago

zyro23 commented 11 years ago

i stumbled on some problems trying to use the wsdl-to-java script.

first, there seems to be a conflicting import of org.codehaus.groovy.tools.shell.util.HelpFormatter that throws an exception if i try to run the script. replacing that with org.apache.commons.cli.HelpFormatter seems to fix that.

second, something seems wrong with the argument parsing. e.g. passing --wsdl=/path/to/my/wsdl results in an error of wsdl2java itself not finding "sdl=/path/to/my/wsdl"

am i missing something or was the script maybe just not tested in recent releases (some comment in the script along the lines of "not fully tested" hints in that direction..)?

anyhow thanks for the great work with the plugin so far! soap life got much less painful :)

ctoestreich commented 11 years ago

Found the issue. Working on a solution.

zyro23 commented 11 years ago

awesome! thx for status update :)

ctoestreich commented 11 years ago

I wrote what I thought was a working solution, but I am seeing different results running from intellij vs command line. I posted a question to the grails nabble for help: http://grails.1312388.n4.nabble.com/Using-CliBuilder-amp-Grails-Script-Issues-td4644112.html

It seems to be working in IntelliJ, but not on the CL.

param_order

If I quote the params it seems to work fine

quoted_params

cofaria commented 11 years ago

Same problem here: Error executing script WsdlToJava: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.codehaus.groovy.tools.shell.util.HelpFormatter@29dd8664' with class 'org.codehaus.groovy.tools.shell.util.HelpFormatter' to class 'org.apache.commons.cli.HelpFormatter

Quoting params made no difference...

ctoestreich commented 11 years ago

@cofaria What version of grails and java are you using?

cofaria commented 11 years ago

Grails 2.2.4 jdk1.6.0_35

faraway commented 11 years ago

Same problem here. I replaced org.codehaus.groovy.tools.shell.util.HelpFormatter with org.apache.commons.cli.HelpFormatter and got the path problem. So instead of using grails wsdl-to-java "--wsdl=/Users/xxx/workspace/wsdl/Member.wsdl --mark --stacktrace --verbose", it seems working using grails wsdl-to-java "--w/Users/xxx/workspace/wsdl/Member.wsdl --mark --stacktrace --verbose" I'm using Grails 2.2.4 on a mac. Now I have a new problem of JDK 1.7(most likely) which causes

[java] javax.xml.transform.TransformerConfigurationException: FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present.
     [java]     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.setFeature(TransformerFactoryImpl.java:444)
     [java]     at com.sun.xml.bind.v2.util.XmlFactory.createTransformerFactory(XmlFactory.java:155)
     [java]     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createTransformerHandler(JAXBContextImpl.java:747)
     [java]     at com.sun.xml.bind.v2.runtime.unmarshaller.DomLoader$State.<init>(DomLoader.java:75)

Still working on it...

pescadorbob commented 10 years ago

Interesting, I find the same problem, which I'm fine quoting that. However, I'd like to present another issue that I see. If my wsdl has schema imports relative to the wsdl, I get a file not found. E.g. if my wsdl says:

image

then the error I receive is:

 [java] Caused by: java.io.FileNotFoundException: D:\work\echo\XtracElements.xsd (The system cannot find the file specified)

 [java]     at java.io.FileInputStream.open(Native Method)
 [java]     at java.io.FileInputStream.<init>(FileInputStream.java:138)
 [java]     at java.io.FileInputStream.<init>(FileInputStream.java:97)
 [java]     at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
 [java]     at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
 [java]     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:609)
 [java]     at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
 [java]     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:799)
 [java]     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
 [java]     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
 [java]     at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237)
 [java]     at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300)
 [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)

| Finished generating Java code for WSDL.

 D:\work\echo>grails wsdl-to-java "--wsdl=D:\work\XtracWeb\WebContent\WEB-INF\wsdl\Login.wsdl --exsh=true --impl --server  \
 --p=http://xmlns.fmr.com/systems/dev/xtrac/2004/06/=com.fmr.xtrac.classic69.producerservices.login"

and the files are in the same location as the main wsdl.