users@grizzly.java.net

Re: [Jersey] Strange Exception on Linux java.lang.IllegalArgumentException: java.net.URISyntaxException: Expected hostname at index 8: https://:443/

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Wed, 09 May 2012 07:43:16 -0700

On 5/9/12 1:11 AM, Pavel Bucek wrote:
> Hello Marcel,
>
> looks like there is a request for which
> org.glassfish.grizzly.http.server.Request.getServerName() method
> returns "" (empty string). CCing grizzly users mailing list - I'm not
> sure whether we are using Grizzly Request properly - so my question
> for Grizzly list is: when (and why) can this happen?
Assuming the request is HTTP/1.1, the value should be based on the Host
header. If the header was missing the code assumes HTTP/1.0 and would
use the host name of the local address of the server.

It would be useful to see the request that is causing this.

>
> Thanks,
> Pavel
>
> GrizzlyContainer.java (see line 226):
> http://java.net/projects/jersey/sources/svn/content/trunk/jersey/jersey-grizzly2/src/main/java/com/sun/jersey/server/impl/container/grizzly2/GrizzlyContainer.java?rev=5698
>
>
> On 5/4/12 5:40 PM, Marcel Büsch wrote:
>> Hi
>>
>> I use jersey with the grizzly2 httpserver.
>> On a Windows Box, everything works like a charm, but on Linux I get
>> strange Exceptions from the grizzly2 Container:
>> java.lang.IllegalArgumentException: java.net.URISyntaxException:
>> Expected hostname at index 8: https://:443/
>>
>> I do not even use the port 443. My server runs on
>> https://localhost:9960/. And the server works like expected.
>>
>> The only thing is this Exception every 3-5 seconds:
>>
>> May 4, 2012 5:00:27 PM org.glassfish.grizzly.http.server.HttpHandler
>> doHandle
>> SEVERE: service exception
>> java.lang.IllegalArgumentException: java.net.URISyntaxException:
>> Expected hostname at index 8: https://:443/
>> at
>> com.sun.jersey.server.impl.container.grizzly2.GrizzlyContainer.getBaseUri(GrizzlyContainer.java:226)
>> at
>> com.sun.jersey.server.impl.container.grizzly2.GrizzlyContainer._service(GrizzlyContainer.java:195)
>> at
>> com.sun.jersey.server.impl.container.grizzly2.GrizzlyContainer.service(GrizzlyContainer.java:185)
>> at
>> org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:163)
>> at
>> org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:195)
>> at
>> org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:163)
>> at
>> org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:158)
>> at
>> org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
>> at
>> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:286)
>> at
>> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:223)
>> at
>> org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:155)
>> at
>> org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:134)
>> at
>> org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
>> at
>> org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:827)
>> at
>> org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:103)
>> at
>> org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:111)
>> at
>> org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
>> at
>> org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:131)
>> at
>> org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:508)
>> at
>> org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:488)
>> at java.lang.Thread.run(Thread.java:662)
>> Caused by: java.net.URISyntaxException: Expected hostname at index 8:
>> https://:443/
>> at java.net.URI$Parser.fail(URI.java:2810)
>> at java.net.URI$Parser.failExpecting(URI.java:2816)
>> at java.net.URI$Parser.parseHostname(URI.java:3352)
>> at java.net.URI$Parser.parseServer(URI.java:3198)
>> at java.net.URI$Parser.parseAuthority(URI.java:3117)
>> at java.net.URI$Parser.parseHierarchical(URI.java:3059)
>> at java.net.URI$Parser.parse(URI.java:3015)
>> at java.net.URI.<init>(URI.java:662)
>> at
>> com.sun.jersey.server.impl.container.grizzly2.GrizzlyContainer.getBaseUri(GrizzlyContainer.java:223)
>> ... 20 more
>>
>> Did anybody know anything about this, or how I can get detailed Debug
>> Logs from a grizzly server?
>>
>> --
>> Marcel Büsch
>> mbuesch_at_gmail.com <mailto:mbuesch_at_gmail.com>
>>
>