title: Dynamic client using JaxWsDynamicClientFactory generates java.lang.IllegalArgumentException error
body: <p>I am a one more noobie in web service programming who faced an unknown error:</p>
  
  <p>I am trying to use JaxWsDynamicClientFactory in order to invoke dynamically the requested service (the address of the service and its parameters are read from a file, but this is irrelevant here). </p>
  
  <p>The problem is caused by this standard initialisation of JaxWsDynamicClientFactory. </p>
  
  <pre><code>JaxWsDynamicClientFactory dcf= JaxWsDynamicClientFactory.newInstance();
  </code></pre>
  
  <p>After execution of this line Karaf (Felix) returns the following error:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Can not set final com.sun.tools.internal.xjc
  .reader.internalizer.InternalizationLogic field com.sun.tools.internal.xjc.reade
  r.internalizer.DOMForest.logic to org.apache.cxf.endpoint.dynamic.DynamicClientF
  actory$1
          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(
  UnsafeFieldAccessorImpl.java:146)
          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(
  UnsafeFieldAccessorImpl.java:150)
          at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifie
  dObjectFieldAccessorImpl.java:65)
          at java.lang.reflect.Field.set(Field.java:657)
          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.hackInNewInterna
  lizationLogic(DynamicClientFactory.java:817)
          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
  amicClientFactory.java:314)
          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
  amicClientFactory.java:270)
          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
  amicClientFactory.java:263)
          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
  amicClientFactory.java:198)
          at testclient.BundleInvoker.invoke(BundleInvoker.java:53)
          at testclient.TestClient.activate(TestClient.java:67)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.j
  ava:236)
          at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.jav
  a:37)
          at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMetho
  d.java:613)
          at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:49
  6)
          at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod
  .java:149)
          at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImp
  lementationObject(ImmediateComponentManager.java:239)
          at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createCom
  ponent(ImmediateComponentManager.java:119)
          at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfie
  d.activate(AbstractComponentManager.java:1518)
          at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateIn
  ternal(AbstractComponentManager.java:550)
          at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(Abs
  tractComponentManager.java:261)
          at org.apache.felix.scr.impl.config.ImmediateComponentHolder.enableCompo
  nents(ImmediateComponentHolder.java:328)
          at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleC
  omponentActivator.java:158)
          at org.apache.felix.scr.impl.BundleComponentActivator.&lt;init&gt;(BundleCompo
  nentActivator.java:113)
          at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:261
  )
          at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:179)
  
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEv
  ent(BundleContextImpl.java:847)
          at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventM
  anager.java:230)
          at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchr
  onous(ListenerQueue.java:148)
          at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
  Privileged(Framework.java:1569)
          at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
  (Framework.java:1505)
          at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
  (Framework.java:1500)
          at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(Bundl
  eHost.java:391)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Abstrac
  tBundle.java:300)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(Di
  rectoryWatcher.java:1247)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(D
  irectoryWatcher.java:1219)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundle
  s(DirectoryWatcher.java:1208)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(Direct
  oryWatcher.java:503)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryW
  atcher.java:291)
  </code></pre>
  
  <p>In fact, I have no problem with the following execution (the program continue without any effect), but I would like to remove this nasty stack of errors from the screen. I tried to hide the error by try-catch environment, but Karaf simply ignores it (i.e., does not trigger catch part, although prints the whole stack). </p>
  
  <p><em>Could you help me to solve the problem (or at least help to understand why this simple line generates it)?</em> </p>
  
  <p>In general. Code is created in Eclipse Kepler, built with Maven 2, and executed in Karaf (felix). Here is the dependency part from the pom file:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;my.test.bundle&lt;/groupId&gt;
      &lt;artifactId&gt;test-interface&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
      &lt;artifactId&gt;org.apache.felix.framework&lt;/artifactId&gt;
      &lt;version&gt;1.8.0&lt;/version&gt;
      &lt;type&gt;bundle&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
      &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
      &lt;version&gt;1.4.0&lt;/version&gt;
      &lt;type&gt;bundle&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
      &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
      &lt;version&gt;2.7.8&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>