You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tonywestonuk <to...@totspics.com> on 2015/11/20 13:49:32 UTC

Tomee 7.0.0 jaxrx formatting options

I'm trying to migrate to tomee 7.0.0    (due to TOMEE-1649  hint hint!! ;-)

However, when I add the following JaxRS formatting options in resources.xml:

    <?xml version="1.0"?>
<resources>
    <Service id="jsonProvider"
class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
        dropRootElement=true
        supportUnwrapped = true
        dropCollectionWrapperElement=true
        convertTypesToStrings = true
    </Service>
</resources>


It crashes on startup:

     java.lang.NoClassDefFoundError:
org/codehaus/jettison/mapped/TypeConverter
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at org.apache.xbean.recipe.RecipeHelper.loadClass(RecipeHelper.java:52)
	at org.apache.xbean.recipe.ObjectRecipe.getType(ObjectRecipe.java:353)
	at
org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:266)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
	at
org.apache.openejb.assembler.classic.util.ServiceInfos.build(ServiceInfos.java:176)
	at
org.apache.openejb.assembler.classic.util.ServiceInfos.build(ServiceInfos.java:133)
	at
org.apache.openejb.assembler.classic.util.ServiceInfos.resolve(ServiceInfos.java:56)
	at
org.apache.openejb.assembler.classic.util.ServiceInfos.resolve(ServiceInfos.java:91)
	at
org.apache.openejb.server.cxf.rs.CxfRsHttpListener.configureFactory(CxfRsHttpListener.java:846)
	at
org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:532)
	at
org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:464)
	at
org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:233)
	at
org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:53)
	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:606)
	at
org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(ObserverManager.java:406)
	at
org.apache.openejb.observer.ObserverManager$InvocationList.invoke(ObserverManager.java:521)
	at
org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.java:111)
	at
org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:100)
	at
org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:131)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1645)
	at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:116)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)


Is this a bug, or if not what are the options I should be using for tomee
7.0.0

Thanks 
:-)



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0-jaxrx-formatting-options-tp4676901.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Tomee 7.0.0 jaxrx formatting options

Posted by tonywestonuk <to...@totspics.com>.
Yeh! - works...  Thanks for all your help.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0-jaxrx-formatting-options-tp4676901p4676908.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Tomee 7.0.0 jaxrx formatting options

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Tomee 7 switched to johnzon by default.

Just add jettison to tomee lib folder if you still use it.
Le 20 nov. 2015 05:04, "tonywestonuk" <to...@totspics.com> a écrit :

>
> I'm trying to migrate to tomee 7.0.0    (due to TOMEE-1649  hint hint!! ;-)
>
> However, when I add the following JaxRS formatting options in
> resources.xml:
>
>     <?xml version="1.0"?>
> <resources>
>     <Service id="jsonProvider"
> class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
>         dropRootElement=true
>         supportUnwrapped = true
>         dropCollectionWrapperElement=true
>         convertTypesToStrings = true
>     </Service>
> </resources>
>
>
> It crashes on startup:
>
>      java.lang.NoClassDefFoundError:
> org/codehaus/jettison/mapped/TypeConverter
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:270)
>         at
> org.apache.xbean.recipe.RecipeHelper.loadClass(RecipeHelper.java:52)
>         at
> org.apache.xbean.recipe.ObjectRecipe.getType(ObjectRecipe.java:353)
>         at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:266)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
>         at
>
> org.apache.openejb.assembler.classic.util.ServiceInfos.build(ServiceInfos.java:176)
>         at
>
> org.apache.openejb.assembler.classic.util.ServiceInfos.build(ServiceInfos.java:133)
>         at
>
> org.apache.openejb.assembler.classic.util.ServiceInfos.resolve(ServiceInfos.java:56)
>         at
>
> org.apache.openejb.assembler.classic.util.ServiceInfos.resolve(ServiceInfos.java:91)
>         at
>
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.configureFactory(CxfRsHttpListener.java:846)
>         at
>
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:532)
>         at
>
> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:464)
>         at
>
> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:233)
>         at
>
> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:53)
>         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:606)
>         at
>
> org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(ObserverManager.java:406)
>         at
>
> org.apache.openejb.observer.ObserverManager$InvocationList.invoke(ObserverManager.java:521)
>         at
>
> org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.java:111)
>         at
>
> org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:100)
>         at
> org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:131)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1645)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:116)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:745)
>
>
> Is this a bug, or if not what are the options I should be using for tomee
> 7.0.0
>
> Thanks
> :-)
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0-jaxrx-formatting-options-tp4676901.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>