This README.txt file gives an overview of the contents of the examples directories. Each subdirectory also has a README.txt file, which you should print out for specific instructions on deploying and running the example in that subdirectory. **** Important Update **** Updated: Mon Apr 28 10:42:52 PST 2003 All EJB code is now in packages. Newer versions of Tomcat (4.1 and newer) require that all JSP programs reference classes contained in packages. Therefore, the sources will differ from those in the text book. For example, JSP sources will now contain an import directive that references the required package, as follows: <%@ page import="asg.LoanEJB.*, ... %> and each source file for the enterprise javabeans will start with the appropriate package declaration, as follows: // Loan.java package asg.LoanEJB; . . . This modifies the structure of the jar files found in each enterprise application (the .EAR file). The EJB class files are now placed in the appropriate directory hierarchy that matches the package name. Therefore, the .class files for the Loan EJB are packaged in a .jar file as follows: asg/LoanEJB/Loan.class asg/LoanEJB/LoanHome.class ... etc ... *** General Tips *** Make sure that you set environment variable CPATH to include the current directory (.) and /lib/j2ee.jar. For example, if using the j2ee.jar file under j2ee1.3.1, CPATH is: .;d:\j2sdkee1.3.1\lib\j2ee.jar In our experience, if you want to make changes to deployed EJBs, then you must restart the server for these changes to take effect. Also, if you seem to see unexplained deployment errors, before pulling out your hair, restart the j2ee server (and use cleanup). Also, restart the cloudscape database. Here is the general procedure: 1. Edit the .java source code file. 2. Recompile using the provided .sh command file script. 3. In the deployment tool, select Tools->Update files. The new .class should be loaded into the enterprise application. 4. Save the changes. In the deployment tool, select File->Save. 5. Exit the deployment tool. 6. Stop the server. j2ee -stop 7. Cleanup the application server files. cleanup 8. Restart the server. j2ee -verbose & 9. Restart the deployment tool. deploytool & 10. Deploy the application. In the deployment tool, select Tools->Deploy... If you suspect that the Cloudscape database server is also confused, it is a good idea to shut that down and restart that. In this case, use the following order. 1. Exit the deployment tool. 2. Stop the server. j2ee -stop 3. Stop the cloudscape database server. cloudscape -stop 4. Cleanup the application server files. cleanup 5. Restart the server. j2ee -verbose & 6. Restart the database server. cloudscape -start & *********************************** Chapter 3 - TOPICS Stateless Session Beans Application Exceptions Value Object Pattern Stand-alone Java client JSP Web component client EXAMPLE COMPONENTS Loan EJB LoanObjectException LoanVO AmortClient paymentGet.jsp paymentPost.jsp SOURCE DIRECTORIES examples/loanSession examples/loanSession/asg/LoanEJB .EAR FILE: LoanApp.ear _____________________________________________ Chapter 4 - TOPICS Session Beans with JDBC Application Exceptions Stand-alone Java client using Swing JSP Web component client EXAMPLE COMPONENTS Music EJB NoTrackListException RecordingVO TrackVO MusicApp.java musicGet.jsp musicPost.jsp error.jsp SOURCE DIRECTORY examples/musicSession .EAR FILE: MusicApp.ear Cloudscape Database Initialization: cloudscape -isql < createTable.sql _____________________________________________ Chapter 4 - TOPICS (continued) DAO Pattern Factory Pattern System Exceptions EXAMPLE COMPONENTS Music EJB with DAO MusicDAOFactory SOURCE DIRECTORY examples/musicDAO .EAR FILE: MusicDAOApp.ear _____________________________________________ Chapter 5 - TOPICS Stateful Session Beans Value List Iterator Pattern Extending multiple interfaces Stateful vs Stateless EXAMPLE COMPONENTS MusicCart EJB CustomerVO MusicIterator EJB MusicPage EJB (remote interface) login.jsp loginPost.jsp musicCart.jsp shoppingPost.jsp error.jsp SOURCE DIRECTORY examples/musicVL .EAR FILE: MusicVL.ear _____________________________________________ Chapter 5 - TOPICS (continued) Local Interfaces Local vs Remote EXAMPLE COMPONENTS MusicIterator EJB MusicPage EJB (local interface) SOURCE DIRECTORY examples/musicLocal .EAR FILE: MusicLocal.ear _____________________________________________ Chapter 6 - TOPICS Entity Beans with Bean-Managed Persistence Finder Methods Home Methods Transactions Local Objects Session Facade Pattern EXAMPLE COMPONENTS Customer EJB CustomerDAO CustomerTestClient CustomerSession EJB signUp.jsp signUpPost.jsp loginPost.jsp SOURCE DIRECTORY examples/customerDAO .EAR FILE: CustomerApp.ear _____________________________________________ Chapter 7 - TOPICS Entity Beans with Container-Managed Persistence Relationship Fields EJB Query Language Finder/Select Methods CMP vs BMP Session Facade Pattern (expanded) EXAMPLE COMPONENTS Customer EJB Order EJB LineItem EJB CustomerSession EJB processOrder.jsp submitOrder.jsp AdminClient.java SOURCE DIRECTORY examples/ordersCMP .EAR FILE: OrderCMPApp.ear _____________________________________________ Chapter 8 - TOPICS Introducing JMS EXAMPLE COMPONENTS PingServerApp - JMS application client SOURCE DIRECTORY examples/Ping .EAR FILE: PingServerApp.ear _____________________________________________ Chapter 8 - TOPICS (continued) Message-Driven Beans - Student Message-Driven Bean EXAMPLE COMPONENTS Student MDB SchoolApp Client SOURCE DIRECTORY examples/School .EAR FILE: SchoolApp.ear _____________________________________________ Chapter 8 - TOPICS (continued) Message-Driven Beans EXAMPLE COMPONENTS ShipOrder MDB OrderApp Client AdminClient Client SOURCE DIRECTORY examples/ShipOrder .EAR FILE: OrderCMPApp.ear _____________________________________________