Building the Examples - The Java EE 5 Tutorial (original) (raw)
2. Using the Tutorial Examples
Java Platform, Standard Edition
Sun Java System Application Server 9.1
Application Server Installation Tips
Starting and Stopping the Application Server
Starting and Stopping the Java DB Database Server
Tutorial Example Directory Structure
Debugging Java EE Applications
3. Getting Started with Web Applications
5. JavaServer Pages Technology
7. JavaServer Pages Standard Tag Library
10. JavaServer Faces Technology
11. Using JavaServer Faces Technology in JSP Pages
12. Developing with JavaServer Faces Technology
13. Creating Custom UI Components
14. Configuring JavaServer Faces Applications
15. Internationalizing and Localizing Web Applications
16. Building Web Services with JAX-WS
17. Binding between XML Schema and Java Classes
19. SOAP with Attachments API for Java
21. Getting Started with Enterprise Beans
23. A Message-Driven Bean Example
24. Introduction to the Java Persistence API
25. Persistence in the Web Tier
26. Persistence in the EJB Tier
27. The Java Persistence Query Language
28. Introduction to Security in the Java EE Platform
29. Securing Java EE Applications
31. The Java Message Service API
32. Java EE Examples Using the JMS API
36. The Coffee Break Application
37. The Duke's Bank Application
Building the Examples
The tutorial examples are distributed with a configuration file for either NetBeans IDE or Ant. Directions for building the examples are provided in each chapter. Either NetBeans IDE or Ant may be used to build, package, deploy, and run the examples.
Building the Examples Using NetBeans IDE
To run the tutorial examples in NetBeans IDE, you must register your Application Server installation as a NetBeans Server Instance. Follow these instructions to register the Application Server in NetBeans IDE.
- Select Tools→Server Manager to open the Server Manager dialog.
- Click Add Server.
- Under Server, select Sun Java System Application Server and click Next.
- Under Platform Location, enter the location of your Application Server installation.
- Select Register Local Default Domain and click Next.
- Under Admin Username and Admin Password, enter the admin name and password created when you installed the Application Server.
- Click Finish.
Building the Examples on the Command-Line Using Ant
Build properties common to all the examples are specified in the build.propertiesfile in the tut-install/javaeetutorial5/examples/bp-project/ directory. You must create this file before you can run the examples. Copy the file build.properties.sample to build.properties and edit it to reflect your environment. The tutorial examples use the Java BluePrints build system and application layout structure.
To run the Ant scripts, you must set common build properties in the file tut-install/javaeetutorial5/examples/bp-project/build.properties as follows:
- Set the javaee.home property to the location of your Application Server installation. The build process uses the javaee.home property to include the libraries in as-install/lib/ in the classpath. All examples that run on the Application Server include the Java EE library archive, as-install/lib/javaee.jar. in the build classpath. Some examples use additional libraries in as-install/lib/; the required libraries are enumerated in the individual technology chapters.
Note - On Windows, you must escape any backslashes in the javaee.home property with another backslash or use forward slashes as a path separator. So, if your Application Server installation is C:\Sun\AppServer, you must set javaee.home to javaee.home = C:\\Sun\\AppServer or javaee.home=C:/Sun/AppServer.
- Set the javaee.tutorial.home property to the location of your tutorial. This property is used for Ant deployment and undeployment.
For example, on UNIX:
javaee.tutorial.home=/home/username/javaeetutorial5
On Windows:
javaee.tutorial.home=C:/javaeetutorial5
Do not install the tutorial to a location with spaces in the path. - If you did not accept the default values for the admin user and password, set the admin.user property to the value you specified when you installed the Application Server, and set the admin user’s password in the admin-password.txt file in the tut-install/javaeetutorial5/examples/common/ directory to the value you specified when you installed the Application Server.
- If you did not use port 8080, set the domain.resources.port property to the value specified when you installed the Application Server.
Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices