[groovy-user] GroovyWS issues and javolution include

12 views
Skip to first unread message

jst

unread,
Nov 12, 2009, 11:36:58 AM11/12/09
to us...@groovy.codehaus.org
I've setup a basic webservice class a la the groovyWS service pages
and have it working properly. Whenever I add the javolution.jar file
to my class file and try and run the same service I get a
java.lang.reflect.InvocationTargetException error.

It looks as if it has something to do with
Caused by: java.lang.LinkageError: loader constraint violation: loader
(instance of org/codehaus/groovy/tools/RootLoader
) previously initiated loading for a different type with name "org/
xml/
sax/InputSource"


I'm relatively new to Groovy so I'm not sure how to debug this.
It looks like some sort of XML jar library is loading and the
Javolution one will not work with it.
Any help would be appreciated..

Full Error Log:
Nov 10, 2009 11:29:15 PM
org.apache.cxf.common.injection.ResourceInjector invokePostConstruct
WARNING: method annotated by @PostConstruct throws exception when
invoked
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.cxf.common.injection.ResourceInjector.invokePostConstruct
(ResourceInjector.java:302)
at org.apache.cxf.common.injection.ResourceInjector.construct
(ResourceInjector.java:86)
at
org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister
(ExtensionManagerImpl.java:176)
at
org.apache.cxf.bus.extension.ExtensionManagerImpl.processExtension
(ExtensionManagerImpl.java:129)
at
org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment
(ExtensionManagerImpl.java:122)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.load
(ExtensionManagerImpl.java:114)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>
(ExtensionManagerImpl.java:83)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>
(ExtensionManagerImpl.java:57)
at org.apache.cxf.bus.extension.ExtensionManagerBus.<init>
(ExtensionManagerBus.java:91)
at org.apache.cxf.bus.CXFBusFactory.createBus
(CXFBusFactory.java:41)
at org.apache.cxf.bus.CXFBusFactory.createBus
(CXFBusFactory.java:37)
at org.apache.cxf.bus.CXFBusFactory.createBus
(CXFBusFactory.java:33)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
at org.apache.cxf.BusFactory.getThreadDefaultBus
(BusFactory.java:106)
at org.apache.cxf.BusFactory.getThreadDefaultBus
(BusFactory.java:97)
at org.apache.cxf.endpoint.AbstractEndpointFactory.getBus
(AbstractEndpointFactory.java:73)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeServiceFactory
(AbstractWSDLBasedEndpointFa
ctory.java:228)
at
org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory
(ServerFactoryBean.java:157)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint
(AbstractWSDLBasedEndpointFactory.java
:99)
at org.apache.cxf.frontend.ServerFactoryBean.create
(ServerFactoryBean.java:117)
at groovyx.net.ws.WSServer.start(WSServer.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite
$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaM
ethodSite.java:229)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call
(PojoMetaMethodSite.java:52)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:121)
at SemanticService.run(SemanticService.groovy:19)
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable
(GroovyShell.java:255)
at groovy.lang.GroovyShell.run(GroovyShell.java:218)
at groovy.lang.GroovyShell.run(GroovyShell.java:147)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:493)
at groovy.ui.GroovyMain.run(GroovyMain.java:308)
at groovy.ui.GroovyMain.process(GroovyMain.java:294)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:111)
at groovy.ui.GroovyMain.main(GroovyMain.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader
(GroovyStarter.java:108)
at org.codehaus.groovy.tools.GroovyStarter.main
(GroovyStarter.java:130)
Caused by: java.lang.LinkageError: loader constraint violation: loader
(instance of org/codehaus/groovy/tools/RootLoader
) previously initiated loading for a different type with name "org/
xml/
sax/InputSource"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.codehaus.groovy.tools.RootLoader.oldFindClass
(RootLoader.java:152)
at org.codehaus.groovy.tools.RootLoader.loadClass
(RootLoader.java:124)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at org.apache.xml.resolver.readers.SAXCatalogReader.readCatalog
(SAXCatalogReader.java:251)
at org.apache.xml.resolver.Catalog.parseCatalog(Catalog.java:
681)
at org.apache.cxf.catalog.OASISCatalogManager.loadCatalogs
(OASISCatalogManager.java:108)
at
org.apache.cxf.catalog.OASISCatalogManager.loadContextCatalogs
(OASISCatalogManager.java:93)
at
org.apache.cxf.catalog.OASISCatalogManager.loadContextCatalogs
(OASISCatalogManager.java:89)
at org.apache.cxf.catalog.OASISCatalogManager.register
(OASISCatalogManager.java:81)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


tog

unread,
Nov 13, 2009, 8:13:10 PM11/13/09
to us...@groovy.codehaus.org
Hi
I am pretty sure the problem comes because javolution embeds some sax classes nevertheless
that would help to have a small test case just to make sure. Can you provide one ?

Guillaume
--
PGP KeyID: 1024D/69B00854  subkeys.pgp.net

http://cheztog.blogspot.com

Jeremy Silva

unread,
Nov 13, 2009, 8:21:49 PM11/13/09
to us...@groovy.codehaus.org
Sure thing!

1.) Download javolution.jar from http://javolution.org/.  I just got the latest version
2.) Setup a very simple test WSSERVER (anything that uses the WSServer will through the errors).
From the demo page

Mathservice.groovy
class MathService {
  double add(double arg0, double arg1) {
    return (arg0 + arg1)
  }
  double square(double arg0) {
    return (arg0 * arg0)
  }
}

testboom.groovy
import groovyx.net.ws.WSServer
def server = new WSServer()
server.setNode("MathService", "http://localhost:6980/MathService")
server.start()

3.) Add javolution.jar to classpath and try and fire up testboom.groovy.

4.) Is there anyway to prevent this?

Thanks!

Jeremy

tog

unread,
Nov 13, 2009, 9:42:53 PM11/13/09
to us...@groovy.codehaus.org
Well,

All come from the presence of those classes in the javolution jar. Remove them and everything will be fine.
I guess you may need to rebuild the jar as mentionned on the site

Regards
Guillaume

 inflated: org/xml/sax/AttributeList.class
 inflated: org/xml/sax/Attributes.class
 inflated: org/xml/sax/ContentHandler.class
 inflated: org/xml/sax/DocumentHandler.class
 inflated: org/xml/sax/DTDHandler.class
 inflated: org/xml/sax/EntityResolver.class
 inflated: org/xml/sax/ErrorHandler.class
 inflated: org/xml/sax/HandlerBase.class
 inflated: org/xml/sax/InputSource.class
 inflated: org/xml/sax/Locator.class
 inflated: org/xml/sax/Parser.class
 inflated: org/xml/sax/SAXException.class
 inflated: org/xml/sax/SAXNotRecognizedException.class
 inflated: org/xml/sax/SAXNotSupportedException.class
 inflated: org/xml/sax/SAXParseException.class
 inflated: org/xml/sax/XMLFilter.class
 inflated: org/xml/sax/XMLReader.class
Reply all
Reply to author
Forward
0 new messages