Geronimo redirects every HttpURLConnection to localhost

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Geronimo redirects every HttpURLConnection to localhost

FlorianS

Hi,

 

I’ve written a small WebService (for testing purposes mainly) for my Geronimo 2.2.1, which opens an URLConnection to an http address. Strangly, I was always getting a FileNotFoundException (in other words, a 404 error), but when entering the URL into my browser, it worked flawlessly. So, after some testing and reading the error-output, I found out that Geronimo seemso to redirect that URLConnection to localhost – which then throws a 404, of course.


For example…

 

http://mydomain.com/somewhere/something.html

 

returns the (Geronimo) error html page that /somewhere/something.html  does not exist. Err… Yes, because I didn’t want localhost:8080/somewhere/something.html…


Has anyone an idea where this behavior comes from?

 

Regards,

 

Flo

Reply | Threaded
Open this post in threaded view
|

Re: Geronimo redirects every HttpURLConnection to localhost

David Jencks
<base href="x-msg://249/">It's been years since I've looked at this and I don't recall what the spec says should happen…. however I wonder if you have a wsdl and what host it specifies?

david jencks

On Jul 26, 2013, at 1:22 AM, Florian Schaetz <[hidden email]> wrote:

Hi,
 
I’ve written a small WebService (for testing purposes mainly) for my Geronimo 2.2.1, which opens an URLConnection to an http address. Strangly, I was always getting a FileNotFoundException (in other words, a 404 error), but when entering the URL into my browser, it worked flawlessly. So, after some testing and reading the error-output, I found out that Geronimo seemso to redirect that URLConnection to localhost – which then throws a 404, of course.

For example…
 
 
returns the (Geronimo) error html page that /somewhere/something.html  does not exist. Err… Yes, because I didn’t want localhost:8080/somewhere/something.html…

Has anyone an idea where this behavior comes from?
 
Regards,
 
Flo

Reply | Threaded
Open this post in threaded view
|

Re: Geronimo redirects every HttpURLConnection to localhost

FlorianS
In reply to this post by FlorianS
<base href="x-msg://249/">

> It's been years since I've looked at this and I don't recall what the spec says should happen…. however I wonder if you have a wsdl and what host it specifies?

 

Fortunately(?), the problem was, that some (not me, luckily) had an EJB running which set the Proxy – to localhost:8080. After changing that, everything went smoothly again. Had a fun time finding that little trap.

 

Regards,


Flo