Sunday, 15 January 2012

java - Jersey UniformInterfaceException when doing a POST with docker-client -



java - Jersey UniformInterfaceException when doing a POST with docker-client -

when trying post restful service via docker-client private docker registry error. confusing thing input stream changes can see here. made somewhere in background of bailiwick of jersey cannot find cause it. guess problem occurs somewhere within bailiwick of jersey logic

method

public static service initservice(string imageid) { final com.spotify.docker.client.dockerclient docker = new defaultdockerclient( "http://10.###.###.143:2375"); string s = null; seek { s = ("10.###.###.143:5000/user/ipatest&tag=latest"); docker.pull(s); system.out.println(docker.tostring()); } grab (dockerexception | interruptedexception e) { // todo auto-generated grab block e.printstacktrace(); }

exception

com.spotify.docker.client.dockerrequestexception: request error: post http://10.###.###.143:2375/v1.12/images/create?fromimage=10.###.###.143%3a5000%2fuser%2fipatest%26tag%3dlatest: 500 @ com.spotify.docker.client.defaultdockerclient.propagate(defaultdockerclient.java:563) @ com.spotify.docker.client.defaultdockerclient.request(defaultdockerclient.java:544) @ com.spotify.docker.client.defaultdockerclient.pull(defaultdockerclient.java:345) @ com.spotify.docker.client.defaultdockerclient.pull(defaultdockerclient.java:329) @ de.fhg.ipa.vfk.eapps.commoniaas.docker.dockerservicemgmt.initservice(dockerservicemgmt.java:43) @ de.fhg.ipa.vfk.eapps.commoniaas.docker.dockerservicemgmt.main(dockerservicemgmt.java:163) caused by: com.sun.jersey.api.client.uniforminterfaceexception: post http://10.###.###.143:2375/v1.12/images/create?fromimage=10.###.###.143%3a5000%2fuser%2fipatest%26tag%3dlatest returned response status of 500 internal server error @ com.sun.jersey.api.client.webresource.handle(webresource.java:688) @ com.sun.jersey.api.client.webresource.access$200(webresource.java:74) @ com.sun.jersey.api.client.webresource$builder.method(webresource.java:623) @ com.spotify.docker.client.defaultdockerclient.request(defaultdockerclient.java:540) ... 4 more

it must have queryparams(string params) belongs webresource (jersey)

the image name you're passing pull isn't valid. format image name name:tag. instead:

docker.pull("10.###.###.143:5000/user/ipatest:latest");

alternatively, can ommit :latest, since implied when no other tag specified.

java web-services jersey uri docker

No comments:

Post a Comment