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

CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Hello all,

I am using CXFDosgi 1.4 ( 2.7.2 ) and Java 1.7.0_21.

I have a Junit test that contains the following code in the setUp() method: 

                        ProxyClassLoader classLoader = new
ProxyClassLoader();
			classLoader.addLoader(AdminService.class.getClassLoader());
			classLoader.addLoader(JAXRSClientFactoryBean.class.getClassLoader());	
			
			JSONProvider jsonProvider = new JSONProvider ();
			jsonProvider.setSingleJaxbContext(true);
			jsonProvider.setMarshallAsJaxbElement(true);
			jsonProvider.setUnmarshallAsJaxbElement(true);					
			
			Map<String, String> map = new HashMap<String, String> ();
			map.put ( "http://www.syntech.com", "something" );
			jsonProvider.setNamespaceMap(map);			
			
			JAXRSClientFactoryBean jaxRSBean = new JAXRSClientFactoryBean();
			jaxRSBean.setAddress(baseUrl + "AdminService");
			jaxRSBean.setClassLoader(classLoader);
			jaxRSBean.setProvider(jsonProvider);
			jaxRSBean.setServiceClass(AdminService.class);
			jaxRSBean.setUsername(USERNAME);
			jaxRSBean.setPassword(PASSWORD);
			jaxRSBean.getOutInterceptors().add(new LoggingOutInterceptor());
			jaxRSBean.getInInterceptors().add(new LoggingInInterceptor());
			
			
			
			adminService = jaxRSBean.create(AdminService.class,new Object());
                        
                        appRole = new ApplicationRole();
			appRole.setId("TestApplicationRoleId");
			appRole.setCreatedBy("TestCase");
			appRole.setName("Fleet Manager");
			appRole.setDesc("Fleet Manager");
			appRole.setCreatedTime(new Date());
			adminService.saveApplicationRole(appRole);

When running from Eclipse ( select unit test, Debug As, Junit Test ), my
test connects to the remote and processes fine. My Test passes. No Problems.

When I run my test from maven ( I am using Tycho Surefire Plugin
integration-test goal), my test does not run and contains the following
failure ( cause highlighted in bold ): 

*java.lang.NoClassDefFoundError:
com/sun/xml/bind/marshaller/NamespacePrefixMapper*
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:638)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:613)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:574)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
	at
org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
	at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:452)
	at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	at
org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.setNamespaceMapper(AbstractJAXBProvider.java:142)
	at
org.apache.cxf.jaxrs.provider.json.JSONProvider.marshal(JSONProvider.java:523)
	at
org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:367)
	at
org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1221)
	at
org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:399)
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:636)
	at
org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:976)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
	at
org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:581)
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:542)
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205)
	at com.sun.proxy.$Proxy21.saveApplicationRole(Unknown Source)
	at
org.syntech.ambassador.server.fuelmaster.services.integrationtest.AdminServiceTest.setUp(AdminServiceTest.java:72)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runners.Suite.runChild(Suite.java:127)
	at org.junit.runners.Suite.runChild(Suite.java:26)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
	at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
	at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
*Caused by: java.lang.ClassNotFoundException:
com.sun.xml.bind.marshaller.NamespacePrefixMapper cannot be found by
org.apache.cxf.cxf-api_2.7.2*
	at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

I have com.sun.xml.bind.marshaller as an imported package in my bundle.

As for my bundle start levels in my Tycho Test definition, so far I have the
following start levels defined:

                 <bundleStartLevel>
                        <bundle> 
                           
<id>org.apache.servicemix.specs.jsr339-api-m10</id>
                            <level>1</level>
                            <autoStart>true</autoStart>
                        </bundle>  
                        <bundle>
                            <id>org.apache.cxf.cxf-rt-core</id>
                            <level>2</level>
                            <autoStart>true</autoStart>
                        </bundle>         
                        <bundle>
                            <id>org.apache.cxf.cxf-rt-transports-http</id>
                            <level>2</level>
                            <autoStart>true</autoStart>
                        </bundle>
                         <bundle>
                            <id>org.apache.servicemix.bundles.jaxb-impl</id>
                            <level>4</level>
                            <autoStart>true</autoStart>
                        </bundle>
                  </bundleStartLevel>

Is there something obvious that I am missing?

Thanks in advance,
Neil



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Christian Schneider <ch...@die-schneider.net>.
Unfortunately newer versions of cxf will not be easier to install from 
scratch.
The main problem is that cxf replaces a lot of the jdk jaxws and jaxb 
functionality.
The reason why we do this is that the jdk version either have bugs, 
performance or security problems. I am not sure which exactly and if we 
could
for example keep more of the standard jdk stuff with newer jdk versions. 
I would be very glad if this is possible.

If you develop server applications then you should take a look at Apache 
Karaf. There we have a CXF feature that makes it really easy to install cxf.
In the server case it also makes sense to not use the tycho plugin and 
instead just use maven bundle plugin and standard maven builds.

For testing pax exam has proven to be very effective. It can also be 
used together with karaf.

Here you can find a tutorial for cxf with karaf.
http://www.liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi

Christian

Am 07.03.2014 15:02, schrieb NCorbet:
> Thanks Christian,
>
> I can try that, to clarify, when you say lower level do you mean earlier or
> later than CXF?
>
> This was my first inclination. It seems I always have issues with CXF and
> JaxB. Does the latest release of CXF address ( or make easier ) some of
> these issues?
>
>
> Neil
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5740958.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Sergey Beryozkin <sb...@gmail.com>.
I wonder if it is the very first version of
org.apache.servicemix.specs.jsr339-api-m10 that is causing the problems...

I recall there were some issues with it, can you try version 2.4.0 ?
Please also check

https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=osgi/karaf/features/src/main/resources/features.xml;h=3d2011e4c525cde7b0baffca2f22f406518b88fa;hb=HEAD

It is Karaf specific, but the way the levels are set can give some hint...

HTH, Sergey

On 12/03/14 14:16, NCorbet wrote:
> Sergey,
>
> In this case I am performing an integration test through a maven Tycho
> build. Basically, when the test runs it creates a mini osgi environment and
> loads bundles from the target environment and then runs the tests.
>
> I have had no experience with Karaf. We do produce a product as a result of
> our builds and I have had no ( major ) issues with getting CXF to expose my
> restful services. We have a client side product that consumes them as well
> with no major issues.
>
> I did get a similar integration test bundle built against one of our
> products that exposes soap services. This post: *
> http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-Jaxb-Classloader-issue-td5739840.html
> <http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-Jaxb-Classloader-issue-td5739840.html>
> * helped me resolve an issue I had with that one. These tests work very
> well.
>
> Now if I could get the pesky REST ones to work in a similar fashion I would
> be good to go.
>
> How do I get CXFDosgi with version 2.7.10? I see the 1.5 and 1.6 releases
> but they max out with cxf 2.7.8.
>
> Neil
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741164.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
Sergey,

In this case I am performing an integration test through a maven Tycho
build. Basically, when the test runs it creates a mini osgi environment and
loads bundles from the target environment and then runs the tests.

I have had no experience with Karaf. We do produce a product as a result of
our builds and I have had no ( major ) issues with getting CXF to expose my
restful services. We have a client side product that consumes them as well
with no major issues.

I did get a similar integration test bundle built against one of our
products that exposes soap services. This post: *
http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-Jaxb-Classloader-issue-td5739840.html
<http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-Jaxb-Classloader-issue-td5739840.html> 
* helped me resolve an issue I had with that one. These tests work very
well.

Now if I could get the pesky REST ones to work in a similar fashion I would
be good to go.

How do I get CXFDosgi with version 2.7.10? I see the 1.5 and 1.6 releases
but they max out with cxf 2.7.8.

Neil



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741164.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Christian Schneider <ch...@die-schneider.net>.
II think in equinox you do not need the start levels. More important are 
the system package exports.
The multibundle distro should contain these settings.

Christian

On 12.03.2014 14:10, Sergey Beryozkin wrote:
> Hi, May be you should follow the tutorial from Christian on setting it 
> in Karaf ?
>
> I honestly do not think there has to be a need to manually change the 
> levels; do you work with Felix or Equinox directly ? If yes and you've 
> upgraded to CXF 2.7.10 then as far as I recall the container 
> properties may need to be adjusted, Christian, do you recall by any 
> chance what has to be done in such cases, in non-Karaf deployments ?
>
> Thanks, Sergey
>
> On 11/03/14 14:03, NCorbet wrote:
>> Sergey,
>>
>> Thanks, I was keying off what you said about the provider possibly 
>> not being
>> configured right.  I have not felt too secure about the code, but 
>> since you
>> said it looks ok I will stick with it.
>>
>> I have worked past the:
>>
>> *javax.ws.rs.client.ClientException: .No message body writer has been 
>> found
>> for class : class
>> org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, 
>> ContentType
>> : application/json.*
>>
>> But, I seem to be alternating between Jaxb class loading issues and the
>> javax.ws.rs class loading issues.
>>
>> I cant seem to find the right start level for
>> *org.apache.servicemix.specs.jsr339-api-m10*. Do you know if there is a
>> bundle that should be loaded before this one? Currently I have the 
>> following
>> start levels defined:
>>
>>                  *<bundleStartLevel>
>>                          <bundle>
>> <id>org.apache.ws.xmlschema.core</id>
>>                              <level>1</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>> <id>org.apache.servicemix.bundles.wsdl4j</id>
>>                              <level>1</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>> <id>org.apache.cxf.cxf-rt-core</id>
>>                              <level>2</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>> <id>org.apache.servicemix.bundles.jaxb-impl</id>
>>                              <level>3</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>>
>> <id>org.apache.servicemix.specs.jaxb-api-2.2</id>
>>                              <level>4</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>> <id>org.apache.cxf.cxf-rt-bindings-xml</id>
>>                              <level>6</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>>
>> <id>org.apache.servicemix.specs.jsr339-api-m10</id>
>>                              <level>7</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                           <bundle>
>> <id>org.apache.cxf.cxf-rt-frontend-jaxrs</id>
>>                              <level>20</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>>                              <id>
>> org.apache.cxf.cxf-rt-rs-extension-providers</id>
>>                              <level>21</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>> <id>org.apache.cxf.cxf-rt-transports-http</id>
>>                              <level>22</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                          <bundle>
>> <id>org.apache.cxf.cxf-api</id>
>>                              <level>30</level>
>> <autoStart>true</autoStart>
>>                          </bundle>
>>                      </bundleStartLevel>  *
>>
>>
>> It seems if I move *org.apache.servicemix.specs.jsr339-api-m10* 
>> higher than
>> 7 I get ( and the tests wont run ):
>>
>> *java.lang.NoClassDefFoundError:
>> com/sun/xml/bind/marshaller/NamespacePrefixMapper*
>>
>> If it is 7 and above the tests run but error out with:
>> *java.lang.RuntimeException: java.lang.ClassNotFoundException:
>> org.glassfish.jersey.internal.RuntimeDelegateImpl
>>     at 
>> javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
>>     at 
>> javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
>>     at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
>>     at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232)* 
>>
>>
>> I feel like I am really close, but these class loading issues are 
>> killing
>> me. I feel like there is something missing for
>> *org.apache.servicemix.specs.jsr339-api-m10*.
>>
>> Thanks,
>> Neil
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> View this message in context: 
>> http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741097.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi, May be you should follow the tutorial from Christian on setting it 
in Karaf ?

I honestly do not think there has to be a need to manually change the 
levels; do you work with Felix or Equinox directly ? If yes and you've 
upgraded to CXF 2.7.10 then as far as I recall the container properties 
may need to be adjusted, Christian, do you recall by any chance what has 
to be done in such cases, in non-Karaf deployments ?

Thanks, Sergey

On 11/03/14 14:03, NCorbet wrote:
> Sergey,
>
> Thanks, I was keying off what you said about the provider possibly not being
> configured right.  I have not felt too secure about the code, but since you
> said it looks ok I will stick with it.
>
> I have worked past the:
>
> *javax.ws.rs.client.ClientException: .No message body writer has been found
> for class : class
> org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, ContentType
> : application/json.*
>
> But, I seem to be alternating between Jaxb class loading issues and the
> javax.ws.rs class loading issues.
>
> I cant seem to find the right start level for
> *org.apache.servicemix.specs.jsr339-api-m10*. Do you know if there is a
> bundle that should be loaded before this one? Currently I have the following
> start levels defined:
>
>                  *<bundleStartLevel>
>                          <bundle>
>                              <id>org.apache.ws.xmlschema.core</id>
>                              <level>1</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.servicemix.bundles.wsdl4j</id>
>                              <level>1</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.cxf.cxf-rt-core</id>
>                              <level>2</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.servicemix.bundles.jaxb-impl</id>
>                              <level>3</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>
> <id>org.apache.servicemix.specs.jaxb-api-2.2</id>
>                              <level>4</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.cxf.cxf-rt-bindings-xml</id>
>                              <level>6</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>
> <id>org.apache.servicemix.specs.jsr339-api-m10</id>
>                              <level>7</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                           <bundle>
>                              <id>org.apache.cxf.cxf-rt-frontend-jaxrs</id>
>                              <level>20</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>
> org.apache.cxf.cxf-rt-rs-extension-providers</id>
>                              <level>21</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.cxf.cxf-rt-transports-http</id>
>                              <level>22</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.cxf.cxf-api</id>
>                              <level>30</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                      </bundleStartLevel>  *
>
>
> It seems if I move *org.apache.servicemix.specs.jsr339-api-m10* higher than
> 7 I get ( and the tests wont run ):
>
> *java.lang.NoClassDefFoundError:
> com/sun/xml/bind/marshaller/NamespacePrefixMapper*
>
> If it is 7 and above the tests run but error out with:
> *java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.glassfish.jersey.internal.RuntimeDelegateImpl
> 	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
> 	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
> 	at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
> 	at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232)*
>
> I feel like I am really close, but these class loading issues are killing
> me. I feel like there is something missing for
> *org.apache.servicemix.specs.jsr339-api-m10*.
>
> Thanks,
> Neil
>
>
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741097.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
Sergey,

Thanks, I was keying off what you said about the provider possibly not being
configured right.  I have not felt too secure about the code, but since you
said it looks ok I will stick with it. 

I have worked past the:

*javax.ws.rs.client.ClientException: .No message body writer has been found
for class : class
org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, ContentType
: application/json.*

But, I seem to be alternating between Jaxb class loading issues and the
javax.ws.rs class loading issues. 

I cant seem to find the right start level for
*org.apache.servicemix.specs.jsr339-api-m10*. Do you know if there is a
bundle that should be loaded before this one? Currently I have the following
start levels defined:

                *<bundleStartLevel>
                        <bundle>
                            <id>org.apache.ws.xmlschema.core</id>
                            <level>1</level>
                            <autoStart>true</autoStart>
                        </bundle>                       
                        <bundle>
                            <id>org.apache.servicemix.bundles.wsdl4j</id>
                            <level>1</level>
                            <autoStart>true</autoStart>
                        </bundle> 
                        <bundle>
                            <id>org.apache.cxf.cxf-rt-core</id>
                            <level>2</level>
                            <autoStart>true</autoStart>
                        </bundle>
                        <bundle>
                            <id>org.apache.servicemix.bundles.jaxb-impl</id>
                            <level>3</level>
                            <autoStart>true</autoStart>
                        </bundle>
                        <bundle>
                           
<id>org.apache.servicemix.specs.jaxb-api-2.2</id>
                            <level>4</level>
                            <autoStart>true</autoStart>
                        </bundle>  
                        <bundle>
                            <id>org.apache.cxf.cxf-rt-bindings-xml</id>
                            <level>6</level>
                            <autoStart>true</autoStart>
                        </bundle>                         
                        <bundle> 
                           
<id>org.apache.servicemix.specs.jsr339-api-m10</id>
                            <level>7</level>
                            <autoStart>true</autoStart>
                        </bundle>                                                
                         <bundle> 
                            <id>org.apache.cxf.cxf-rt-frontend-jaxrs</id>
                            <level>20</level>
                            <autoStart>true</autoStart>
                        </bundle>
                        <bundle> 
                            <id>
org.apache.cxf.cxf-rt-rs-extension-providers</id>
                            <level>21</level>
                            <autoStart>true</autoStart>
                        </bundle>
                        <bundle>
                            <id>org.apache.cxf.cxf-rt-transports-http</id>
                            <level>22</level>
                            <autoStart>true</autoStart>
                        </bundle>                     
                        <bundle>
                            <id>org.apache.cxf.cxf-api</id>
                            <level>30</level>
                            <autoStart>true</autoStart>
                        </bundle>                             
                    </bundleStartLevel>  *


It seems if I move *org.apache.servicemix.specs.jsr339-api-m10* higher than
7 I get ( and the tests wont run ):

*java.lang.NoClassDefFoundError:
com/sun/xml/bind/marshaller/NamespacePrefixMapper*

If it is 7 and above the tests run but error out with:
*java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.glassfish.jersey.internal.RuntimeDelegateImpl
	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
	at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
	at
org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232)*

I feel like I am really close, but these class loading issues are killing
me. I feel like there is something missing for
*org.apache.servicemix.specs.jsr339-api-m10*.

Thanks,
Neil




  



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741097.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi,
In your original email you typed the code which looks perfectly fine to 
me. You said it worked for you, right ?

Cheers, Sergey

On 11/03/14 12:11, NCorbet wrote:
> Sergy,
>
> Can you direct me towards some documentation on the best way to set up a
> JSONProvider programmatically?
>
> Even better, is there any that shows the best way to use the
> JaxRSClientFactoryBean with the Provider? Maybe some examples in unit tests
> of your own?
>
>
> Thanks,
> Neil
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741081.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
Sergy,

Can you direct me towards some documentation on the best way to set up a
JSONProvider programmatically?

Even better, is there any that shows the best way to use the
JaxRSClientFactoryBean with the Provider? Maybe some examples in unit tests
of your own?


Thanks,
Neil





--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741081.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Sergey Beryozkin <sb...@gmail.com>.
I'm not really sure, JSONProvider which you register does not support 
the writing of RolePermission.

Can you put a breakpoint in its isWriteable() and check why it returns 
false ?

I guess the provider is not set up properly when you run the tests with 
Maven

Cheers, Sergey
On 10/03/14 14:19, NCorbet wrote:
> I did modify the start level of org.apache.servicemix.specs.jsr339-api-m10 to
> a level 5 and moved javax.xml to a level of 1.
>
> Now my test all fail with:
>
> Interceptor for
> {http://services.fuelmaster.shared.ambassador.syntech.org/}AdminService has
> thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: *.No message body writer has been found
> for class : class
> org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, ContentType
> : application/json*.
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:643)
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:976)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:581)
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:542)
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205)
> 	at com.sun.proxy.$Proxy20.saveRolePermission(Unknown Source)
> 	at
> org.syntech.ambassador.server.fuelmaster.services.integrationtest.AdminServiceTest.testAllRolePermission(AdminServiceTest.java:175)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> 	at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> 	at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runners.Suite.runChild(Suite.java:127)
> 	at org.junit.runners.Suite.runChild(Suite.java:26)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> 	at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> 	at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> 	at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> 	at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> 	at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
> 	at
> org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
> 	at
> org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
> 	at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
> 	at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> 	at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> 	at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> 	at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> Caused by:* javax.ws.rs.client.ClientException: .No message body writer has
> been found for class : class
> org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, ContentType
> : application/json.*
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:706)
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:416)
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:636)
> 	... 65 more
>
> I can see the web service calls in the console, and I can see the console
> output from the server that is being called and the responses ( all in json
> and the data is what I expect ). Once it gets to the client, I get these
> exceptions.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741022.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
I did modify the start level of org.apache.servicemix.specs.jsr339-api-m10 to
a level 5 and moved javax.xml to a level of 1.

Now my test all fail with:

Interceptor for
{http://services.fuelmaster.shared.ambassador.syntech.org/}AdminService has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: *.No message body writer has been found
for class : class
org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, ContentType
: application/json*.
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:643)
	at
org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:976)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
	at
org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:581)
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:542)
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205)
	at com.sun.proxy.$Proxy20.saveRolePermission(Unknown Source)
	at
org.syntech.ambassador.server.fuelmaster.services.integrationtest.AdminServiceTest.testAllRolePermission(AdminServiceTest.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runners.Suite.runChild(Suite.java:127)
	at org.junit.runners.Suite.runChild(Suite.java:26)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
	at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
	at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by:* javax.ws.rs.client.ClientException: .No message body writer has
been found for class : class
org.syntech.ambassador.shared.fuelmaster.domain.RolePermission, ContentType
: application/json.*
	at
org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:706)
	at
org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:416)
	at
org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:636)
	... 65 more

I can see the web service calls in the console, and I can see the console
output from the server that is being called and the responses ( all in json
and the data is what I expect ). Once it gets to the client, I get these
exceptions.



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741022.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 10/03/14 11:57, NCorbet wrote:
> Thanks everyone,
>
> Christian,
>
> Our current project uses tycho to build eclipse products and thus uses
> equinox as its base osgi container. There may be a chance that our future
> project could be Karaf based.
>
> Sergey,
>
> I was thinking about migrating to a newer version of cxf, so I may give it a
> try soon.
>
>
> I am still getting this exception after trying so many different things last
> friday:
>
> org.syntech.ambassador.server.fuelmaster.services.integrationtest.suite.AmbassadorIntegrationTestSuite
>> java.lang.RuntimeException: java.lang.ClassNotFoundException:
>> org.glassfish.jersey.internal.RuntimeDelegateImpl
>> at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
>> at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
>> at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
>> at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232)
>
>
Are you getting after modifying the start levels ? That should not 
happen in the distribution...

Cheers, Sergey

>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741007.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
Thanks everyone,

Christian,

Our current project uses tycho to build eclipse products and thus uses
equinox as its base osgi container. There may be a chance that our future
project could be Karaf based. 

Sergey,

I was thinking about migrating to a newer version of cxf, so I may give it a
try soon.


I am still getting this exception after trying so many different things last
friday:

org.syntech.ambassador.server.fuelmaster.services.integrationtest.suite.AmbassadorIntegrationTestSuite
> java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.glassfish.jersey.internal.RuntimeDelegateImpl
> at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
> at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
> at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232) 



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5741007.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I've checked the original message, it looks like it is the issue with 
CXF JAX-RS, I recall updating the code for it to properly resolve the 
namespace mapper properties, Dan did more work afterwards for the 
alternative implementations like Moxy be supported better across CXF.
Can you replace CXF 2.7.2 with 2.7.10 ?

Sergey




On 07/03/14 20:10, NCorbet wrote:
> Ok, with Christian's advice I actually got my tests to start running and I am
> getting the following error now, which I believe is another start order
> issue:
>
> Running
> org.syntech.ambassador.server.fuelmaster.services.integrationtest.suite.AmbassadorIntegrationTestSuite
> java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.glassfish.jersey.internal.RuntimeDelegateImpl
> 	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
> 	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
> 	at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
> 	at org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232)
> 	at
> org.apache.cxf.jaxrs.model.OperationResourceInfo.checkMediaTypes(OperationResourceInfo.java:201)
> 	at
> org.apache.cxf.jaxrs.model.OperationResourceInfo.<init>(OperationResourceInfo.java:79)
> 	at
> org.apache.cxf.jaxrs.utils.ResourceUtils.createOperationInfo(ResourceUtils.java:361)
> 	at
> org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:240)
> 	at
> org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:226)
> 	at
> org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.createResourceInfo(JAXRSServiceFactoryBean.java:203)
> 	at
> org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClass(JAXRSServiceFactoryBean.java:149)
> 	at
> org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.setServiceClass(JAXRSClientFactoryBean.java:159)
> 	at
> org.syntech.ambassador.server.fuelmaster.services.integrationtest.AdminServiceTest.setUp(AdminServiceTest.java:57)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> 	at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runners.Suite.runChild(Suite.java:127)
> 	at org.junit.runners.Suite.runChild(Suite.java:26)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> 	at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> 	at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> 	at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> 	at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> 	at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
> 	at
> org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
> 	at
> org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
> 	at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
> 	at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> 	at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> 	at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> 	at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> Caused by: java.lang.ClassNotFoundException:
> org.glassfish.jersey.internal.RuntimeDelegateImpl
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> 	at
> org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:131)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> 	at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:37)
> 	at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:143)
> 	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:134)
> 	... 61 more
>
> Moving this bundle around in load order got me this far:
> org.apache.servicemix.specs.jsr339-api-m10
>
> Is there bundles that need to start before this one?
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5740972.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
Ok, with Christian's advice I actually got my tests to start running and I am
getting the following error now, which I believe is another start order
issue:

Running
org.syntech.ambassador.server.fuelmaster.services.integrationtest.suite.AmbassadorIntegrationTestSuite
java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.glassfish.jersey.internal.RuntimeDelegateImpl
	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:151)
	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:119)
	at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.getMediaTypes(JAXRSUtils.java:232)
	at
org.apache.cxf.jaxrs.model.OperationResourceInfo.checkMediaTypes(OperationResourceInfo.java:201)
	at
org.apache.cxf.jaxrs.model.OperationResourceInfo.<init>(OperationResourceInfo.java:79)
	at
org.apache.cxf.jaxrs.utils.ResourceUtils.createOperationInfo(ResourceUtils.java:361)
	at
org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:240)
	at
org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:226)
	at
org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.createResourceInfo(JAXRSServiceFactoryBean.java:203)
	at
org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClass(JAXRSServiceFactoryBean.java:149)
	at
org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.setServiceClass(JAXRSClientFactoryBean.java:159)
	at
org.syntech.ambassador.server.fuelmaster.services.integrationtest.AdminServiceTest.setUp(AdminServiceTest.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runners.Suite.runChild(Suite.java:127)
	at org.junit.runners.Suite.runChild(Suite.java:26)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
	at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
	at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.ClassNotFoundException:
org.glassfish.jersey.internal.RuntimeDelegateImpl
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	at
org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:131)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:37)
	at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:143)
	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:134)
	... 61 more

Moving this bundle around in load order got me this far:
org.apache.servicemix.specs.jsr339-api-m10

Is there bundles that need to start before this one?



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5740972.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by NCorbet <Ne...@gmail.com>.
Thanks Christian,

I can try that, to clarify, when you say lower level do you mean earlier or
later than CXF?

This was my first inclination. It seems I always have issues with CXF and
JaxB. Does the latest release of CXF address ( or make easier ) some of
these issues?


Neil



--
View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931p5740958.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXFDOSGI 1.4 JAXRSClientFactoryBean and NamespacePrefixMapper Exception

Posted by Christian Schneider <ch...@die-schneider.net>.
This sounds like the jdk version of the jaxb impl is used instead of the 
cxf one.
Can you try to make sure that you start the jaxb api and impl bundles at 
a lower level than cxf?

Christian


On 06.03.2014 15:53, NCorbet wrote:
> Hello all,
>
> I am using CXFDosgi 1.4 ( 2.7.2 ) and Java 1.7.0_21.
>
> I have a Junit test that contains the following code in the setUp() method:
>
>                          ProxyClassLoader classLoader = new
> ProxyClassLoader();
> 			classLoader.addLoader(AdminService.class.getClassLoader());
> 			classLoader.addLoader(JAXRSClientFactoryBean.class.getClassLoader());	
> 			
> 			JSONProvider jsonProvider = new JSONProvider ();
> 			jsonProvider.setSingleJaxbContext(true);
> 			jsonProvider.setMarshallAsJaxbElement(true);
> 			jsonProvider.setUnmarshallAsJaxbElement(true);					
> 			
> 			Map<String, String> map = new HashMap<String, String> ();
> 			map.put ( "http://www.syntech.com", "something" );
> 			jsonProvider.setNamespaceMap(map);			
> 			
> 			JAXRSClientFactoryBean jaxRSBean = new JAXRSClientFactoryBean();
> 			jaxRSBean.setAddress(baseUrl + "AdminService");
> 			jaxRSBean.setClassLoader(classLoader);
> 			jaxRSBean.setProvider(jsonProvider);
> 			jaxRSBean.setServiceClass(AdminService.class);
> 			jaxRSBean.setUsername(USERNAME);
> 			jaxRSBean.setPassword(PASSWORD);
> 			jaxRSBean.getOutInterceptors().add(new LoggingOutInterceptor());
> 			jaxRSBean.getInInterceptors().add(new LoggingInInterceptor());
> 			
> 			
> 			
> 			adminService = jaxRSBean.create(AdminService.class,new Object());
>                          
>                          appRole = new ApplicationRole();
> 			appRole.setId("TestApplicationRoleId");
> 			appRole.setCreatedBy("TestCase");
> 			appRole.setName("Fleet Manager");
> 			appRole.setDesc("Fleet Manager");
> 			appRole.setCreatedTime(new Date());
> 			adminService.saveApplicationRole(appRole);
>
> When running from Eclipse ( select unit test, Debug As, Junit Test ), my
> test connects to the remote and processes fine. My Test passes. No Problems.
>
> When I run my test from maven ( I am using Tycho Surefire Plugin
> integration-test goal), my test does not run and contains the following
> failure ( cause highlighted in bold ):
>
> *java.lang.NoClassDefFoundError:
> com/sun/xml/bind/marshaller/NamespacePrefixMapper*
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
> 	at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
> 	at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:638)
> 	at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:613)
> 	at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:574)
> 	at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)
> 	at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)
> 	at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
> 	at
> org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:452)
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
> 	at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> 	at
> org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.setNamespaceMapper(AbstractJAXBProvider.java:142)
> 	at
> org.apache.cxf.jaxrs.provider.json.JSONProvider.marshal(JSONProvider.java:523)
> 	at
> org.apache.cxf.jaxrs.provider.json.JSONProvider.writeTo(JSONProvider.java:367)
> 	at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1221)
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:399)
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:636)
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:976)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
> 	at
> org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:581)
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:542)
> 	at
> org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205)
> 	at com.sun.proxy.$Proxy21.saveApplicationRole(Unknown Source)
> 	at
> org.syntech.ambassador.server.fuelmaster.services.integrationtest.AdminServiceTest.setUp(AdminServiceTest.java:72)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> 	at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runners.Suite.runChild(Suite.java:127)
> 	at org.junit.runners.Suite.runChild(Suite.java:26)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> 	at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> 	at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> 	at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> 	at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> 	at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
> 	at
> org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:85)
> 	at
> org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
> 	at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
> 	at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> 	at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> 	at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> 	at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> *Caused by: java.lang.ClassNotFoundException:
> com.sun.xml.bind.marshaller.NamespacePrefixMapper cannot be found by
> org.apache.cxf.cxf-api_2.7.2*
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
> 	at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
> 	at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
>
> I have com.sun.xml.bind.marshaller as an imported package in my bundle.
>
> As for my bundle start levels in my Tycho Test definition, so far I have the
> following start levels defined:
>
>                   <bundleStartLevel>
>                          <bundle>
>                             
> <id>org.apache.servicemix.specs.jsr339-api-m10</id>
>                              <level>1</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.cxf.cxf-rt-core</id>
>                              <level>2</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                          <bundle>
>                              <id>org.apache.cxf.cxf-rt-transports-http</id>
>                              <level>2</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                           <bundle>
>                              <id>org.apache.servicemix.bundles.jaxb-impl</id>
>                              <level>4</level>
>                              <autoStart>true</autoStart>
>                          </bundle>
>                    </bundleStartLevel>
>
> Is there something obvious that I am missing?
>
> Thanks in advance,
> Neil
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXFDOSGI-1-4-JAXRSClientFactoryBean-and-NamespacePrefixMapper-Exception-tp5740931.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com