This document describes the setup of Expresso with JBuilder 9.
Version: |
Expresso 5.5 |
Maintainer: |
The goal of this article is to get a developer that is new to JBuilder 9 up and running with the Expresso framework. Prior knowledge of JBuilder 9 is not necessary.
To follow along in this article, you should have the following items:
JBuilder 9 This article was written using JBuilder 9. The concepts of this article should also work for JBuilder previous version users with minor adjustments.
Expresso 5.0.5 Complete This is the version that the article was written against because it provides nearly all the needed jar files as well as a pre-created database and the Tomcat server. With effort, you can use Expresso binary and Expresso src distributions together if you do not wish to download the Complete bundle, but it is not recommended.
BouncyCastle Cryptography Provider �Despite its weird name, BouncyCastle is, in the author's opinion, one of the most advanced JCE (Java Cryptography Extensions) providers available to the open source community. There are a few classes in Expresso that rely on this library, and it is highly recommended that you retrieve the latest version from The BouncyCastle web site Most likely the file you will want to get is jce-jdk13-116.jar, so if you are in doubt, the author has successfully used this particular JAR for both JDK 1.3 and JDK 1.4.
Once you have obtained the BouncyCastle provider, you can 'install' it by copying it into the ${EXPRESSO_INSTALL_DIR}/webapps/ROOT/WEB-INF/lib directory.
Probably at this point you are wondering why you have to do this. Well it just so happens that the United States government has certain restrictions for cryptography export. Although the rules have certainly been relaxed from previous years, there is still the provision in the law that strong cryptography cannot be knowingly exported to the State Department's "seven terrorist nations." That means that the distributors of Expresso would have to incorporate I.P. checkers and other basic provisions to prevent them from knowingly export to these blacklisted nations. It is the Expresso development team's goal to have this functionality operational soon. But until that time, the BouncyCastle will have to be separately downloaded. [In this case, it comes from Australia which has no such cryptography export laws.
JDK 1.4.1 This is already including in JBuilder 9.
Ideally, you should have both JBuilder and Expresso installed on your system and running independent of each other. If you are unable to launch the Tomcat server that comes with the Expresso distribution, it will be unlikely that you will be successful following these instructions.
Before we begin, we need to briefly discuss notation used throughout the rest of the article. Most of the directories mentioned in this tutorial are relative to the root directory where you unzipped the Expresso-complete installation. We will denote this root directory as ${EXPRESSO_INSTALL_DIR}. So for clarification, let's say, for example, that you've unzipped Expresso into the C:/expresso directory. If you see the notation ${EXPRESSO_INSTALL_DIR}/webapps/ROOT/WEB-INF/lib, then given the base directory, the full path would be: /C:/expresso/webapps/ROOT/WEB-INF/lib
So let's get started! Launch JBuilder. If you do not get prompted with the new project dialog, go to File -> New->Project->Project for Existing Code.

For the project name, enter "Expresso". Click on the ellipsis (�) to select the ROOT directory for Expresso.

There is a screenshot included below that shows what the dialog might look like when everything is entered. Now click Next.

Now we are in Step 2. If you have no special requirement, just use the default path settings. You will have to add some extra library into the required libraries, as the screenshot below:

Still remember BouncyCastle? Yes, all we want is this library. Retrieve this library from the website, and add it into our library.

OK! After finish this step, we can go to step 3.

Enter settings here to help define your project. After finish this step, you have finished the whole process.
Ok, it is time to put our procedure to the test! From the IDE menu select Project -> Make Project. For the first time to build, you cannot use Rebuild directly, or JBuilder 9 will remove both the ${EXPRESSO_INSTALL_DIR}/webapps/ROOT/WEB-INF/classes and ${EXPRESSO_INSTALL_DIR}/webapps/ROOT/WEB-INF/lib directory, and then report error. But if you choose �Make� rather than �Rebuild� first, then everything is OK. If you happened to drop in such trap, just unzip and copy the classes and lib directory from your Expresso-Complete package again. If everything is OK, you should see the JBuilder 9 compile 594 files with 79 warnings, as the screenshot below.

Although you will see several "Deprecation Warnings", there should be no actual compilation errors. You can turn off the �Show deprecations� switch. From the IDE menu select Project->Project Properties->Build->Java, as the screenshot below:

Just uncheck the �Show deprecations� option.
If there are errors, you need to double-check your setup procedure. If you cannot find your error, you are encouraged to post to the JCorporate forums or OpenSource mailing list for assistance.
For the default setting, JBuilder 9 will turn on the WAR building switch. That means every time you build your project, the WAR file will be built too. And it is rather time consuming. You can turn it off, right click the web application icon of expresso on the Project view, and select �properties� on the bottom of the popup window, as the screenshot below.

Set the Build option as �Never�. And within this window, you can also check the �Include regular content in WEB-INF and subdirectories� option, as the screenshot below.

Since a filed named �expresso-config_4_0.dtd� is located in ${EXPRESSO_INSTALL_DIR}/webapps/ROOT/WEB-INF/classes/com/jcorporate/expresso/core, and JBuilder 9 will remove the whole classes directory every time you rebuild your project. And this file is required while Expresso is running, so you have to ensure that it exists in your classes directory after you rebuild your project. You can change JBuilder 9 setting to ensure this, select from the main menu: Project->Project properties->Build->Resource, �Copy� the dtd file. See the screenshot below.

So far we set the name of the web application as �Expresso�. That is to say, you must point your browser to http://localhost:8080/expresso/expresso/frame.jsp to visit the Expresso welcome page. If you think it�s not so convenient and just want to visit http://localhost:8080/ instead, you must change the ROOT context. Just like you change the WAR building option, call the properties window, and set the WebApp�s name as blank. JBuilder will automatically look the WebApp without a name as the �Default WebApp�
Since JBuilder 9 has included various Tomcat versions (3.3, 4.0, 4.1) inside as the third party web application server, you can run and debug with Tomcat very convenient. To setup your Tomcat, just select from the menu: Project->Project properties->Run->New, or you can do this on your first run. After you finish your setup, you may see the below screenshot.

If everything has gone well, you should be able to point your browser to http://localhost:8080/ and you will see the Expresso welcome page. If you have problems, feel free to post to the Expresso forums or the Opensource mailing list any questions. Be sure to mention that you are trying to get Expresso running within JBuilder and post the full error message. From here, it is recommended that you read the Expresso Developer's Guide to get a feel for the full capabilities of the framework.
Tell JBuilder not to build the .war file until you set it up properly! Set it up to EXCLUDE Tomcat as part of the .war file.