tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirys <ki...@neoteroi.org>
Subject Re: Tomee 1.7.4 tries to parse a binary multipart as json
Date Wed, 28 Dec 2016 17:08:56 GMT
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
View raw message