Deployment is necessary for application clients that communicate with EJB components or that use Java Web Start launch support. Java Web Start is supported for application clients and for applications that contain application clients. By default, Java Web Start is enabled in application clients and in GlassFish Server.
Note - The Application Client Container is supported only in the GlassFish Server Full Platform Profile, not in the Web Profile.
The following topics are addressed here:
The client JAR file is created.
The EJB JAR file is created.
An EAR file contains all the components of the application.
Instructions are contained in To Deploy an Application or Module.
The client artifacts contain the ties and necessary classes for the application client. In this release of GlassFish Server, the client artifacts include multiple files. You can use either the get-client-stubs subcommand or the --retrieve option of the deploy subcommand, but you do not need to use both.
The appclient script is located in the as-install/bin directory.
If you are using the default server instance, the only required option is -client, which points to the client JAR file. For example:
appclient -client converterClient.jar
The -xml parameter, which specifies the location of the sun-acc.xml file, is also required if you are not using the default instance.
For more detailed information about the appclient script, see appclient(1M).
For more detailed information about creating application clients, see Chapter 10, Developing Java Clients, in Oracle GlassFish Server 3.1 Application Development Guide. This chapter includes information on the following topics:
Accessing EJB components and JMS resources from application clients
Connecting to a remote EJB module through a firewall
Using Java Web Start and creating a custom JNLP file
Using libraries with application clients
Specifying a splash screen, login retries, and other customizations
The default URL format for a standalone application client module is http://host:port/module-id. For example:
To set a different URL for an application client, set the context-root subelement of the java-web-start-access element in the glassfish-application-client.xml file.
If the context-root or module-id is not specified during deployment, the name of the EAR or JAR file without the .ear or .jar extension is used. For an application, the relative path to the application client JAR file is also included. If the application or module is not in EAR or JAR file format, a context-root or module-id is generated. Regardless of how the context-root or module-id is determined, it is written to the server log. For details about naming, see Naming Standards.
Before You Begin
This task applies if you want to use the appclient script to run the application client on a system other than where the server runs.
Use the package-appclient script in the as-install/bin directory. This JAR file is created in the as-install/lib/appclient directory.
For example: jar xf filename.jar
If you used the package-appclient script, this file is located in the appclient/appserv/lib/appclient directory by default.
This file is located in appclient/appserv/bin by default if you used the package-appclient script.
You are now ready to run the client.
For more detailed information about Java Web Start and the package-appclient script, see appclient(1M).
After application clients are downloaded, they remain on the client until they are manually removed. Use the Java Web Start control panel to discard downloaded application clients that used Java Web Start.
If you undeploy an application client, you can no longer use Java Web Start, or any other mechanism, to download that application client because it might be in an inconsistent state. If you try to launch an application client that was previously downloaded (even though the server side of the application client is no longer present), the results are unpredictable unless the application client has been written to tolerate such situations.
You can write your application client so that it detects failures in contacting server-side components, but continues running. In this case, Java Web Start can run an undeployed application client while the client is cached locally. For example, your application client can be written to detect and then recover from javax.naming.NamingException when locating a resource, or from java.rmi.RemoteException when referring to a previously-located resource that becomes inaccessible.