The problem is not really related to GlassFish.
Stream handler unavailable due to: For input string: "0:0:0:0:0:0:1:8080"
This part of the error message shows that something is trying to work with an IPv6 address. I guess the class javax.ws.rs.client.ClientBuilder
can't handle that correctly.
If you have enabled dual-stack network (IPv4 and IPv6) on your desktop computer, it seems that httpServletRequest.getLocalName()
returns the IPv6 address first (0:0:0:0:0:0:1
).
There may a solution how to change that behaviour in your OS but there is also an alternative way of getting the IP:
httpServletRequest.getServerName()
or
FacesContext.getCurrentInstance().getExternalContext().getRequestServerName()
Use it instead of httpServletRequest.getLocalName()
in the init()
method of MovieClientBean
. It should return the address in IPv4 format and make it work.
See also: