Installation
These steps will quickly get JumpStart 7.0.n running and editable.
- Unzip the download.
- Unzip the downloaded file, which will give you a directory called tapestry-jumpstart-7.0.n or similar.
- Move it to your development area, eg. /devel/tapestry-jumpstart-7.0.n/ .
- DO NOT choose a directory whose path contains any spaces, eg. do not use a directory whose path includes C:/Documents and Settings/.
- Open it in Eclipse.
- Eclipse 4.6 ("Neon") or 4.5 ("Mars") is preferred. The Eclipse IDE for Java EE Developers package is good (JumpStart is developed with it).
- In Eclipse, choose File > Import..., then choose General > Existing Projects into Workspace, click Next >, set the root directory to your tapestry-jumpstart directory eg. /devel/tapestry-jumpstart-7.0.n/, click Finish.
- The project can't build just yet so it will show errors.
- Ensure the project is using Java 8.
- In Eclipse, right-click on the project and choose Properties then Java Compiler and ensure Compiler compliance level is 1.8. You may have to turn on Enable project specific settings.
- Run get-dependent-files.
The project has an Ant build file, build.xml, with a get-dependent-files target. To run it in Eclipse:- Open the Ant view and drag build.xml onto it.
- If your internet connection is through a proxy then
modify the setproxy tag in build.xml, eg.
-
<setproxy proxyhost="proxy.mycompany.com"
proxyport="8080"></setproxy>
- Run the get-dependent-files target in the project's build.xml file (find the target in the Ant view and double-click on it). If Ant has problems due to the maven repository being slow or inaccessible, open the project's build.properties and choose a different maven.repo.root, then try running the target again.
- The new files won't be visible in the project just yet.
- Refresh the project.
- In Eclipse, right-click on the project and choose Refresh. This should build the project successfully and show no errors.
- It also runs collapser.xml, which builds the collapsed/ directory containing a WAR in "collapsed EAR" format. You can see how has this been configured by displaying the project's properties and choosing Builders.
- You can see now that the previous step, Run get-dependent-files, populated the following directories with JARS:
business/src/main/lib-compile/ business/src/main/lib-provided/ business/src/main/lib-runtime/ business/src/test/lib-test/ business/src/test/lib-test-hibernate/ tools/lib/ web/src/main/lib-compile/ web/src/main/lib-provided/ web/src/main/lib-runtime/ web/src/test/lib-test/
- Set the collapsed directory to derived.
- In Eclipse, right-click on the collapsed directory, choose Properties, and tick the derived checkbox. Then click OK.
- Get OpenEJB.
OpenEJB will be your embedded EJB container during development.- Go to Apache TomEE Downloads and download OpenEJB Standalone 7.0.4.
- Once downloaded, unzip it. Move it to a suitable location (eg. /devel/apache-openejb-7.0.4).
- In Eclipse, choose Window > Preferences > Java > Build Path > User Libraries (or in OS X, choose Eclipse > Preferences... > Java > Build Path > User Libraries), and
- Click New... and create a new user library called apache-openejb-7.0.4-lib, then
- Click Add External Jars... and add every JAR in OpenEJB's lib/ directory to the new user library.
- Configure OpenEJB.
- In the project, find /business/src/test/conf and copy file openejb-in-memory.xml.template to openejb-in-memory.xml.
- Open openejb-in-memory.xml, and correct the Deployments dir path if it's wrong.
Web Server | Business Server | Persistence | Database Server | Logger |
---|---|---|---|---|
Jetty | OpenEJB | Hibernate | HSQLDB | Log4j |
(As jars in project) | (As a user library) | (As jars in project) | (Within OpenEJB) | (As jars in project) |
Here's how to use it:
- Start JumpStart. In Eclipse...
- Choose Run > Run Configurations.... The Run Configurations window will appear.
- Right-click on Java Application and choose New.
- Set the variables to values similar to those shown in the screen shot.
- Click on the Arguments tab.
- Set the VM arguments to the following, replacing the value of jetty.home and openejb.home with yours, eg.:
-Djumpstart.ejb-provider=OPENEJB_7_LOCAL
-Djumpstart.jetty.use.ajp=false
-Djumpstart.upload-path=/tmp
-Dlog4j.configurationFile=log4j.properties
-Dtapestry.hmac-passphrase=qwerty
-Dtapestry.production-mode=false
-Dtapestry.compress-whitespace=false
-Dupload.filesize-max=8000000
-Dopenejb.configuration=business/src/test/conf/openejb-persist.xml
-Dopenejb.home=/devel/apache-openejb-7.0.4
-Dorg.apache.openejb.assembler.classic.WebAppBuilder=jumpstart.web.NoWebAppBuilder
-Dhibernate.hbm2ddl.auto=update
-Duser.timezone=UTC
-Xmx192m
-XX:MaxMetaspaceSize=96m
-XX:+UseCodeCacheFlushing - The above arguments are explained here: tapestry, uploading files, openejb, hibernate, JVM. Choose an existing directory for jumpstart.upload-path.
- Click on the Classpath tab.
- If there is a
(default classpath)
entry, Remove it. - Click on User Entries. Ensure the following is in the classpath, in exactly this order:
-
- These 2 folders (Advanced... > Add Folders):
web/src/test/conf
collapsed/jumpstart.war/WEB-INF/classes/
- Every JAR from these folders (Add JARs...):
collapsed/jumpstart.war/WEB-INF/lib/
web/src/test/lib-test/
business/src/test/lib-test-hibernate/
- This user library (Advanced... > Add Library > User Library):
apache-openejb-7.0.4-lib
- These 2 folders (Advanced... > Add Folders):
- Ensure the two folders are at the top. It avoids conflicts.
- Click Run.
- If error, especially
ClassNotFoundException
fororg.slf4j.Logger
ororg.slf4j.impl.StaticLoggerBinder
, check the Arguments and classpath match those shown above. - Check JumpStart is running by pointing your web browser at http://localhost:8080/jumpstart.
- Populate the database. Populate the HyperSQL DataBase (HSQLDB) within OpenEJB:
- In Eclipse, terminate JumpStart (in the Console view click the red box).
- Open the data_util.properties file and modify the property database.url.
Use a relative path to your OpenEJB installation, eg. jdbc:hsqldb:file:/devel/apache-openejb-7.0.4/data/hsqldb/${database.name} . - Drag the data_util.xml file to the Ant view and run its target repopulate-database-prompted.
It will prompt you to confirm.
If you get the error "*** The HSQLDB files appear to be in use", and you are sure you terminated JumpStart, manually delete the hsqldb.lck file identified in the error message.
If you get the error "Cannot load 32-bit SWT libraries on 64-bit JVM" in OS X, then right-click on the same target and choose Run As > Ant Build... > JRE and add VM argument-d32
, and click Run. The cause is explained here.
- Start JumpStart again.
- Check JumpStart is running by pointing your web browser at http://localhost:8080/jumpstart.
- Confirm you can log in by clicking on the Protected Pages link, View admin user, then log in as admin with password admin.
There are another 2 users: secofr and john, with passwords secofr and john, respectively. - Try making a mod! As another quick test...
- Return to the home page, http://localhost:8080/jumpstart.
- In Eclipse, locate the template of the home page -
web/src/main/java/jumpstart.web.pages.Index.tml
- and modify it a little.
If you change the template or java of a page you'll see the change just a moment later in your running application.
Visit Orientation, Debugging, Tips, and Troubleshooting for more info.