Skip to main content

Standaloneclient application

2 replies [Last post]
haleh
Offline
Joined: 2012-09-14

Hi,

I am trying to write simple standalone client-server application.
Summary:
The GlassfishV3 is running on Remote host which (Linus/unix)server. I am developing the client/server application on Netbeans IDE.

The glassfish claims that in order to run standalone application I must put gf-client.jar on classpath and to do this we have to do it directly from glassfish home directory because this file also points to lots of .jar files.

My question is that since my Glassfish home is located on Remote host how to address this file on my client application class-path?

Do I need to have Glassfish also installed also on each client in order to put this gf-client.jar on class-path?

Thanks in advance,
h.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pljosh
Offline
Joined: 2006-12-05

If you want my advice: DO NOT use EJB for client-server communication. I
have created and ran 2 projects utilizing such a communication for few
years and from a perspective I can tell it was not such a pleasant
experience (maybe you could find some mails of mine between 2006 and 2009).

If I were you, I would use JAX-RS with Jackson (JSON) instead. Easy to use,
well itegrated (part of JEE6), light-weight on libraries size on client.
Just use @Path instead of @Remote.

Regards,
Witold Szczerba
On Sep 14, 2012 10:06 PM, wrote:

> Hi, I am trying to write simple standalone client-server application.
> Summary: The GlassfishV3 is running on Remote host which
> (Linus/unix)server.
> I am developing the client/server application on Netbeans IDE. The
> glassfish
> claims that in order to run standalone application I must put gf-client.jar
> on classpath and to do this we have to do it directly from glassfish home
> directory because this file also points to lots of .jar files. My question
> is
> that since my Glassfish home is located on Remote host how to address this
> file on my client application class-path? Do I need to have Glassfish also
> installed also on each client in order to put this gf-client.jar on
> class-path? Thanks in advance, h.
>
> --
>
> [Message sent by forum member 'haleh']
>
> View Post: http://forums.java.net/node/**890257
>
>
>

tjquinn
Offline
Joined: 2005-03-30

Hi.

You do need some (sadly, many) of the GlassFish server JARs on each remote client. (We always want to reduce the size and number of required JARs but other tasks always seem to take higher priority.)

If you need it, you can find documentation about writing application clients with GlassFish here

http://docs.oracle.com/cd/E26576_01/doc.312/e24930/java-clients.htm

which in turn points to this doc about the package-appclient script

http://docs.oracle.com/cd/E26576_01/doc.312/e24938/package-appclient.htm...

There you'll find out how to use the script and what to do next.

Hope that helps.

- Tim

haleh
Offline
Joined: 2012-09-14

Thanks alot for your great help!

I did the same instruction as you sent. Seems working...:-) Since we are very new with Glassfish and we are going to switch from jboss to Glassfish I will be back to you in case of any further problems or questions. Cheers,
h.