users@glassfish.java.net

Re: application client project and external jars

From: <glassfish_at_javadesktop.org>
Date: Wed, 01 Apr 2009 07:28:30 PDT

Hi.

As the developer of the app, you will need to make sure that your client has access to whatever libraries it needs. There are several ways to do this: for example, package the JAR in the application so the client has access, or place the JAR into the client system's Java extensions directory. Placing the JAR into a server-side directory that only the server has access to will not make it accessible to your client.

You did not say whether you are building a stand-alone app client or an app client that is inside an EAR. If the app client is inside an EAR, you could put the MySQL JAR into the EAR's library directory (/lib by default or whatever you specify as <library-directory> in the application.xml if your app has one).

If you are deploying a stand-alone app client then you'll need to provide the MySQL JAR some other way. There is no support, either in the Java EE spec or in GlassFish, for library JARs packaged inside stand-alone app client JARs.

Hope that helps some.

A side question: Do you intend for your client to access a MySQL database, as opposed to the client accessing a server component such as an EJB which in turn accesses the database from the server? There's nothing inherently wrong with that; I just want to make sure I understand what you are trying to do.

- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]

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