![]() |
JAXM Tag Library Sample Application |
JAXM Tag Library Sample Application
This document describes how to utilize the JAXM Tag Library sample application in conjunction with the Sun ONE Application Server version 7.This sample application document contains the following sections:
- Overview
- Compiling and Assembling the Application
- Deploying the Sample Application
- Running the Sample Application
- Troubleshooting
Overview
The purpose of this document is to demonstrate the support for the Java API for XML Messaging in the Sun ONE application server.
The Java API for XML Messaging
The Java API for XML Messaging (JAXM) Optional Package enables applications to send and receive document oriented XML messages using a pure Java API. JAXM implements Simple Object Access Protocol (SOAP) 1.1 with Attachments messaging so that developers can focus on building, sending, receiving, and decomposing messages for their applications instead of programming low level XML communications routines.This sample application uses JavaServer Pages tags to generate and consume a SOAP message.
For more information on JAXM, go to http://java.sun.com/xml/jaxm/index.html.
<install_root>/samples/webservices/jaxm/jaxmtags/src/ .
Compiling and Assembling the Application
This section describes how to compile and assemble the application using a Command Line Interface.See the Sample Application Build Facility document for details on using a build facility.
To rebuild the entire application from scratch, perform the following steps:
Deploying the Sample Application
To deploy the application, do the following:This sample application requires certain permissions to be granted in order to run successfully. Please append the following line of text in bold to the <install_root>/domains/domain1/server1/config/server.policy file.
// This permission apply to the privileged jaxmtags webapp grant codeBase "file:${com.sun.aas.installRoot}/domains/domain1/server1/applications/j2ee-modules/-" { permission java.util.logging.LoggingPermission "control", ""; };Please restart your server instance for the changes to take effect.
Execute the command asant deploy under <install_root>/samples/webservices/jaxm/jaxmtags/src
This will deploy the jaxmtags.war file located under <install_root>/samples/webservices/jaxm/jaxmtags/
Note You must run asant undeploy before redeploying this sample. This will ensure that all modules are undeployed and the resources are disabled.
Verifying Deployment
As an optional step, you can use the Sun ONE Application Server Administration Tool to verify that the application has been registered. Otherwise, proceed directly to Running the Sample Application.To verify the registration of the application, do the following:
Execute the command asadmin list-components to look at applications deployed with a server instance. For example:
<install_root>/bin/asadmin list-components -u <username> -w <password> -H <host> -p <port> <server instance name>
Running the Sample Application
You can run the application through the following URL:http://<hostname>:<port>/jaxmtags
Run the three samples on the page by clicking their links. The resulting pages show soap messages being generated and consumed by the jsp page as illustrated by the "Request dump" and "Response dump" headings.
The files created by the sample, request.msg and reply.msg, are located under <install_root>/domains/domain1/<server-instance>/config/
Troubleshooting
Some Known Issues
- If you encounter problems when running the application, review the log files at <install-root>/domains/domain1/<server-instance>/logs/server.log to learn what exactly went wrong.
- The sample can not be deployed from the application server administration GUI, if Precompile JSPs option is selected. Solution is, try deploying the application without Precompile JSPs, or deploy using asant.
- The sample can not be deployed using asadmin with option --precompilejsp=true. Solution is, try deploying the application without the option --precompilejsp=true, or deploy using asant.
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated July 12, 2002