You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by dchen <da...@gmail.com> on 2014/05/05 05:56:15 UTC

Karaf java.lang.IllegalArgumentException when using JaxWsDynamicClientFactory

Hi,

I am using JaxWsDynamicClientFactory to createWS client factory as follwing:

        JaxWsDynamicClientFactory wsClientFactory =
JaxWsDynamicClientFactory.newInstance();
        Client wsClient = wsClientFactory.createClient(wsAddress);

It runs fine outside of karaf, but when running in side karaf (2.3.1), it
throws the following error:


java.lang.IllegalArgumentException: Can not set final
com.sun.tools.internal.xjc.reader.internalizer.InternalizationLogic field
com.sun.tools.internal.xjc.reader.internalizer.DOMForest.logic to
org.apache.cxf.endpoint.dynamic.DynamicClientFactory$1
	at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
	at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
	at
sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifiedObjectFieldAccessorImpl.java:83)
	at java.lang.reflect.Field.set(Field.java:680)
	at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.hackInNewInternalizationLogic(DynamicClientFactory.java:817)
	at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:314)
	at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:235)
	at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:228)
	at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:183)

Does anyone know why?





--
View this message in context: http://cxf.547215.n5.nabble.com/Karaf-java-lang-IllegalArgumentException-when-using-JaxWsDynamicClientFactory-tp5743682.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Karaf java.lang.IllegalArgumentException when using JaxWsDynamicClientFactory

Posted by dchen <da...@gmail.com>.
Thanks Dan for the quick response. 



--
View this message in context: http://cxf.547215.n5.nabble.com/Karaf-java-lang-IllegalArgumentException-when-using-JaxWsDynamicClientFactory-tp5743682p5743726.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Karaf java.lang.IllegalArgumentException when using JaxWsDynamicClientFactory

Posted by Daniel Kulp <dk...@apache.org>.
There’s a problem with the DynamicClient with the in-JDK XJC things.   In general, it works OK outside of karaf as the jaxb-xjc jar gets picked up and the in-jdk version isn’t used.   In karaf, there’s an issue. 

I fixed this last week as part of commit cfda95f21681b4193ca9b8c3c5749b2c067aac15.

Dan


On May 4, 2014, at 11:56 PM, dchen <da...@gmail.com> wrote:

> Hi,
> 
> I am using JaxWsDynamicClientFactory to createWS client factory as follwing:
> 
>        JaxWsDynamicClientFactory wsClientFactory =
> JaxWsDynamicClientFactory.newInstance();
>        Client wsClient = wsClientFactory.createClient(wsAddress);
> 
> It runs fine outside of karaf, but when running in side karaf (2.3.1), it
> throws the following error:
> 
> 
> java.lang.IllegalArgumentException: Can not set final
> com.sun.tools.internal.xjc.reader.internalizer.InternalizationLogic field
> com.sun.tools.internal.xjc.reader.internalizer.DOMForest.logic to
> org.apache.cxf.endpoint.dynamic.DynamicClientFactory$1
> 	at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
> 	at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
> 	at
> sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifiedObjectFieldAccessorImpl.java:83)
> 	at java.lang.reflect.Field.set(Field.java:680)
> 	at
> org.apache.cxf.endpoint.dynamic.DynamicClientFactory.hackInNewInternalizationLogic(DynamicClientFactory.java:817)
> 	at
> org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:314)
> 	at
> org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:235)
> 	at
> org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:228)
> 	at
> org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:183)
> 
> Does anyone know why?
> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Karaf-java-lang-IllegalArgumentException-when-using-JaxWsDynamicClientFactory-tp5743682.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com