tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From netname <albya...@gmail.com>
Subject Re: TomEE 1.5 and Jackson
Date Thu, 04 Oct 2012 22:57:18 GMT
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
View raw message