ERROR org.codehaus.groovy.scriptom.UnsupportedVariantTypeException: 13 (d)
at groovysh_evaluate.run (groovysh_evaluate:6)
...
I have no idea what type 13 is.
Undeterred, I decided to try their Java sample code in Groovy. However, I
get an NPE on their first line, deep within CXF.
IWebsessionManager mgr = new
IWebsessionManager("http://localhost:18083/");
yields
java.lang.NullPointerException
at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:204)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
at
org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:65)
at org.virtualbox_3_0.VboxService.<init>(VboxService.java:37)
at
com.sun.xml.ws.commons.virtualbox_3_0.PortPool.getPort(IWebsessionManager.java:122)
at
com.sun.xml.ws.commons.virtualbox_3_0.IWebsessionManager.connect(IWebsessionManager.java:176)
at
com.sun.xml.ws.commons.virtualbox_3_0.IWebsessionManager.<init>(IWebsessionManager.java:156)
at vboxCOMsdkTest.run(vboxCOMsdkTest.groovy:8)
Not to be intimidated, I make sure that soapUI can make calls to the SDK.
Defending its record as the most easy-going piece of software ever created,
of course soapUI is able to call the VBox SDK. So, I know it's working.
I'm not sure why their Java class is failing to construct.
Well, fine, if soapUI can do it, I'm sure WSClient can. So, I create a
WSClient proxy. Unfortunately, VBox doesn't serve its WSDL over HTTP. It
is only available on the file system, and, worse yet, it is comprised of two
files. So, I hunted and hunted to finally figure out how to give WSClient a
local WSDL file, rather than a URL. What I came up with is
def wsdl = "file:///C:/Program Files/Sun/xVM
VirtualBox/sdk/bindings/webservice/vboxwebService.wsdl"
def proxy = new WSClient(wsdl.toString(), this.class.classLoader)
proxy.initialize()
Unfortunately, that gives another NPE:
java.lang.NullPointerException
at groovyx.net.ws.WSClient.getWsdl(WSClient.java:180)
at groovyx.net.ws.WSClient.initialize(WSClient.java:146)
at groovyx.net.ws.WSClient$initialize.call(Unknown Source)
at vboxCOMsdkTest.run(vboxCOMsdkTest.groovy:16)
So, I don't know if this is a problem with loading a local WSDL file, the
fact that there is an import within the WSDL file, or some other goofiness
along the lines of the other two problems with this SDK.
I have attached the WSDL files. Can anyone tell me what's wrong with these
WSDLs, from WSClient's perspective?
At the end of the day, though, I would be happy to access this SDK in any
way that works. If anyone knows why the first two attempts failed, I would
appreciate your input. If soapUI didn't work, I would suspect that
something's wrong with the SDK after three different failures. But soapUI
can do it. Why can't Groovy?
Thanks,
Lee Grey http://www.nabble.com/file/p25173211/vboxwebService.wsdl
vboxwebService.wsdl http://www.nabble.com/file/p25173211/vboxweb.wsdl
vboxweb.wsdl
--
View this message in context: http://www.nabble.com/Unable-to-load-WSDL-from-local-file-into-WSClient-%28the-VirtualBox-SDK-blues%29-tp25173211p25173211.html
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Would the UnsupportedVariantTypeException from Scriptom be considered a bug?
Thanks,
Lee
> http://www.nabble.com/file/p25173211/vboxwsdl.zip vboxwsdl.zip
>
--
View this message in context: http://www.nabble.com/Unable-to-load-WSDL-from-local-file-into-WSClient-%28the-VirtualBox-SDK-blues%29-tp25173211p25259282.html
I just did a simple test embedding the content of vboxwebService.wsdl
in vboxweb.wsdl and it worked using this script:
mport groovyx.net.ws.WSClient
@Grab(group='org.codehaus.groovy.modules', module='groovyws',
version='0.5.1-SNAPSHOT')
def getProxy(wsdl, classLoader) {
new WSClient(wsdl, classLoader)
}
def url = 'file:///Users/alleon/groovy/groovywstest/vboxweb.wsdl'
proxy = getProxy(url, this.class.classLoader)
proxy.initialize()
Cheers
Guillaume
--
PGP KeyID: 1024D/69B00854 subkeys.pgp.net
First of all, Grape failed:
Error grabbing Grapes -- [unresolved dependency:
org.codehaus.groovy.modules#groovyws;0.5.1-SNAPSHOT: not found]
So, I downloaded and copied groovyws-0.5.1-20090716.160141-3.jar into my
.groovy/lib directory. I commented out the @Grab line and tried again. I
couldn't even come close until I had copied the entire contents of
apache-cxf-2.2.3/lib into .groovy/lib.
I don't know if the problem is with my environment or with the way I
"embedded" vboxwebService.wsdl into vboxweb.wsdl, but here's what I get in
groovyconsole:
Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
URL
[jar:file:/C:/Documents%20and%20Settings/lgrey/.groovy/lib/cxf-2.2.3.jar!/META-INF/cxf/cxf.fixml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw
exception; nested exception is java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL
[jar:file:/C:/Documents%20and%20Settings/lgrey/.groovy/lib/cxf-2.2.3.jar!/META-INF/cxf/cxf.fixml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw
exception; nested exception is java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:826)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:885)
at
org.apache.cxf.bus.spring.BusExtensionPostProcessor$1.findExtension(BusExtensionPostProcessor.java:70)
at org.apache.cxf.bus.CXFBusImpl.getExtension(CXFBusImpl.java:73)
at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:67)
at org.apache.cxf.endpoint.ClientImpl.<init>(ClientImpl.java:146)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:253)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:196)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:175)
at
groovyx.net.ws.AbstractCXFWSClient.createClient(AbstractCXFWSClient.java:187)
at groovyx.net.ws.WSClient.initialize(WSClient.java:107)
at groovyx.net.ws.IWSClient$initialize$0.call(Unknown Source)
at vboxWSsdkTest.run(vboxWSsdkTest.groovy:10)
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor
threw exception; nested exception is java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 21 more
Caused by: java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
at
org.apache.cxf.common.util.PropertiesLoaderUtils.loadAllProperties(PropertiesLoaderUtils.java:71)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:224)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:219)
at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:109)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 23 more
Would you mind sending a copy of the combined WSDL file that worked for you,
so I can see how you combined them?
Do you have any idea what the exception means? I don't think I should have
to include all the CXF jars, so I think there's something very wrong with my
environment. I'm quite lost here. No idea why this is such a problem for
me. Thanks for testing the WSDL for me. If you have any idea how I can
recreate your success, I would be very grateful.
Thanks,
Lee
--
View this message in context: http://www.nabble.com/Unable-to-load-WSDL-from-local-file-into-WSClient-%28the-VirtualBox-SDK-blues%29-tp25173211p25286947.html