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.7.4 tries to parse a binary multipart as json
Date Wed, 28 Dec 2016 17:25:37 GMT
can be, as mentionned this has a bit changed for jaxrs 2 and even if the
new algorithm didn't make everyone happy, it at least makes it a bit more
deterministic :)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-12-28 18:08 GMT+01:00 Kirys <kirys@neoteroi.org>:

> On 28/12/2016 17:01, Romain Manni-Bucau wrote:
>
>> 2016-12-28 16:56 GMT+01:00 Kirys <kirys@neoteroi.org>:
>>
>> On 28/12/2016 16:17, Romain Manni-Bucau wrote:
>>>
>>> johnzon declares
>>>>
>>>> @Produces("application/json")
>>>> @Consumes("application/json")
>>>>
>>>>
>>>> so it shouldnt match the content-type of your request
>>>>
>>>>
>>>> this is what is weird
>>>>
>>>>
>>>> a workaround is to configure it in openejb-jar.xml/resources.xml and
>>>> add to ignorable types MultipartBody
>>>>
>>>> Ok tried but i miss some dependacies
>>> java.lang.NoClassDefFoundError: javax/json/spi/JsonProvider
>>>
>>>
>>> see comment in your pom
>>
>
> Now:
> cxf.jaxrs.providers = com.gasce.portal.app.BinaryProvider,
> org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper, gasceJSProvider
>
> and the pom has
>
>         <!--
>                 JSON
>         -->
>         <dependency>
>             <groupId>org.apache.geronimo.specs</groupId>
> <artifactId>geronimo-json_1.0_spec</artifactId>
>             <version>1.0-alpha-1</version>
>         </dependency>
>
>         <dependency>
>             <groupId>org.apache.johnzon</groupId>
>             <artifactId>johnzon-core</artifactId>
>             <version>${johnzon.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.johnzon</groupId>
>             <artifactId>johnzon-mapper</artifactId>
>             <version>${johnzon.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.johnzon</groupId>
>             <artifactId>johnzon-jaxrs</artifactId>
>             <version>${johnzon.version}</version>
>         </dependency>
>
> Ok it seems that it's working now.
> But is is strange that somehow it have to be manually specified in that
> order to avoid the parsing exception.
> Maybe somehow the @produce has a bug make it a candidate for both consume
> and produce?
>
> Thank You
> K.
>
>

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