activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiram Chirino <hi...@hiramchirino.com>
Subject Re: Error with Apollo REST API
Date Wed, 08 Jun 2011 14:27:29 GMT
Yeah. That's because that field is not part of the base class of the
ConnectionStatusDTO:

http://activemq.apache.org/apollo/versions/1.0-beta3/website/documentation/api/apollo-dto/org/apache/activemq/apollo/dto/ConnectionStatusDTO.html

The StompConnectionStatusDTO extends the class and adds that field in.
 Unfortunately, the JOSQL library which we are using to query/filter
the fields only work against the base classes and the the sub classes.

I'll have to move the field to the base class.

Regards,
Hiram

FuseSource
Web: http://fusesource.com/




On Wed, Jun 8, 2011 at 8:20 AM, Lionel Cons <lionel.cons@cern.ch> wrote:
> Hiram,
>
> Using apollo-1.0-20110607.125153-128, I got an error with the REST API.
>
> I can run:
>
> $ curl -u "guest:guest" 'http://localhost:8080/broker/connections.json'
>
> and the resulting objects contain both an id and a subscription_count
> fields:
>
> {"id":"1557","state":"STARTED",[...],"subscription_count":1}
>
> I can filter the fields and get only the id:
>
> $ curl -u "guest:guest" 'http://localhost:8080/broker/connections.json?f=id'
>
> However, If I want only the subscription_count, I get an error:
>
> $ curl -u "guest:guest" 'http://localhost:8080/broker/connections.json?f=subscription_count'
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 404 Not Found</title>
> </head>
> <body><h2>HTTP ERROR 404</h2>
> <p>Problem accessing /WEB-INF/scalate/errors/500.scaml. Reason:
> <pre>    Not Found</pre></p><h3>Caused by:</h3><pre>org.josql.QueryParseException:
Unable to create getter: subscription_count
>        at org.josql.expressions.Accessor.init(Accessor.java:64)
>        at org.josql.expressions.SelectItemExpression.init(SelectItemExpression.java:71)
>        at org.josql.Query.init(Query.java:2127)
>        at org.josql.Query.parse(Query.java:2048)
> [...]
>
> Also, I'm surprised to get an HTML result when I asked for
> JSON. Shouldn't the error be returned as a JSON object?
>
> Cheers,
>
> Lionel
>

Mime
View raw message