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 15:56:45 GMT
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


this is what it is currently into my resources.xml:
     <Service id="gasceJSProvider" 
class-name="org.apache.johnzon.jaxrs.ConfigurableJohnzonProvider">
         # 1M
         maxSize = 1048576
         bufferSize = 1048576

         # ordered attributes
         attributeOrder = $order

         accessModeName = field
         supportHiddenAccess = true
         doCloseOnStreams = false
         version = 2
         skipNull = true
         skipEmptyArray = false
         pretty=true


         # Additional types to ignore
         ignores = 
org.apache.cxf.jaxrs.ext.multipart.MultipartBody,javax.ws.rs.core.StreamingOutput
     </Service>

     <pojo-deployment class-name="com.gasce.portal.mvc.GasceWebApp">
         <properties>
             cxf.jaxrs.providers = com.gasce.portal.app.BinaryProvider, 
org.apache.cxf.jaxrs.provider.MultipartProvider, 
org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper, 
org.apache.cxf.jaxrs.provider.BinaryDataProvider, 
org.apache.cxf.jaxrs.provider.DataSourceProvider, gasceJSProvider

             # this one is not mandatory but recommanded
             cxf.jaxrs.skip-provider-scanning = true
         </properties>
     </pojo-deployment>


pom dependencies

         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-json_1.0_spec</artifactId>
             <version>1.0-alpha-1</version>
         </dependency>
         <dependency>
             <groupId>javax.json</groupId>
             <artifactId>javax.json-api</artifactId>
             <version>1.0</version>
         </dependency>

         <dependency>
             <groupId>org.glassfish</groupId>
             <artifactId>javax.json</artifactId>
             <version>1.0.4</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>

Mime
View raw message