it is the default:

https://github.com/apache/tomee/blob/master/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/DefaultClientProvidersTest.java

but the client needs to run in the container. In the opposite case you need
to register JohnzonProvider as you did for jackson


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-08-04 19:38 GMT+02:00 Steve Goldsmith <[email protected]>:

> Stand-alone javax.ws.rs.client.Client gets:
>
> javax.ws.rs.ProcessingException: No message body writer has been found for
> class com.bhn.services.dto.VersionDto, ContentType: application/json
>
> Unless client.register(JacksonJaxbJsonProvider.class);
>
> Is there a way to use provided johnzon without jackson test dependencies?
>
>
>
> On Tue, Aug 4, 2015 at 1:34 PM, Romain Manni-Bucau <[email protected]>
> wrote:
>
> > by defaut it will use Johnzon, the way you do is right for a client, do
> you
> > have an issue?
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-08-04 19:28 GMT+02:00 Steve Goldsmith <[email protected]>:
> >
> > > OK, back at this again.
> > >
> > > |  |  +- org.apache.cxf:cxf-rt-rs-extension-providers:jar:3.1.2:test
> > > |  |  \- org.apache.johnzon:johnzon-jaxrs:jar:0.8-incubating:test
> > > |  |     \- org.apache.johnzon:johnzon-mapper:jar:0.8-incubating:test
> > > |  |        \- org.apache.johnzon:johnzon-core:jar:0.8-incubating:test
> > >
> > > So how would I register the JSON provider instead of:
> > >
> > > client.register(JacksonJaxbJsonProvider.class);
> > >
> > > On Thu, Jul 23, 2015 at 4:26 PM, Romain Manni-Bucau <
> > [email protected]
> > > >
> > > wrote:
> > >
> > > > mvn dependency:tree
> > > >
> > > >
> > > > Romain Manni-Bucau
> > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > <http://rmannibucau.wordpress.com> | Github <
> > > > https://github.com/rmannibucau> |
> > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > > > <http://www.tomitribe.com>
> > > >
> > > > 2015-07-23 12:56 GMT-07:00 Steve Goldsmith <[email protected]>:
> > > >
> > > > > How do I determine I have johnzon? I'm not explicitly using it in
> my
> > > > > dependencies.
> > > > >
> > > > > On Thu, Jul 23, 2015 at 2:41 PM, Romain Manni-Bucau <
> > > > [email protected]
> > > > > >
> > > > > wrote:
> > > > >
> > > > > > :) so check you have johnzon, if so then maybe share VersionDto.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Romain Manni-Bucau
> > > > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > > > <http://rmannibucau.wordpress.com> | Github <
> > > > > > https://github.com/rmannibucau> |
> > > > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > > > > > <http://www.tomitribe.com>
> > > > > >
> > > > > > 2015-07-23 11:39 GMT-07:00 Steve Goldsmith <[email protected]>:
> > > > > >
> > > > > > > 7.0.0-SNAPSHOT of course :)
> > > > > > >
> > > > > > > On Thu, Jul 23, 2015 at 2:34 PM, Romain Manni-Bucau <
> > > > > > [email protected]
> > > > > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hi
> > > > > > > >
> > > > > > > > which version of tomee?
> > > > > > > >
> > > > > > > > by default next tomee will use johnzon for json but tomee 1
> > used
> > > > > > jettison
> > > > > > > > which is not that easy in practise - relies a lot on jaxb.
> > > > > > > >
> > > > > > > >
> > > > > > > > Romain Manni-Bucau
> > > > > > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > > > > > <http://rmannibucau.wordpress.com> | Github <
> > > > > > > > https://github.com/rmannibucau> |
> > > > > > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> |
> > Tomitriber
> > > > > > > > <http://www.tomitribe.com>
> > > > > > > >
> > > > > > > > 2015-07-23 11:31 GMT-07:00 sgjava <[email protected]>:
> > > > > > > >
> > > > > > > > > I'm building a stand alone JSON test client (not embedded
> > > TomEE)
> > > > > with
> > > > > > > > > javax.ws.rs.client.Client instead of CXF WebClient and I
> get
> > > > > > > > > org.apache.cxf.interceptor.Fault: No message body writer
> has
> > > been
> > > > > > found
> > > > > > > > for
> > > > > > > > > class com.bhn.services.dto.VersionDto, ContentType:
> > > > > application/json.
> > > > > > > The
> > > > > > > > > way I fixed this is to add the following test scoped
> > > > dependencies:
> > > > > > > > >
> > > > > > > > >         <dependency>
> > > > > > > > >             <groupId>org.codehaus.jackson</groupId>
> > > > > > > > >             <artifactId>jackson-jaxrs</artifactId>
> > > > > > > > >             <version>1.9.13</version>
> > > > > > > > >             <scope>test</scope>
> > > > > > > > >         </dependency>
> > > > > > > > >         <dependency>
> > > > > > > > >             <groupId>org.codehaus.jackson</groupId>
> > > > > > > > >             <artifactId>jackson-xc</artifactId>
> > > > > > > > >             <version>1.9.13</version>
> > > > > > > > >             <scope>test</scope>
> > > > > > > > >         </dependency>
> > > > > > > > >
> > > > > > > > > Then you need to add
> > > > > client.register(JacksonJaxbJsonProvider.class).
> > > > > > My
> > > > > > > > > question is there a way to use the existing TomEE
> > dependencies,
> > > > but
> > > > > > > > maybe a
> > > > > > > > > different provider class, so I don't have to explicitly add
> > > > Jackson
> > > > > > > > > dependencies?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > View this message in context:
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/JSON-JAX-RS-test-client-provider-tp4675582.html
> > > > > > > > > Sent from the TomEE Users mailing list archive at
> Nabble.com.
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Steven P. Goldsmith
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Steven P. Goldsmith
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Steven P. Goldsmith
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Reply via email to