0 Replies Latest reply on Jan 15, 2013 10:53 PM by Josiah Haswell

    Arquillian + JPA + Gradle + JAX-RS (XML and JSON)

    Josiah Haswell Newbie

      Hi everyone,

       

      I'm trying to get Arquillian, JPA, and JAX-RS to work together using Gradle as the build-system.  I've committed what I have to https://github.com/jhaswell/jpa-gradle-rest going off some of the demos at https://github.com/aslakknutsen/arquillian-showcase/.  Everything works if I use XML content-types, but fails if I switch to JSON.  The failure looks to be on the client-side as the server produces JSON correctly.   The specific failure when I try to post an entity using APPLICATION_JSON is:

       

       

      org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type text/html;charset="utf-8" and type null at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:523) at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:514)
      
      
      

       

       

       

      When I just try to retrieve an entity as JSON, I get the error:

       

       

      [com.sun.istack.SAXParseException2; columnNumber: 0; unexpected element (uri:"", local:"id"). Expected elements are <{}tenant>]
      
      
      

       

      Any insight would be greatly appreciated!

       

       

      Another interesting thing is that the web WAR deploys correctly into managed JBoss 7.1.1 from Arquillian, but fails if I deploy the built WAR into the same instance with a "Can't find persistence unit 'null'" error.  It's certainly an issue with my Gradle build, but if anything jumps out, please let me know!  I'll keep this project around and expand on it to assist with documentation.

       

      Thanks!

       

      Joe