-
1. Re: Exception with Rest API - Precondition Failed, failed to execute: javax.ws.rs.WebApplicationException
jbertram Jan 16, 2012 5:42 PM (in response to mackerman)A quick look at the code (i.e. org.hornetq.rest.topic.SubscriptionsResource) reveals the exception being thrown is this:
throw new WebApplicationException(Response.status(405)
.entity("Failed to find subscriber " + subscriptionId + " you will have to reconnect")
.type("text/plain").build());
Although, I'm not sure why it's being translated into a 412 on the client.
Do you have a reproducible test-case? What are the circumstances around the error. What's your use-case?
-
2. Re: Exception with Rest API - Precondition Failed, failed to execute: javax.ws.rs.WebApplicationException
mackerman Jan 17, 2012 11:39 AM (in response to jbertram)Thanks for your prompt reply Justin.
Our use case is that we have a topic configured as:
<topic name="asyncEvents">
<entry name="/topic/asyncEvents"/>
</topic>
We then have a Rest client that creates an auto-ack subscription as described in the HornetQ Rest doc @ http://docs.jboss.org/hornetq/2.2.5.Final/rest-interface-manual/html_single/#d0e533
As messages are published we want our client to receive the messages using Rest polling. Occassionally, we see the error above when polling for messages.
I wouldn't say that we have a reproducable test-case, rather, we are consistently seeing the exception in our development system. We have a cluster of 2 JBoss servers, both running exactly the same application, and one of the server consistently is getting the exception, whereas the other is not.
-
3. Re: Exception with Rest API - Precondition Failed, failed to execute: javax.ws.rs.WebApplicationException
mackerman Jan 17, 2012 4:33 PM (in response to mackerman)FYI, The problem was with the client coding, which wasn't implementing polling correctly. It wasn't getting the new URL to make a request to from the 503 response. This all worked fine for some reason before we used a load-balancer, however, with that in the mix, the URL that the request was made to was invalid, resulting in the bad response.