Skip to main content

Glassfish web start application client connection settings

8 replies [Last post]
pepijn_schmitz
Offline
Joined: 2007-05-14

I'm having a lot of trouble getting an application client to work correctly being served via web start with Glassfish v2ur2 behind an Apache web server serving as reverse proxy. Glassfish seems to be ignoring all my attempts to tell the client where to connect to, and it's impossible to find any decent documentation about the Glassfish application client web start mechanism.

Hopefully someone here can help me answer these questions:

* How can I make Glassfish include the correct protocol, host name and port number in the JNLP file it generates? (It's putting in http://localhost:8080/, which is obviously useless. It should be https://www.supplierdna.com/.)
* How can I tell the application client to use SSL and to correct to the right server and port? (Glassfish seems to be ignoring both the sun-acc.xml file in the application client, as well as the sun-acc.xml file in the domain config directory. I have target-server www.supplierdna.com and port 3820 in both, but the app tries to connect to server 127.0.1.1, port 3700, which is obviously useless).
* Where can I find some comprehensive, in-depth documentation about how all this works (especially how the connection settings are communicated to the client, and where the server gets them from)?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rsh
Offline
Joined: 2008-11-19

I had the Same Problem, but found the real Problem and the Solution.

Problem:

Server is on a Linux Server !Important for the Error! Used Galssfish 2ur2
Client on a diffent Machine (in my case XP, but doesnt matter)
When i connect to the Server I get an error that I cant connect to 127.0.1.1

What really happend:

I looked with Wireshark and found out that the Client connects to the Server as defined in the Settings.
The Server answered an sent a redirect to 127.0.1.1.
The Clinet tries to connect and Failed.

So the Problem is on the Server not the Client.

Solution:

I found that in Linux the Hostname of the Computer is also in the /etc/hosts file and
(you think of it) with 127.0.1.1
Glassfish tries to get the external IP of the Computer and finds this entry in the hosts file and uses this IP.

I just changed the IP in the hosts file (and restarted Glassfish) and -voila no more redirects. The App works as ever.

Hope this helps someone else. If it does spread this Info to other Lists you came across. Thanx!

tjquinn
Offline
Joined: 2005-03-30

> * How can I make Glassfish include the correct
> protocol, host name and port number in the JNLP file
> it generates? (It's putting in
> http://localhost:8080/, which is obviously useless.
> It should be https://www.supplierdna.com/.)

GlassFish uses whatever is returned by servletRequest.getRemoteHost and getRemotePort. Do Dick's earlier comments help?

> * How can I tell the application client to use SSL
> and to correct to the right server and port?
> (Glassfish seems to be ignoring both the sun-acc.xml
> file in the application client, as well as the
> sun-acc.xml file in the domain config directory. I
> have target-server www.supplierdna.com and port 3820
> in both, but the app tries to connect to server
> 127.0.1.1, port 3700, which is obviously useless).

See https://glassfish.dev.java.net/issues/show_bug.cgi?id=3900. We hope to address this soon.

pepijn_schmitz
Offline
Joined: 2007-05-14

> GlassFish uses whatever is returned by
> servletRequest.getRemoteHost and getRemotePort. Do
> Dick's earlier comments help?

I haven't tried them yet; I've temporarily reverted to making the Glassfish ports directly available on the server. I want to try and get it to work that way first and then tackle putting it behind the reverse proxy.

> > * How can I tell the application client to use SSL
> > and to correct to the right server and port?
> > (Glassfish seems to be ignoring both the
> sun-acc.xml
> > file in the application client, as well as the
> > sun-acc.xml file in the domain config directory. I
> > have target-server www.supplierdna.com and port
> 3820
> > in both, but the app tries to connect to server
> > 127.0.1.1, port 3700, which is obviously useless).
>
> See
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=
> 3900. We hope to address this soon.

I'm not sure that's the same issue. In my case it seems to be using the wrong address, as well as port number. The server is telling the app client to contact it at the address 127.0.1.1 (I have no idea where it's getting that from), so I can't even get it to work *without* SSL. Do you know where it might be getting that IP address from and how I can tell Glassfish which hostname/IP address to give to its clients?

chrjohn
Offline
Joined: 2008-03-11

Hi,

I'm not sure if I got your problem right, but did you try to use the JnlpDownloadServlet with your app?
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloa...

We also use it to make our application downloadable from behind a proxy server.

Cheers
Chris

pepijn_schmitz
Offline
Joined: 2007-05-14

> I'm not sure if I got your problem right, but did you
> try to use the JnlpDownloadServlet with your app?
> http://java.sun.com/j2se/1.5.0/docs/guide/javaws/devel
> opersguide/downloadservletguide.html

Thanks for the tip. However, I've temporarily given up on getting it to run behind a reverse proxy, first I want to get it to work with direct connections. I'm still not able to get the application client to use SSL.

I must say I find the process very frustrating. Glassfish seems to go out of its way to make it difficult to distribute an application client which is 1) distributed over SSL, 2) communicates with the server over SSL and 3) has to authenticate itself with a particular certificate (surely very reasonable requirements for an enterprise application platform?), and there is next to no documentation about it. I keep running into brick walls...

I'm sure I could get it to work manually, but surely Glassfish's automatic web start mechanism for application clients should be able to do this in order to be useful in the real world?!

Manfred Riem

Have a look at http://www.manorrock.com/documents/glassfish/proxy_ssl.html,
maybe that can help you out.

Manfred

-----Original Message-----
From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org]
Sent: Saturday, August 30, 2008 10:11 AM
To: users@glassfish.dev.java.net
Subject: Re: Glassfish web start application client connection settings

> I'm not sure if I got your problem right, but did you
> try to use the JnlpDownloadServlet with your app?
> http://java.sun.com/j2se/1.5.0/docs/guide/javaws/devel
> opersguide/downloadservletguide.html

Thanks for the tip. However, I've temporarily given up on getting it to run behind a reverse proxy, first I want to get it to work with direct connections. I'm still not able to get the application client to use SSL.

I must say I find the process very frustrating. Glassfish seems to go out of its way to make it difficult to distribute an application client which is 1) distributed over SSL, 2) communicates with the server over SSL and 3) has to authenticate itself with a particular certificate (surely very reasonable requirements for an enterprise application platform?), and there is next to no documentation about it. I keep running into brick walls...

I'm sure I could get it to work manually, but surely Glassfish's automatic web start mechanism for application clients should be able to do this in order to be useful in the real world?!
[Message sent by forum member 'pepijn_schmitz' (pepijn_schmitz)]

http://forums.java.net/jive/thread.jspa?messageID=296311

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Alex Sherwin

Can you write your own jnlp? I write my own and serve it with GlassFish, specs are here for 1.5.0:

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/content...

All you need is a jnlp file, and the web server serving it needs to have the mime-type registered (GlassFish appears to have this by default, the above referenced doc tells you how to add it to apache). Once you do this, linking to a jnlp should make the web server serve it to the client browser correctly, and its up to the client to have jnlp files associated with java web start

Alex Sherwin
alex.sherwin@acadiasoft.com

-----Original Message-----
From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org]
Sent: Thursday, August 28, 2008 9:56 AM
To: users@glassfish.dev.java.net
Subject: Glassfish web start application client connection settings

I'm having a lot of trouble getting an application client to work correctly being served via web start with Glassfish v2ur2 behind an Apache web server serving as reverse proxy. Glassfish seems to be ignoring all my attempts to tell the client where to connect to, and it's impossible to find any decent documentation about the Glassfish application client web start mechanism.

Hopefully someone here can help me answer these questions:

* How can I make Glassfish include the correct protocol, host name and port number in the JNLP file it generates? (It's putting in http://localhost:8080/, which is obviously useless. It should be https://www.supplierdna.com/.)
* How can I tell the application client to use SSL and to correct to the right server and port? (Glassfish seems to be ignoring both the sun-acc.xml file in the application client, as well as the sun-acc.xml file in the domain config directory. I have target-server www.supplierdna.com and port 3820 in both, but the app tries to connect to server 127.0.1.1, port 3700, which is obviously useless).
* Where can I find some comprehensive, in-depth documentation about how all this works (especially how the connection settings are communicated to the client, and where the server gets them from)?
[Message sent by forum member 'pepijn_schmitz' (pepijn_schmitz)]

http://forums.java.net/jive/thread.jspa?messageID=295912

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Dick Davies

On Thu, Aug 28, 2008 at 2:55 PM, wrote:
> I'm having a lot of trouble getting an application client to work correctly being served via web start with Glassfish v2ur2 behind an Apache web server serving as reverse proxy. Glassfish seems to be ignoring all my attempts to tell the client where to connect to, and it's impossible to find any decent documentation about the Glassfish application client web start mechanism.
>
> Hopefully someone here can help me answer these questions:

I know nothing about jnlp but I have used apache mod_proxy with other
services and seen similar problems.

> * How can I make Glassfish include the correct protocol, host name and port number in the JNLP file it generates? (It's putting in http://localhost:8080/, which is obviously useless. It should be https://www.supplierdna.com/.)

Is that what apache is proxying to? Apache will be resetting the
host:port headers on the proxy
requests its making, try setting something like

RequestHeader set X_FORWARDED_PROTO 'https'
RequestHeader set Host supplierdna.com

and so on.

--
Rasputnik :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net