mehandih / grails-jaxrs

Automatically exported from code.google.com/p/grails-jaxrs
0 stars 0 forks source link

Exception after returning text/xml response #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create basic service resource like so:

@Path('/api')
class Account2Resource {

    @GET
    @Path('/account')
    @Produces("application/json,text/xml")
    def getAccount2() {
        return Account.list().iterator().next();
    }

    @POST
    @Path('/account')
    @Consumes("application/json")
    def createAccount2(Account account) {
        return Account.store(account);
    }

}

2. Execute method via curl like so:

curl -D log -X GET -H "Accept: text/xml"
http://localhost:8080/mt-api/api/account

What is the expected output? What do you see instead?

No error logging with a clean response.

Instead I see the attached error after each successfully served response

What version of the product are you using? On what operating system?

0.3 on Linux with Grails 1.2.0

Please provide any additional information below.

This exception doesn't occur with a different Accept type:

curl -D log -X GET -H "Accept: application/json"
http://localhost:8080/mt-api/api/account

Not sure if this is just related to the plug-in not being built for 1.2.x
or something else.

Original issue reported on code.google.com by ari...@gmail.com on 10 Feb 2010 at 2:34

Attachments:

GoogleCodeExporter commented 8 years ago
When using the plugin with Grails 1.2.x you'll need to build it from the latest
development snapshot (0.4) and install it manually. I haven't made a release 
yet to
the central plugin repository. For instructions how to build the plugin from the
sources refer to

http://code.google.com/p/grails-jaxrs/wiki/InstallationInstructions

Version 0.3 of the plugin only works with Grails 1.1.x. The stacktrace you sent 
is
the expected one when using grails-jaxrs 0.3 with Grails 1.1.x. If this doesn't 
help
feel free to re-open this ticket or create a new one.

Cheers,
Martin

Original comment by krass...@googlemail.com on 10 Feb 2010 at 6:12

GoogleCodeExporter commented 8 years ago
Worked great, thanks.  No more stack trace.

Original comment by ari...@gmail.com on 16 Feb 2010 at 12:47