| Sun Java System Application Server |
This sample application demonstrates using a JNDI resource to connect
to a URL. The application uses an enterprise bean to display the contents of
a web page by connecting to its URL. The jndi-name element of the
enterprise bean in sun-ejb-jar.xml specifies a target URL. The
enterprise bean is invoked by a client class.
Note these additional configuration steps.
sun-ejb-jar.xml assumes that the HTTP
server port of the application server installation is 8080. If the port is
not 8080, modify sun-ejb.jar.xml before you compile and deploy
the sample application.
ear, context-root, and servlet alias
names in this sample are all jndi-url, this naming convention
is not necessary. The application runs when the name of each of these elements
is unique. Rebuild the application after changing the context-root
name (in application.xml) and the ear name (in build.xml).
Then redeploy and test the sample to confirm these changes.
The general instructions for building, deploying, and running sample applications are provided in Building, Deploying, and Running Sample Applications. In reading this document, use the following application-specific variables for this application:
install_dir is the directory where Application Server
is installed.
app_dir is the application base directory: install_dir/samples/jndi/apps/url.
jndi-url.ear.
Follow this general procedure:
build.xml, is in the app_dir
directory, specifically, install_dir/samples/jndi/apps/url.
install_dir/samples/jndi/apps/url/jndi-url.ear.
To run the application, enter these commands:
cd install_dir/samples/jndi/apps/url asant run
This command will display the contents of the file
install_dir/samples/index.html.
The URL specified in Run For more information on troubleshooting,
see Troubleshooting.
Copyright © 2006 Sun Microsystems, Inc.
All rights reserved. sun-ejb-jar.xml assumes that the HTTP server port of
the application server installation is 8080. If the port is other than 8080,
modify sun-ejb-jar.xml before compiling and deploying the sample application.
asant undeploy before redeploying this sample.
This will ensure that all modules are undeployed and that the resources are disabled.