tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: TomEE 1.5 and Jackson
Date Fri, 05 Oct 2012 06:04:20 GMT
Hi,

first side note: i think you can get rid of resources.xml since
cxf.jaxrs.providers=org.codehaus.jackson.jaxrs.JacksonJsonProvider should
work too (you dont need to configure the provider so no need of
resources.xml)

about your error it should be elsewhere since updating your sample to use
an EJB i managed to make it working with:

<openejb-jar>
  <ejb-deployment ejb-name="Resource">
    <properties>
      cxf.jaxrs.providers = bw
    </properties>
  </ejb-deployment>
</openejb-jar>



*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*




2012/10/5 netname <albyanez@gmail.com>

> Thanks a lot Romain !  With your post and an example I found that you
> wrote a
> while ago (foo) I was able to make it work.  The only issue that I have is
> that if my service is an EJB I get the following error: *"number of beans
> deployed (11) does not match the number of beans actually in the jar
> (12)"*.
> I have other EJBs that are not endpoints in JAX-RS. It seems that once I
> define an EJB in openejb-jar.xml I have to define them all in
> openejb-jar.xml.
>
> I am attaching the Foo project modified to register Jackson.
>
> The steps to setup Jackson in TomEE (as it is my understanding) are:
>
> *Setup Jackson in TomEE 1.5*
>
> 1)  Copy jackson-mapper-asl-1.9.9.jar, jackson-core-asl-1.9.9.jar,
> jackson-jaxrs-1.9.9.jar into WEB-INF/lib folder
>
> 2) Under the WEB-INF folder add the following files:
>
> resources.xml
> -------------
> <resources>
>     <Service id="jsonProvider"
>              class-name="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
>     <Service id="jaxbProvider"
>
>  class-name="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider"
> />
> </resources>
>
>
> openejb-jar.xml
> ---------------
> <openejb-jar>
>     <pojo-deployment class-name="com.example.MyJaxRSService">
>         <properties>
>             cxf.jax-rs.providers = jsonProvider, jaxbProvider
>         </properties>
>     </pojo-deployment>
> </openejb-jar>
>
> Note: make sure that MyJaxRSService is a POJO, if it were an EJB then you
> should use ejb-deployment
>
>
> --------------------------------------------------------------------------------------------------
>
> *Questions:*
>
> 1) Could someone please point me to instructions on how to register EJBs in
> openejb-jar.xml.
> 2) How can I avoid the error: "number of beans deployed (11) does not match
> the number of beans actually in the jar (12)"
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-1-5-and-Jackson-tp4657777p4657786.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message