Deployment is only necessary for application clients that communicate with EJB components.
Java Web Start is supported for application clients and for applications that contain application clients. It is enabled by default both in application clients and in the Application Server.
If you are using Java Web Start, you should deploy the application or application client as an EAR or JAR file rather than using directory deployment. Java Web Start uses JAR files, which means that the Application Server must JAR application client files during deployment, resulting in slower performance.
This section contains the following topics:
Assemble the necessary client files.
Assemble the EJB components to be accessed by the client.
Package the client and EJB components together in an application.
Deploy the application as described in Tools for Deployment.
If Java Web Start is not enabled for the application client, retrieve the client JAR file.
The client JAR file contains the ties and necessary classes for the ACC client.
You can use the --retrieve option to get the client JAR file.
You can also use the asadmin get-client-stubs command to retrieve the stubs and ties whether or not you requested their generation during deployment. For details, see the Sun Java System Application Server Platform Edition 9 Reference Manual.
If Java Web Start is not enabled for the application client, copy the client JAR file to the client machine, and set the APPCPATH environment variable on the client to point to this JAR.
You can execute the client on the Application Server machine to test it in one of the following ways:
If Java Web Start is enabled for the application client, use the Launch button on the App Client Modules page to launch the application client using Java Web Start.
If Java Web Start is not enabled for the application client, use the appclient script in the install-dir/bin directory.The only required option is -client. For example:
appclient -client converterClient.jar
The -xml parameter specifies the location of the sun-acc.xml file.
For more detailed information about Java Web Start, see Chapter 11, Developing Java Clients, in Sun Java System Application Server Platform Edition 9 Developer’s Guide.
For more detailed information about the appclient script, see the Sun Java System Application Server Platform Edition 9 Reference Manual.
If Java Web Start is enabled, the default URL for an application is as follows:
http://host:port/context-root |
The default URL for a stand-alone application client module is as follows:
http://host:port/module-id |
If the context-root or module-id is not specified during deployment, the name of the EAR or JAR file without the 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.
To set a different URL for an application client, use the context-root subelement of the java-web-start-access element in the sun-application-client.xml file.
If Java Web Start is not enabled for the application client, follow these steps.
You can use the package-appclient script in the install-dir/bin directory to create the ACC package JAR file. This is optional.
This JAR file is created in the install-dir/lib/appclient directory.
Copy the ACC package JAR file to the client machine and unjar it.
Configure the sun-acc.xml file.
This file is located in the appclient/appserv/lib/appclient directory by default if you used the package-appclient script.
Configure the asenv.conf (asenv.bat on Windows) file.
This file is located in appclient/appserv/bin by default if you used the package-appclient script.
Copy the client JAR file to the client machine.
You are now ready to execute the client.
For more detailed information about Java Web Start and the package-appclient script, see Chapter 11, Developing Java Clients, in Sun Java System Application Server Platform Edition 9 Developer’s Guide.
Once application clients are downloaded, they remain on the client until removed manually. The Java Web Start control panel provides a simple interface you can use to discard downloaded application clients that used Java Web Start. When you undeploy an application client, you can no longer use Java Web Start, or any other mechanism, to download the application client. 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 depend on whether the application client has been written to tolerate such situations.
You can write your application client to detect failures in contacting server-side components and to continue running anyway. In this case, Java Web Start can run an undeployed application client as it is cached locally. For example, your application client can be written to catch and recover from a javax.naming.NamingException in locating a resource or a java.rmi.RemoteException in referring to a previously-located resource that becomes inaccessible.