[jboss-as7-dev] Q about http management api

Jason Greene jgreene at redhat.com
Mon Apr 2 08:46:47 EDT 2012



Sent from my iPhone

On Apr 2, 2012, at 4:37 AM, "Heiko W.Rupp" <hrupp at redhat.com> wrote:

>> From time to time I see
> 
> 405 errors
> 
> 11:16:10,103 DEBUG [ASConnection] We got a 405 for url http://127.0.0.1:49990/management and operation Operation{operation='read-attribute', address=Address{path: }, additionalProperties={name=launch-type, include-defaults=true}}, method=POST
> 
>            conn = (HttpURLConnection) url.openConnection();
>            conn.setDoOutput(true);
>            conn.setRequestMethod("POST");
>            conn.addRequestProperty("Content-Type", "application/json");
>            conn.addRequestProperty("Accept", "application/json");
> 
> My understanding is that those only should show when content type is wrong. Looking at the sources I see that they
> may happen
> - on OPTIONS method (which we don't do)
> - for other contexts that only support GET ( like / )
> 
> Any idea what may go wrong here?

It could also be cross-site restrictions were violated (Origin header).



> 
> And then for requests for stuff that is e.g. not deployed , the API returns "internal server error" 500,
> 
> 11:16:15,370 ERROR [ASConnection] Operation{operation='read-resource', address=Address{path: subsystem=connector}, additionalProperties={include-defaults=true}} failed with 500 (Internal Server Error) - response body was [{"outcome" : "failed", "failure-description" : "JBAS014739: No handler for read-resource at address [(\"subsystem\" => \"connector\")]", "rolled-back" : true}].
> 
> I think a 404 not found would be much more correct. Especially as it looks like URLConnections throw exceptions on 500 
>   Heiko
> 

404 means the URL isn't there, but it is there. This is the only way to indicate a post failure.
> -- 
> Reg. Adresse: Red Hat GmbH, Technopark II, Haus C, 
> Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
> Handelsregister: Amtsgericht München HRB 153243
> Geschaeftsführer:  Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera
> 
> 
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev



More information about the jboss-as7-dev mailing list