Support Readiness Document Java™ Web Services Developer
Transcription
Support Readiness Document Java™ Web Services Developer
Support Readiness Document Java™ Web Services Developer Pack Web Container and Tools Overview, Version 1.0_01 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. 650-960-1300 December 2002 Copyright 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. This document and the product to which it pertains are distributed under licenses restricting their use, copying, distribution, and decompilation. No part of the product or of this document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and in other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, Java, Java 2 Platform, J2SE, Java 2 Enterprise Edition, J2EE, Java 2 Software Development Kit, Java 2 SDK, Java API for XML Processing, Java API for XML Messaging, Java API for XML-based Remote Procedure Call, Java Development Kit, JDK, Java Virtual Machine, JVM, Java Web Services Developer Pack, Java XML Pack, Javadoc, JavaServer Pages, Java Secure Socket Extension, Java Platform Debugger Architecture, Sun ONE Studio, AnswerBook2, docs.sun.com, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and in other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and in other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements. U.S. Government Rights—Commercial use. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, Etats-Unis. Tous droits réservés. Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les Etats-Unis et dans les autres pays. Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, parquelque moyen que ce soit, sans l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y ena. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun. Des parties de ce produit pourront être dérivées des systèmes Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, Java, Java 2 Platform, J2SE, Java 2 Enterprise Edition, J2EE, Java 2 Software Development Kit, Java 2 SDK, Java API for XML Processing, Java API for XML Messaging, Java API for XML-based Remote Procedure Call, Java Development Kit, JDK, Java Virtual Machine, JVM, Java Web Services Developer Pack, Java XML Pack, Javadoc, JavaServer Pages, Java Secure Socket Extension, Java Platform Debugger Architecture, Sun ONE Studio, AnswerBook2, docs.sun.com, et Solaris sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d’autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d’autres pays. Les produits protant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. L’interface d’utilisation graphique OPEN LOOK et Sun™ a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développment du concept des interfaces d’utilisation visuelle ou graphique pour l’industrie de l’informatique. Sun détient une license non exclusive do Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant également les licenciées de Sun qui mettent en place l’interface d ’utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun. LA DOCUMENTATION EST FOURNIE "EN L’ÉTAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L’APTITUDE A UNE UTILISATION PARTICULIERE OU A L’ABSENCE DE CONTREFAÇON. Please Recycle Contents Preface 1. 2. 5 Java Web Services Developer Pack, Version 1.0_01, Web Container and Tools Overview 1 1.1 Overview 1 1.2 Features or Services Not Provided 1.3 Product Limitations 1.4 Introduction to Java WSDP 1.5 Specialized Terminology Apache Tomcat Server 2.1 Overview 2.2 Troubleshooting 2.3 2 3 3 3 4 4 4 2.2.1 Configuration and Administration Issues 2.2.2 Performance and Tuning Issues 2.2.3 Developer Issues 2.2.4 Tomcat Bugs 2.2.5 Error Message Guide 2.2.6 Troubleshooting Utilities Reference Information 4 6 7 9 9 10 10 Contents 1 3. Web Container Administration Tool 3.1 Overview 3.2 Features, Advantages, and Benefits 3.3 User's Guides and Tutorials 3.4 Localization and Internationalization 3.5 Frequently Asked Questions 3.6 Reference Information 3.6.1 4. 11 Tutorials 11 11 12 12 13 13 Ant 14 4.1 Overview 4.2 Features, Advantages, and Benefits 4.3 Features or Services Not Provided 4.4 Product Limitations 15 4.5 Introduction to Ant 15 4.6 Using and Supporting Ant 14 14 14 15 4.6.1 User’s Guides and Tutorials 4.6.2 Using Ant in a Development Environment 4.6.3 Localization and Internationalization 4.7 Code Samples 4.8 Troubleshooting 4.9 5. 11 15 16 16 17 4.8.1 Hardware and Software Dependencies 4.8.2 Configuration and Administration Issues 4.8.3 Ant Bugs Fixed in Version 1.4.1 18 Reference Information 17 18 18 4.9.1 Product Information 4.9.2 Technical Documentation 4.9.3 Frequently Asked Questions Deploytool 15 18 18 18 19 Contents 2 5.1 Overview 5.2 Features, Advantages, and Benefits 5.3 Features or Services Not Provided 5.4 Product Limitations 5.5 Introduction to Deploytool 5.6 Using and Supporting Deploytool 5.7 5.8 6. 19 19 20 20 21 21 5.6.1 User's Guides and Tutorials 5.6.2 Using Deploytool in a Development Environment 5.6.3 Localization and Internationalization Troubleshooting 21 21 22 22 5.7.1 Configuration and Administration Issues 5.7.2 Deploytool Bugs Reference Information 22 22 23 5.8.1 Technical Documentation 5.8.2 Tutorials and Other References JAXM Provider Administration Tool 23 23 24 6.1 Overview 24 6.2 Using and Supporting the JAXM Provider Administration Tool 6.3 Localization and Internationalization 6.4 Frequently Asked Questions 6.5 Reference Information 24 25 25 25 Contents 3 Preface This document provides support readiness information for the Java Web Services Developer Pack (WSDP), Version 1.0_01, Tools Overview. This document is not designed to provide comprehensive product training. Instead, it focuses on issues immediately relevant to support, such as changes in this version of the product, using and troubleshooting the product, and installing and configuring the product. Preface 5 1 Java Web Services Developer Pack, Version 1.0_01, Web Container and Tools Overview The following document may contain actual software programs in source code form. This source code is made available for developers to use as needed, pursuant to the terms and conditions of the license located at: http://access1.sun.com/SRDs/BSD.html 1.1 Overview The Java Web Services Developer Pack (WSDP) is a Java-based tool set and server that allows developers to build, test, and run Web services. Specifically, Java WSDP supports Java implementations of existing Web application technologies, such as Web Services Description Language (WSDL); Simple Object Access Protocol (SOAP); electronic business XML (ebXML); Universal Description, Discovery, and Integration (UDDI); Servlets; and JavaServer Pages (JSP), which developers can use to generate and serve HTML or other file formats to client applications, such as Web browsers. The Java WSDP is an all-in-one download, containing key technologies to simplify the building of Web services and Web applications using the Java 2 platform. Java WSDP includes the following: ■ Apache Tomcat, v. 4.1.2, server: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/index.html ■ The Java XML technologies contained in the Java XML Pack product: http://java.sun.com/xml/downloads/javaxmlpack.html The included Java XML technologies are as follows: Java Web Services Developer Pack, Version 1.0_01, Web Container and Tools Overview Sun Microsystems, Inc. 1 of 25 ■ ■ ■ ■ ■ ■ Java API for XML Messaging (JAXM), v. 1.1_01 Java API for XML Processing (JAXP), v. 1.2_01 Java API for XML Registries (JAXR), v. 1.0_02 Java API for XML-based RPC (JAX-RPC), v. 1.0_01 SOAP with Attachments API for Java (“SAAJ”), v. 1.1_02 JSP Standard Tag Library (JSTL), v. 1.0.1: http://jakarta.apache.org/taglibs/index.html ■ Apache Xindice Registry server http://xml.apache.org/xindice ■ ■ Web Application Deployment Tool: This is a GUI tool that is used for packaging Web applications and deploying them in the bundled Apache Tomcat server. Apache Ant, v. 1.4.1 http://jakarta.apache.org/ant Ant is a build tool written in the Java programming language. Ant is commonly used to compile Java source code into classes. It also supports the creation of .jar files and Javadoc. ■ Web Container Administration Tool (Admintool) The admintool can also be downloaded as a part of Tomcat at: http://jakarta.apache.org/tomcat/index.html JAXM Provider Administration Tool ■ The Provider Administration Tool is used to configure a messaging provider. This document covers the Apache Tomcat Web Container and the following tools: ■ ■ ■ ■ 1.2 Web Container Administration Tool (Admintool) Ant, v 1.4.1 Deploytool JAXM Provider Administration Tool Features or Services Not Provided The current version of the Java WSDP does not support Enterprise JavaBeans (EJB). Users who wish to develop or use EJBs must migrate to the Java 2 platform Enterprise Edition (J2EE). A description of J2EE is located at: http://java.sun.com/j2ee Java Web Services Developer Pack, Version 1.0_01, Web Container and Tools Overview Sun Microsystems, Inc. 2 of 25 1.3 Product Limitations Java WSDP executables will not load any installed Java extensions in the user’s <JAVA_HOME>/jre/lib/ext directory. 1.4 Introduction to Java WSDP Introductory materials for using Java WSDP and the Apache products and Java XML technologies bundled with the product are available in the Java WSDP tutorial. The Java WSDP tutorial is located at: http://java.sun.com/webservices/docs/1.0/tutorial/ index.html 1.5 Specialized Terminology Admintool: Refers to the Tomcat Administration Tool. Built-in Properties: Ant provides access to system properties using a set of built-in properties that can be referenced in build targets. For example, Ant has a property called ant.java.version that stores the Java Virtual Machine (JVM) version known to Ant. Project: This is the top-level structure in an Ant buildfile. An Ant buildfile contains a single project. A project has three attributes: a name, a default target, and a base directory. Property: A Property is a name/value pair. A project can have a set of properties. For example, there could be a property that defines the path to the build directory. A property can be defined in terms of other previously defined properties. Target: A target is a set of tasks that Ant will execute. A Project may contain several targets. A common target is a compile target, which will contain instructions for building the project’s application. Task: A Task is an executable instruction. Ant has many built-in tasks, such as a javac task that will compile Java source code. Inspector: There is a Clone Inspector menu item under Tools in the Deploytool. This refers to the lower right panel of the GUI. Choosing this menu item makes a copy of the Inspector window that can be moved separately from the main window. Verifier: This is a tool that verifies specification compliance of an application. Java Web Services Developer Pack, Version 1.0_01, Web Container and Tools Overview Sun Microsystems, Inc. 3 of 25 2 Apache Tomcat Server 2.1 Overview Apache's Tomcat server is easy to install and is preconfigured to transparently enable the Java implementations of existing Web application technologies that are bundled in the product. A description of Apache’s Tomcat, v. 4.1.2, server is located at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/index.html 2.2 Troubleshooting 2.2.1 Configuration and Administration Issues 2.2.1.1 Tomcat Configuration Files TABLE 2-1 Configuration Files File Description <JWSDP_HOME>/conf/jwsdp.properties This file is a Java properties file. Each of the applications reads this file and sets all of the properties in the file as system properties. Apache Tomcat Server Sun Microsystems, Inc. 4 of 25 TABLE 2-1 2.2.1.2 Configuration Files File Description <JWSDP_HOME>/conf/tomcat-users.xml This file is an internal user database for the Apache Tomcat server. The Apache Tomcat server validates user name, password, and group against this file for all web applications that have a <security-constraint> tag in their WEB-INF/ web.xml file. <JWSDP_HOME>/conf/server.xml This file is the master configuration file for the Apache Tomcat server. This file contains almost every configurable setting that the Apache Tomcat server supports. The most common items that users configure in this file are port numbers and logging levels. The Apache Tomcat server’s admin web application provides an HTML user interfaces for editing this file. <JWSDP_HOME>/conf/catalina.policy This file is the Java security manager policy file that the Apache Tomcat server uses when it is run with the Java security manager enabled. By default, the Apache Tomcat server runs with the Java security disabled. Users can choose to run the server with the Java security manager enabled by invoking the startup scripts with the -security command line argument. Deploytool and Tomcat Configuration is performed when the Web services pack is installed. The default Tomcat server for Deploytool is set at this time though, once the tool is running, the user can set a different server. No administration is necessary. The common configuration file is server.xml for configuring Tomcat. The administration tool helps you work with this file. 2.2.1.3 Common Configuration and Administration Problems Cannot Log Into Tomcat Applications ■ Problem: Cannot log into the Apache Tomcat server’s admin or manager Web applications. Apache Tomcat Server Sun Microsystems, Inc. 5 of 25 ■ Cause: This problem is usually due to the user entering a user name or password for a user that does not exist or is misconfigured in the <JWSDP_HOME>\conf\tomcat-users.xml file on Microsoft Windows platforms or the <JWSDP_HOME>/conf/tomcat-users.xml file on UNIX platforms. ■ Solution: To log into the admin Web application, the user must enter a user name and password that exists and have admin listed in the roles attribute for that user name in the above file. Cannot Enable HTTPS on a Port ■ Problem: Cannot enable HTTPS on a port. ■ Cause: When the user enables HTTPS on a port by uncommenting the SSL Connector entry in <JWSDP_HOME>\conf\server.xml on Microsoft Windows platforms or <JWSDP_HOME>/conf/server.xml on UNIX platforms and the Apache Tomcat server throws exceptions when trying to bind to the HTTPS port, the JSSE, v. 1.0.2, keystore is probably misconfigured or not configured at all. ■ Solution: Before enabling the HTTPS port, the user needs to create the JSSE keystore with the keytool by executing the following command: ■ Microsoft Windows platforms <JAVA_HOME>\bin\keytool -genkey -alias tomcat -keyalg RSA ■ UNIX platforms <JAVA_HOME>/bin/keytool -genkey -alias tomcat -keyalg RSA Note – The keytool will ask the user to set the password for the tomcat user. The user must set the password to changeit for the HTTPS port to work properly. 2.2.2 Performance and Tuning Issues The Apache Tomcat server application in the Java WDSP, v. 1.0, product has a performance issue. The Apache Tomcat server can take anywhere between one to five minutes to fully start. Apache Tomcat Server Sun Microsystems, Inc. 6 of 25 2.2.3 Developer Issues 2.2.3.1 Common Developer Questions The following Java Developer Connection (JDC) Forum archives deal specifically with common developer issues related to developing and deploying Web applications in the Apache Tomcat server. ■ Java Servlet Technology: http://forum.java.sun.com/forum.jsp?forum=33 ■ Java Technologies for Web Services: http://forum.java.sun.com/forum.jsp?forum=331 ■ JavaServer PagesTechnology: http://forum.java.sun.com/forum.jsp?forum=45 2.2.3.2 Common Developer Problems Tomcat Variables do not Work ■ Problem: Standard Apache Tomcat Server environment variables do not work. ■ Cause: In the Apache Tomcat server, the environment variables in TABLE 2-2 are used by the following scripts to enable certain options in the server: ■ Microsoft Windows platforms <JWSDP_HOME>\bin\startup.bat <JWSDP_HOME>\bin\catalina.bat <start|run> ■ UNIX platforms <JWSDP_HOME>/bin/startup.sh <JWSDP_HOME>/bin/catalina.sh <start|run> Due to the difficulty of handling paths with spaces and environment variables with = characters on some Microsoft Windows platforms, in the Java WSDP product most of the logic in the above scripts was moved out of the scripts and into Java code. As a result, all of environment variables that the scripts in the Apache release support will be ignored by the above scripts in the Java WSDP product. Apache Tomcat Server Sun Microsystems, Inc. 7 of 25 ■ Solution: TABLE 2-2 lists the environment variables that are supported by the Apache release’s scripts. For each environment variable, instructions for setting the equivalent behavior in the Java WSDP product are provided: TABLE 2-2 Supported Environmental Variables Variable Instructions CATALINA_HOME This is set automatically and cannot be set by the user. CATALINA_BASE The user can set this by adding the following command-line argument to the above scripts: <script> "-Dcatalina.base=<path>" <other script arguments> CATALINA_OPTS The user can pass any Java -D arguments and a limited set of Java -X arguments by adding these arguments as command-line arguments to the above scripts. <script> -Dxx=yy -Xdebug <other script arguments> CATALINA_TMPDIR The user can set this by adding the following command-line argument to the above scripts: <script> "-Djava.io.tmpdir=<path>" <other script arguments> JAVA_HOME This environment variable is set every time the above scripts are executed. It is set in the <JWSDP_HOME>\bin\setenv.bat file on Windows platforms and in the <JWSDP_HOME>/bin/setenv.sh file on UNIX platforms. Users can set this environment variable by manually editing this file. JAVA_OPTS The user can pass any Java -D arguments and a limited set of Java -X arguments by adding these arguments as command-line arguments to the above scripts. <script> -Dxx=yy -Xdebug <other script arguments> JPDA_TRANSPORT There is no exact equivalent for this environment variable. Instead, the user must add the following command-line arguments to the above scripts to set the transport option when running in JPDA mode: <script> -Xdebug -Xrunjdwp:transport=<transport>,<other JPDA options> <other script arguments> JPDA_ADDRESS There is no exact equivalent for this environment variable. Instead, the user must add the following command-line arguments to the above scripts to set the address option when running in JPDA mode: <script> -Xdebug -Xrunjdwp:address=<address>,<other JPDA options> <other script arguments> JSSE_HOME This is set automatically and cannot be set by the user. Apache Tomcat Server Sun Microsystems, Inc. 8 of 25 2.2.4 Tomcat Bugs 2.2.4.1 Known Bugs and Their Workarounds Apache maintains its own bug list for the Apache Tomcat server. BugTraq+ categories should be considered the most reliable list of open Java WSDP and Apache Tomcat server bugs. 2.2.5 Error Message Guide 2.2.5.1 Catalina.stop: java.net.ConnectException: Connection refused 2.2.5.2 ■ Problem: This exception usually occurs when the user executes the <JWSDP_HOME>\bin\shutdown.bat script on a Microsoft Windows platform or the <JWSDP_HOME>/bin/shutdown.sh script on a UNIX platform. ■ Cause: The problem is due to a limitation in the Apache Tomcat server. The Apache Tomcat server does not start listening for shutdown requests until it has fully started. Since the Apache Tomcat server requires anywhere from one to five minutes to fully start, the user will encounter the above exception if they invoke the above scripts soon after after starting the server. ■ Solution: The user must wait until the Apache Tomcat server is fully started. Then they can reinvoke the above scripts to shutdown the server. java.net.BindException: Address already in use:<port number> ■ Problem: This exception usualy occurs when the user executes one of the following scripts: ■ Microsoft Windows platforms: <JWSDP_HOME>\bin\startup.bat <JWSDP_HOME>\bin\catalina.bat <start|run> ■ UNIX platforms: <JWSDP_HOME>/bin/startup.sh <JWSDP_HOME>/bin/catalina.sh <start|run> Apache Tomcat Server Sun Microsystems, Inc. 9 of 25 ■ Cause: The catalina.* and startup.* scripts start the Apache Tomcat server. The server binds to several ports. ■ Solution: If another process is already bound, there are two solutions to this problem that the user can choose from: ■ ■ 2.2.6 Find the process that is already bound to the port that the server needs and terminate that process. Edit the Apache Tomcat server’s <JWSDP_HOME>\conf\server.xml file on Microsoft Windows platforms or the <JWSDP_HOME>/conf/server.xml file on UNIX platforms so that the server will bind to a port that is not used by any other processes. Troubleshooting Utilities The Apache Tomcat server provides several detailed log files, shown in TABLE 2-3, that may be useful for troubleshooting. These log files can be found in the <JWSDP_HOME>\logs directory on Microsoft Windows platforms and in the <JWSDP_HOME>/logs on UNIX platforms. TABLE 2-3 2.3 Standard Log Files and Their Contents Log File Content catalina.out This log file logs the Apache Tomcat server’s startup and shutdown messages and exceptions. access_log.*.txt These log files log the URLs that the Apache Tomcat server has received from client applications. jwsdp_log.*.txt These log files log all messages and exceptions generated by any Web applications running within the Apache Tomcat server that are not configured to use a different log file. localhost_admin_log.*.txt These log files log all messages and exceptions generated by the Apache Tomcat server’s administration webapp. services_log.*.txt These log files log all all messages and exception generated by any services running within the Apache Tomcat server. Reference Information ■ Apache Tomcat server documentation http://jakarta.apache.org/tomcat/tomcat-4.1-doc/index.html Apache Tomcat Server Sun Microsystems, Inc. 10 of 25 3 Web Container Administration Tool 3.1 Overview The admintool can be downloaded as a part of Tomcat at: http://jakarta.apache.org/tomcat/index.html The tool needs the Tomcat container to run. The admintool runs as a Web application deployed on Tomcat. 3.2 Features, Advantages, and Benefits The admintool utility is used to configure the behavior of Tomcat while it is running. Changes made to Tomcat using admintool can be saved persistently so that the changes remain when Tomcat is restarted or can be saved for the current session only. Admintool is an ease-of-use tool with a user friendly UI for changing Tomcat configuration using a set of graphic screens, instead of editing Tomcat’s configuration file conf/server.xml. 3.3 User's Guides and Tutorials The tutorial for the Tomcat admintool is located at: http://java.sun.com/webservices/docs/1.0/tutorial/doc/ Admintool.html Web Container Administration Tool Sun Microsystems, Inc. 11 of 25 3.4 Localization and Internationalization Admintool uses the Struts framework to internationalize and localize. More information on Struts is available at: http://jakarta.apache.org/struts/resources/tutorials.html The tool has been localized in Spanish. The default language is English. Struts uses properties files to store the different languages of the application. The default language is in the ApplicationResources.properties file. For other languages, there has to be a ApplicationResources_xx.properties file, where xx is the ISO 639 language code. 3.5 Frequently Asked Questions The most frequently asked question is what username and passord to use with the admintool to log in. If you are using the Java WSDP, log in to admintool using the user name and password combination defined when you installed the Java WSDP. This user name and password combination is assigned the roles of admin, manager, and provider by default. To use admintool, you must log in with a user name and password combination that has been assigned the role of admin. This user name and password must match the user name and password in the build.properties file. If you've forgotten the user name and password, you can find them in the file <JWSDP_HOME>/conf/tomcat-users.xml, which is viewable with any text editor. This file contains an element <user> for each individual user, for example: <user name="your_name" password="your_password" roles="admin, manager,provider" /> If using standalone Tomcat, you would manually have to edit the tomcat-users.xml file to include a user with the role admin. Web Container Administration Tool Sun Microsystems, Inc. 12 of 25 3.6 Reference Information 3.6.1 Tutorials ■ Admintool tutorials http://java.sun.com/webservices/docs/1.0/tutorial/doc/ Admintool.html http://java.sun.com/webservices/docs/1.0/tutorial/doc/ Admintool7.html#66818 Web Container Administration Tool Sun Microsystems, Inc. 13 of 25 4 Ant 4.1 Overview Ant, version 1.4.1, is a build tool written in the Java programming language. Ant is commonly used to compile Java source code into classes. Ant supports builtin tasks that work with several tools, including the Java compiler javac, the Java runtime java, the Java document preparation utility javadoc, and the jar file tool jar. 4.2 Features, Advantages, and Benefits Features of the Ant include: ■ ■ ■ 4.3 Cross Platform: Ant is a cross-platform build tool that can be used on any platform that supports Java. Extensible: The user can extend Ant to handle customized build tasks by writing Ant tasks in Java. Configurable: Ant is configured with a single XML-based configuration file usually named build.xml. Features or Services Not Provided Ant is a build tool best suited for compiling and building Java source code and for Java specific tasks, such as generating Javadocs. Although it is powerful, it is not a general purpose scripting language. For the compilation of legacy applications written in C or C++, traditional build tools, such as make or gnumake, may work better. Ant Sun Microsystems, Inc. 14 of 25 4.4 Product Limitations Ant’s limitations and workarounds are documented in an FAQ that is delivered with the Ant distribution. The local copy of the FAQ is in the docs directory as faq.html. The FAQ for the current Apache release of Ant is also available at: http://jakarta.apache.org/ant/faq.html 4.5 Introduction to Ant The Ant User’s Manual discusses how to install Ant, how to use Ant, and how to run Ant. A local copy of the manual is delivered with the Ant software and is found in the manual subdirectory under the docs directory in the distribution. The manual is also available online at: http://jakarta.apache.org/ant/manual 4.6 Using and Supporting Ant 4.6.1 User’s Guides and Tutorials The Ant tutorial is located at: http://jakarta.apache.org/ant/manual/index.html Ant has a set of FAQs, lists of published books, and articles listed at: http://jakarta.apache.org/ant/resources.html One particular book is Ant: The Definitive Guide by Jesse Tilly and Eric M. Burke, published by O'Reilly and Associates. 4.6.2 Using Ant in a Development Environment Ant is a development build tool especially suited for Java development. Once Ant is installed on the developer’s system, the developer will typically write a build script, build.xml, that configures Ant for a particular project. The build script is XML based. The details of the installation and usage of Ant are given in the Ant manual. The manual is provided with the Ant software package or on the Web at: http://jakarta.apache.org/ant/manual Ant Sun Microsystems, Inc. 15 of 25 4.6.3 Localization and Internationalization Ant, v. 1.4.1, is not localized or internationalized. 4.7 Code Samples The following document may contain actual software programs in source code form. This source code is made available for developers to use as needed, pursuant to the terms and conditions of the license located at: http://access1.sun.com/SRDs/BSD.html Ant is configured by the developer using a build script, build.xml. The following is a small build script example. The script has four build targets: compile, docs, jar and clean. <project name="MyProject" default="compile" basedir="."> <description> // build targets: // compile ... // docs ... // jar ... // clean ... </description> calls 'compile' target builds the javadoc builds the jar file for project cleans out the build area <!-- global properties --> <property <property <property <property <property <property <property name="src.dir" name="build.dir" name="dist.dir" name="classes.dir" name="docs.dir" name="javadocs.dir" name="jarfile.name" value="src" /> value="build" /> value="${build.dir}/dist" /> value="${build.dir}/classes" /> value="${build.dir}/docs" /> value="${docs.dir}/javadoc" /> value="myproject.jar" /> <target name="init"> <!-- create a time stamp --> <tstamp/> <!-- create subdirectory structure --> <mkdir dir="${build.dir}"/> <mkdir dir="${dist.dir}"/> <mkdir dir="${classes.dir}"/> <mkdir dir="${docs.dir}"/> <mkdir dir="${javadocs.dir}"/> </target> <target name="compile" depends="init"> Ant Sun Microsystems, Inc. 16 of 25 <javac srcdir="${src.dir}" destdir="${classes.dir}"/> </target> <target name="docs" depends="init"> <javadoc packagenames="com.sun.myproject.*" sourcepath="${src.dir}" destdir="${javadocs.dir}" doctitle="<h1>My Project Docs</h1>"> </javadoc> </target> <target name="jar" depends="compile, docs"> <jar jarfile="${dist.dir}/${jarfile.name}"> <fileset dir="${classes.dir}"/> <fileset dir="${docs.dir}"/> </jar> </target> <target name="clean" > <delete includeEmptyDirs="true" dir="${build.dir}"/> </target> </project> 4.8 Troubleshooting 4.8.1 Hardware and Software Dependencies To build the Ant source code and to use Ant itself, you must have a JAXPcompliant XML parser installed on your system and available in your Java classpath. Ant requires J2SDK, v. 1.1 or later, installed on your system. For more information, refer to the locally distributed Ant manual in the section “System Requirements” under the ”Installing Ant” section or the online version located at: http://jakarta.apache.org/ant Ant Sun Microsystems, Inc. 17 of 25 4.8.2 Configuration and Administration Issues Configuration is performed when the Java WSDP is installed. The user may need to set the environmental variable ANT_HOME to point to the location of the Ant distribution. 4.8.3 Ant Bugs Fixed in Version 1.4.1 For a list of bugs fixed, refer to the WHATSNEW file that is delivered with the Ant distribution. 4.9 Reference Information 4.9.1 Product Information ■ 4.9.2 Ant README file in the distribution. Technical Documentation ■ The Ant Manual online version http://jakarta.apache.org/ant/manual 4.9.3 Frequently Asked Questions ■ The Ant FAQ is distributed with Ant in the docs directory in the file faq.html. Ant Sun Microsystems, Inc. 18 of 25 5 Deploytool 5.1 Overview The Deploytool helps users package Web applications and deploy them onto a Tomcat server. It is a tool for deployment, not a technology used in creating applications. The version of the Deploytool that is included in the Java WSDP, v. 1.0_01, is the same as in version 1.0. Only minor bug fixes were made, and there is no change in the way the tool is used. The Deploytool Release Notes are located at: http://java.sun.com/webservices/docs/1.0/deploytool/ ReleaseNotes.html 5.2 Features, Advantages, and Benefits Features of the Deploytool include: ■ ■ ■ ■ ■ Packaging: Deploytool can be used to package Web application files into a Web Archive (WAR) file. Configuration: The user can use Deploytool to configure the Web application by using the New Web Component wizard in the tool to automatically generate the web.xml file. Verification: The user can use the Verifier in Deploytool to verify that the configuration is correct. Deployment: Tomcat can be used to deploy the Web application to the Tomcat Server. JAX-RPC Support: The user can package and configure Web applications consisting of JAX-RPC Endpoints as well as Servlets and JSP. Deploytool Sun Microsystems, Inc. 19 of 25 5.3 Features or Services Not Provided The Java WSDP Deploytool is similar to the one packaged with the J2EE Reference Implementation (RI), sharing the same code base. The J2EE version allows deployment in an application server while the Java WSDP version is specifically for deployment in Tomcat. It does not handle EJB but does handle Web applications, such as JSP. 5.4 Product Limitations Limitations listed in the Release Notes: ■ Deployment of WAR Files Written into the Tomcat webapps Directory: The user will not be able to use Deploytool to deploy a WAR file that was placed in the Tomcat webapps directory because Tomcat considers a WAR file placed in the webapps directory as deployed. If the user tries to use Deploytool to deploy it again, Tomcat will send an error back saying that the Web application already exists. ■ Servlet/ClassLoader Error: If a servlet depends on code in an external WAR, JAR, or .class file not included with the standard Deploytool WAR files, then the user must also bring these external objects into Deploytool in order to create the servlet component; otherwise, the Deploytool will display a “no class definition found” error. ■ Database Applications: The user must select the corresponding Resource Reference or Java Naming Directory Interface (JNDI) name created in Tomcat; otherwise, the database application will not be able to query the correct database. ■ JAX-RPC Endpoint Default Settings: If the user first includes servlets or JSP as Web components before inputting a JAX-RPC endpoint by using an Edit Web Application menu option, the user must then use the JAX-RPC Settings button in the inspector front panel to add the JAX-RPC Default Settings. ■ JAX-RPC Model File: If the user would like to include a JAX-RPC Model File in their JAX-RPC application, then this file must end with .xml.gz. ■ JAX-RPC Custom Settings: If Custom Settings is selected, the user should not return to the endpoint screen before pressing the Finish button and changing the endpoint name because this may cause the generated model file name in the XML viewer to be out of sync. ■ JAX-RPC Endpoint Alias: The JAX-RPC Endpoint Alias should begin with a forward slash; otherwise, Tomcat may throw a parser validation error when trying to run the application. Deploytool Sun Microsystems, Inc. 20 of 25 5.5 ■ Deploytool Temporary Directory: The user can specify a temporary directory that Deploytool uses for file processing. If the user does not specify this directory, Deploytool will create it. The user must not try accessing this directory while executing Deploytool commands or putting files or links to other directories in this directory because this directory is recursively cleaned by Deploytool. ■ Deleting WAR files: Do not delete a WAR file from a directory that Deploytool has open. Deploytool gives a warning message if this occurs. ■ The Update and Redeploy Function does not Work for JAX-RPC Applications: The workaround is to undeploy and then redeploy the JAXRPC application. Introduction to Deploytool No specialized knowledge is required for using the Deploytool except an understanding of Tomcat. The Tomcat tutorial is located at: http://java.sun.com/webservices/docs/1.0/tutorial/doc/ GettingStarted.html This tutorial covers deploying Web applications manually and with Deploytool. 5.6 Using and Supporting Deploytool 5.6.1 User's Guides and Tutorials The Deploytool is discussed in the Java WSDP tutorial located at: http://java.sun.com/webservices/docs/1.0/tutorial/ 5.6.2 Using Deploytool in a Development Environment The Deploytool is not used directly for developing applications, but is used after they have been written and compiled. At this stage, the Deploytool is used to package and deploy the application. For iterative development, the Deploytool can be used to quickly repackage and redeploy the application. The user creates, deploys, and tests a Web application. Then the code can be changed and recompiled outside of Deploytool. There is an Update and Redeploy button on the button bar and in the Tools menu. This Deploytool Sun Microsystems, Inc. 21 of 25 will repackage the source and deploy the application again. Users can quickly change, recompile, and test without having to package the Web application each time. 5.6.3 Localization and Internationalization All of the text in the tool is localized. The LocalStrings.property files are all contained under the <JWSDP_HOME>/tools/deploytool/locale directory. 5.7 Troubleshooting 5.7.1 Configuration and Administration Issues Configuration is performed when the Java WSDP is installed. The default Tomcat server for Deploytool is set at this time though, once the tool is running, the user can set a different server. There is no administration to deal with. 5.7.2 Deploytool Bugs A Deploytool bug should have the words deploytool or dt in the synopsis. 5.7.2.1 Bugs Fixed in Version 1.0_01 ■ When undeploying an application, the Deploytool used the Tomcat remove command instead of the undeploy command (bug number 4695497). ■ A GUI issue caused the tool to hang under certain circumstances (bug number 4696339). Deploytool Sun Microsystems, Inc. 22 of 25 5.8 Reference Information 5.8.1 Technical Documentation ■ Deploytool Release Notes http://java.sun.com/webservices/docs/1.0/deploytool/ ReleaseNotes.html 5.8.2 Tutorials and Other References ■ Java Tutorial on JWSDP http://java.sun.com/webservices/docs/1.0/tutorial/ Deploytool Sun Microsystems, Inc. 23 of 25 6 JAXM Provider Administration Tool 6.1 Overview JAXM ships with a Provider administration tool that can be used to configure a messaging provider. It is an ease-of-use tool with a user friendly UI. It provides a convenient way of changing JAXM provider configuration using a set of graphic screens instead of editing the configuration file provider.xml. Information about how to access and use the tool is located in the JAXM Tutorial of the Java WSDP at: http://java.sun.com/webservices/docs/1.0/tutorial/doc/ ProviderAdminTool.html 6.2 Using and Supporting the JAXM Provider Administration Tool If you are using the provider administration tool without using the Java WSDP, you must use the defaults for Tomcat: the login is tomcat and the password is tomcat. If you are using the Java WSDP, log in to the provider admintool using the user name and password combination defined when you installed the Java WSDP. This user name and password combination is assigned the roles of admin, manager, and provider by default. To use the provider admintool, you must log in with a user name and password combination that has been assigned the role of provider. This user name and password must match the user name and password in the build.properties file. JAXM Provider Administration Tool Sun Microsystems, Inc. 24 of 25 6.3 Localization and Internationalization The provider admintool is based on the struts framework. More information about struts can be obtained from: http://jakarta.apache.org/struts/resources/tutorials.html Struts uses properties files to store different languages of the application. The default language is in the ApplicationResources.properties file. For other languages, there has to be a ApplicationResources_xx.properties file, where xx is the ISO 639 language code. The admintool is internationalized but not localized. 6.4 Frequently Asked Questions One of the most frequently asked questions about the JAXM provider admintool is why the MissingResource exception is thrown when trying to run the admintool on J2EE. The solution is to add the provideradmin.util.LocalStrings.properties file in J2EE_CLASSPATH. 6.5 Reference Information More information is located in the jaxm-interest mailing list archives at: http://swjscmail1.java.sun.com/cgi-bin/ wa?A1=ind0206&L=jaxm-interest JAXM Provider Administration Tool Sun Microsystems, Inc. 25 of 25