You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by dm...@eiskonzept.com on 2013/01/09 15:49:14 UTC
Configuring Apache CXF in TomEE
Hello,
we are trying to configure CXF in our web project running in tomee-jaxrs-1.5.1. How is it possible to set supportUnwrapped=true and dropRootElement=true properties of JsonProvider? Can it be done in openejb-jar.xml or in another configuration files? I have tried the following configuration in openejb-jar.xml with no effect:
<pojo-deployment class-name="jaxrs-application">
<properties>
cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
</properties>
</pojo-deployment>
Am I doing it right?
Best regards
Dmitry Volkov
Re: AW: Configuring Apache CXF in TomEE
Posted by twelveeighty <tw...@gmail.com>.
Sorry for bumping this old thread.
Can someone point me in the direction of documentation on how to use
resources.xml in conjunction with openejb-jar.xml? I just can't seem to find
any mention of "resources.xml" on the TomEE website.
I just spend the good part of a couple of days trying to figure out this
same problem of trying to configure CXF, too bad Google didn't bring me to
this post sooner.
I wouldn't mind helping out documenting this either, but I have no idea
where to start. Is there any description out there?
--
View this message in context: http://openejb.979440.n4.nabble.com/Configuring-Apache-CXF-in-TomEE-tp4660207p4661860.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
AW: Configuring Apache CXF in TomEE
Posted by dm...@eiskonzept.com.
It works! Thank you.
-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
Gesendet: Mittwoch, 9. Januar 2013 22:46
An: users@openejb.apache.org
Betreff: Re: Configuring Apache CXF in TomEE
ok so first put it in WEB-INF, it is looked up here for sure
then mea culpa, i said <Resource/> but it is <Service/>
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*
2013/1/9 <dm...@eiskonzept.com>
> Just tried to put files with no effect in:
> /META-INF
> /WEB-INF
> /WEB-INF/classes/META-INF
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Mittwoch, 9. Januar 2013 17:16
> An: users@openejb.apache.org
> Betreff: Re: Configuring Apache CXF in TomEE
>
> try to put files in WEB-INF
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/1/9 <dm...@eiskonzept.com>
>
> > Just tried proposed configuration:
> > https://github.com/eiskonzept/tomee-jaxrs/blob/master/src/main/resou
> > rc es/META-INF/ Still not working. I have checked in debugger that
> > JsonService.setDropRootElement(true) is called, but then another
> > instance of JsonService is used for marshaling. pojo-deployment tag
> > in openejb-jar.xml seems not working correctly.
> >
> >
> > My openejb-jar.xml:
> > <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
> > <pojo-deployment class-name="de.eis.tomee.TestService">
> > <properties>
> > cxf.jaxrs.providers = json
> > </properties>
> > </pojo-deployment>
> > </openejb-jar>
> >
> > My resources.xml:
> > <resources>
> > <Resource id="json"
> > class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> > dropRootElement = true
> > supportUnwrapped = true
> > </Resource>
> > </resources>
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> > Gesendet: Mittwoch, 9. Januar 2013 16:11
> > An: users@openejb.apache.org
> > Betreff: Re: Configuring Apache CXF in TomEE
> >
> > jaxrs-application is for tomee >= 1.5.2 (to be released)
> >
> > you can do:
> >
> > <!-- in openejb-jar.xml -->
> > <pojo-deployment class-name="com.foo.MyRestService">
> > <properties>
> > cxf.jaxrs.providers = json
> > </properties>
> > </pojo-deployment>
> >
> > <!-- in resources.xml -->
> > <Resource id="json"
> > class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> > dropRootElement = true
> > # etc...
> > </Resource>
> >
> > supportUnwrapped=true,dropRootElement=true
> >
> >
> > 2013/1/9 <dm...@eiskonzept.com>
> >
> > > <pojo-deployment class-name="jaxrs-application">
> > > <properties>
> > > cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
> > > </properties>
> > > </pojo-deployment>
> > >
> >
> >
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> > http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
>
Re: Configuring Apache CXF in TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
ok so first put it in WEB-INF, it is looked up here for sure
then mea culpa, i said <Resource/> but it is <Service/>
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*
2013/1/9 <dm...@eiskonzept.com>
> Just tried to put files with no effect in:
> /META-INF
> /WEB-INF
> /WEB-INF/classes/META-INF
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Mittwoch, 9. Januar 2013 17:16
> An: users@openejb.apache.org
> Betreff: Re: Configuring Apache CXF in TomEE
>
> try to put files in WEB-INF
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/1/9 <dm...@eiskonzept.com>
>
> > Just tried proposed configuration:
> > https://github.com/eiskonzept/tomee-jaxrs/blob/master/src/main/resourc
> > es/META-INF/ Still not working. I have checked in debugger that
> > JsonService.setDropRootElement(true) is called, but then another
> > instance of JsonService is used for marshaling. pojo-deployment tag in
> > openejb-jar.xml seems not working correctly.
> >
> >
> > My openejb-jar.xml:
> > <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
> > <pojo-deployment class-name="de.eis.tomee.TestService">
> > <properties>
> > cxf.jaxrs.providers = json
> > </properties>
> > </pojo-deployment>
> > </openejb-jar>
> >
> > My resources.xml:
> > <resources>
> > <Resource id="json"
> > class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> > dropRootElement = true
> > supportUnwrapped = true
> > </Resource>
> > </resources>
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> > Gesendet: Mittwoch, 9. Januar 2013 16:11
> > An: users@openejb.apache.org
> > Betreff: Re: Configuring Apache CXF in TomEE
> >
> > jaxrs-application is for tomee >= 1.5.2 (to be released)
> >
> > you can do:
> >
> > <!-- in openejb-jar.xml -->
> > <pojo-deployment class-name="com.foo.MyRestService">
> > <properties>
> > cxf.jaxrs.providers = json
> > </properties>
> > </pojo-deployment>
> >
> > <!-- in resources.xml -->
> > <Resource id="json"
> > class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> > dropRootElement = true
> > # etc...
> > </Resource>
> >
> > supportUnwrapped=true,dropRootElement=true
> >
> >
> > 2013/1/9 <dm...@eiskonzept.com>
> >
> > > <pojo-deployment class-name="jaxrs-application">
> > > <properties>
> > > cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
> > > </properties>
> > > </pojo-deployment>
> > >
> >
> >
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> > http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
>
AW: Configuring Apache CXF in TomEE
Posted by dm...@eiskonzept.com.
Just tried to put files with no effect in:
/META-INF
/WEB-INF
/WEB-INF/classes/META-INF
-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
Gesendet: Mittwoch, 9. Januar 2013 17:16
An: users@openejb.apache.org
Betreff: Re: Configuring Apache CXF in TomEE
try to put files in WEB-INF
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*
2013/1/9 <dm...@eiskonzept.com>
> Just tried proposed configuration:
> https://github.com/eiskonzept/tomee-jaxrs/blob/master/src/main/resourc
> es/META-INF/ Still not working. I have checked in debugger that
> JsonService.setDropRootElement(true) is called, but then another
> instance of JsonService is used for marshaling. pojo-deployment tag in
> openejb-jar.xml seems not working correctly.
>
>
> My openejb-jar.xml:
> <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
> <pojo-deployment class-name="de.eis.tomee.TestService">
> <properties>
> cxf.jaxrs.providers = json
> </properties>
> </pojo-deployment>
> </openejb-jar>
>
> My resources.xml:
> <resources>
> <Resource id="json"
> class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> dropRootElement = true
> supportUnwrapped = true
> </Resource>
> </resources>
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Mittwoch, 9. Januar 2013 16:11
> An: users@openejb.apache.org
> Betreff: Re: Configuring Apache CXF in TomEE
>
> jaxrs-application is for tomee >= 1.5.2 (to be released)
>
> you can do:
>
> <!-- in openejb-jar.xml -->
> <pojo-deployment class-name="com.foo.MyRestService">
> <properties>
> cxf.jaxrs.providers = json
> </properties>
> </pojo-deployment>
>
> <!-- in resources.xml -->
> <Resource id="json"
> class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> dropRootElement = true
> # etc...
> </Resource>
>
> supportUnwrapped=true,dropRootElement=true
>
>
> 2013/1/9 <dm...@eiskonzept.com>
>
> > <pojo-deployment class-name="jaxrs-application">
> > <properties>
> > cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
> > </properties>
> > </pojo-deployment>
> >
>
>
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
Re: Configuring Apache CXF in TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
try to put files in WEB-INF
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*
2013/1/9 <dm...@eiskonzept.com>
> Just tried proposed configuration:
> https://github.com/eiskonzept/tomee-jaxrs/blob/master/src/main/resources/META-INF/
> Still not working. I have checked in debugger that
> JsonService.setDropRootElement(true) is called, but then another instance
> of JsonService is used for marshaling. pojo-deployment tag in
> openejb-jar.xml seems not working correctly.
>
>
> My openejb-jar.xml:
> <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
> <pojo-deployment class-name="de.eis.tomee.TestService">
> <properties>
> cxf.jaxrs.providers = json
> </properties>
> </pojo-deployment>
> </openejb-jar>
>
> My resources.xml:
> <resources>
> <Resource id="json"
> class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> dropRootElement = true
> supportUnwrapped = true
> </Resource>
> </resources>
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Mittwoch, 9. Januar 2013 16:11
> An: users@openejb.apache.org
> Betreff: Re: Configuring Apache CXF in TomEE
>
> jaxrs-application is for tomee >= 1.5.2 (to be released)
>
> you can do:
>
> <!-- in openejb-jar.xml -->
> <pojo-deployment class-name="com.foo.MyRestService">
> <properties>
> cxf.jaxrs.providers = json
> </properties>
> </pojo-deployment>
>
> <!-- in resources.xml -->
> <Resource id="json"
> class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
> dropRootElement = true
> # etc...
> </Resource>
>
> supportUnwrapped=true,dropRootElement=true
>
>
> 2013/1/9 <dm...@eiskonzept.com>
>
> > <pojo-deployment class-name="jaxrs-application">
> > <properties>
> > cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
> > </properties>
> > </pojo-deployment>
> >
>
>
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
AW: Configuring Apache CXF in TomEE
Posted by dm...@eiskonzept.com.
Just tried proposed configuration: https://github.com/eiskonzept/tomee-jaxrs/blob/master/src/main/resources/META-INF/
Still not working. I have checked in debugger that JsonService.setDropRootElement(true) is called, but then another instance of JsonService is used for marshaling. pojo-deployment tag in openejb-jar.xml seems not working correctly.
My openejb-jar.xml:
<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
<pojo-deployment class-name="de.eis.tomee.TestService">
<properties>
cxf.jaxrs.providers = json
</properties>
</pojo-deployment>
</openejb-jar>
My resources.xml:
<resources>
<Resource id="json" class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
dropRootElement = true
supportUnwrapped = true
</Resource>
</resources>
-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
Gesendet: Mittwoch, 9. Januar 2013 16:11
An: users@openejb.apache.org
Betreff: Re: Configuring Apache CXF in TomEE
jaxrs-application is for tomee >= 1.5.2 (to be released)
you can do:
<!-- in openejb-jar.xml -->
<pojo-deployment class-name="com.foo.MyRestService">
<properties>
cxf.jaxrs.providers = json
</properties>
</pojo-deployment>
<!-- in resources.xml -->
<Resource id="json"
class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
dropRootElement = true
# etc...
</Resource>
supportUnwrapped=true,dropRootElement=true
2013/1/9 <dm...@eiskonzept.com>
> <pojo-deployment class-name="jaxrs-application">
> <properties>
> cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
> </properties>
> </pojo-deployment>
>
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*
Re: Configuring Apache CXF in TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
jaxrs-application is for tomee >= 1.5.2 (to be released)
you can do:
<!-- in openejb-jar.xml -->
<pojo-deployment class-name="com.foo.MyRestService">
<properties>
cxf.jaxrs.providers = json
</properties>
</pojo-deployment>
<!-- in resources.xml -->
<Resource id="json"
class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
dropRootElement = true
# etc...
</Resource>
supportUnwrapped=true,dropRootElement=true
2013/1/9 <dm...@eiskonzept.com>
> <pojo-deployment class-name="jaxrs-application">
> <properties>
> cxf.jaxrs.properties = supportUnwrapped=true,dropRootElement=true
> </properties>
> </pojo-deployment>
>
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*