Hi Ross,
Thanks for your response with details. The following are the main files:-
1. File - GettingStarted.txt
- Assume you've downloaded the examples and unzipped them to <EXAMPLES_HOME>.
- download a copy of glassfish from
https://glassfish.dev.java.net/public/downloadsindex.html
- copy the downloaded .jar file to <EXAMPLES_HOME>
- edit <EXAMPLES_HOME>/config/setenv.bat to point to your JDK 5.0 directory. The JDK is available for download at
http://java.sun.com/j2se/1.5.0/download.jsp
- edit <EXAMPLES_HOME>/config/common.properties and set the EXAMPLES_HOME variable (location where you unzipped the examples jar). NOTE: make sure you use '/' and NOT '\'
- run <EXAMPLES_HOME>/bin/installserver.bat to install glassfish. Read and accept the licensing agreement that pops up.
- you can now run the examples. Double-click <EXAMPLES_HOME>/examples/examples.html to get started
2 File - common.properties
# EXAMPLES_HOME=d:/book/examples
EXAMPLES_HOME=C:/EXAMPLES_HOME/examples
##################################################
# properties for the Glassfish application server
##################################################
SERVER_HOME=${EXAMPLES_HOME}/glassfish
ADMIN_USER=admin
PASSWORD_FILE="${EXAMPLES_HOME}/config/password.txt"
##################################################
# properties for the Derby Database
##################################################
DERBY_INSTALL=${SERVER_HOME}/javadb
DERBY_PORT=1527
DERBY_HOST=localhost
DERBY_USER=APP
DERBY_PWD=APP
DERBY_SYSTEM_HOME=${EXAMPLES_HOME}/database
DERBY_CLASSPATH=${DERBY_INSTALL}/lib/derby.jar;${DERBY_INSTALL}/lib/derbynet.jar;${DERBY_INSTALL}/lib/derbyclient.jar;${DERBY_INSTALL}/lib/derbytools.jar
ESSENTIALS_CLASSPATH=${SERVER_HOME}/lib/toplink-essentials.jar
SPRING_CLASSPATH=${EXAMPLES_HOME}/lib/spring.jar;${EXAMPLES_HOME}/lib/commons-logging.jar
J2EE_CLASSPATH=${SERVER_HOME}/lib/javaee.jar
CLIENT_CLASSPATH="${ESSENTIALS_CLASSPATH};${J2EE_CLASSPATH};${DERBY_CLASSPATH}
3 File - examples.html
<html>
<head><title>Pro EJB 3: Java Persistence API Examples</title></head>
<body>
<h1>Pro EJB 3: Java Persistence API Examples</h1>
<h3>Java SE Examples</h3>
The SE examples (Chapter 2) do not require a running server. Simply go to the chapter's
example folder and run the batch file for the example.
<h3>Java EE Examples</h3>
The other examples require a running application server. Go to the 'bin' folder and start
the Glassfish application server using the batch file (startserver.bat). Once started, go
to the desired chapter's example folder and build/deploy the application using the deploy.bat
batch file. Once that is done, come back to this page and click on the link of the desired
example. This will provide you with a web client to run the example.
- Chapter 2: Getting Started
- These examples demonstate the Java Persistence API in an SE environment. To run,
go to the Chapter2 folder and run the batch file for the example. It provides both
a simple interactive client to create/list/remove employees and a basic test like
the one found in the chapter.
Currently, I am running examples from EJB 3 in action book, they are working fine using JBoss 4.2.2 using ant scripts upto chapters 12. These examples are from Pro EJB3 Java Persistence API.
Thanks again for your input,
Naveen Katoch