Purpose
This article covers setting up the following Open Source tools for J2EE 1.3 development.
- Tomcat 4.x for Servlet 2.3 and JSP 1.2
- JBoss 3.x for EJB 2.0, JMS 1.1, JCA 1.0, and JAXP 1.1
- MySQL 3.x for RDBMS Persistence
- Eclipse for Java IDE
* Following the order herein is recommended.
Coming Soon...
This documentation will get diligent update, catching up with latest builds of the tools. So please come back for updates.
- ANT integration with Eclipse.
- Code examples.
- XDoclet integration into Eclipse for EJB development.
Revision History
- 4/18, added "Upgrade" entry for each section.
JBoss 3.0.0, Release Candidate 1. Eclipse Milestone 5 (build 20020416).
Sysdeo version 0.96 and Genuitec version 1.0EA4 (for Eclipse M5).
- 4/02, (minor) Tomcat, version 4.0.4 beta 2. Sysdeo plugin, version 095.
- 3/23, (minor) Eclipse, updated with build 20020321.
- 3/20, JBoss 3.0.0, added Beta2 self-build notes
- 3/15, (minor) Eclipse, build 20020214 notes for working with EJB.
- 3/15, MySQL added, and its integration with JBoss.
- 3/13, (minor) JBoss, disabling clustering.
- 3/11, J2EE 1.3 with Eclipse (JBoss added).
- 2/20, JSP/Servlet with Eclipse and Tomcat.
Quick Reference
Software | Current Version | Vendor | J2EE | Installation |
1.4.0 | J2SE 1.4 | Install | ||
(Open Source) | 4.0.4 Beta 2 | J2EE 1.3 | Unzip | |
(Oepn Source) | 3.0.0 Release Candidate 1 | J2EE 1.3 | Unzip | |
(Open Source) | 3.23.49 | RDBMS | Install | |
(Open Source) | 2.0, pre-release build 20020321 | Java IDE | Unzip | |
0.96 | (France) | IDE Plugin | Unzip | |
1.0EA4 | IDE Plugin | Unzip |
Installing JDK
Version | 1.4.0 |
Download | Get binary j2sdk-1_4_0-win.exe at http://java.sun.com/j2se/1.4/download.html |
Documentation | - Online - http://java.sun.com/j2se/1.4/docs/index.html - Downloadable - http://java.sun.com/j2se/1.4/download.html |
Install | Run the executable which will install the following:
|
Environment | Set variable JAVA_HOME to <install dir> (e.g. C:/jdk1.4). Make sure <install dir>/bin is in your PATH (e.g. C:/jdk1.4/bin). |
Test | Open a DOS windows, try java -version and you should get: java version "1.4.0" |
Installing Tomcat
Version | 4.0.4 Beta 2 |
Download | Get zip binary at http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4-b2/bin/jakarta-tomcat-4.0.4-b2-01.zip |
Documentation | - Online - http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html - Local - (after installation) at %TOMCAT_HOME%/webapps/tomcat-docs/index.html (Also accessible at http://localhost:8080/tomcat-docs/index.html, if Tomcat is started on port 8080) |
Upgrade from Previous Version | - Rename your previous installation (say C:/jakarta-tomcat-4.0.2 to C:/jakarta-tomcat-4.0.2_old). And remove it after you get the new version up for a while. |
Install | Unzip to destination (say C:/, which makes <install dir> to be C:/jakarta-tomcat-4.0.4-b2-01). |
Environment | Set variable TOMCAT_HOME to <install dir> (e.g. C:/jakarta-tomcat-4.0.4-b2-01). |
Test | "cd %TOMCAT_HOME%/bin" and "startup" (startup.bat), you should see --- Starting service Tomcat-Standalone Now that Tomcat is up, access http://localhost:8080 from your browser. |
Other | o Installing Sysdeo Eclipse Tomcat Launcher Plugin (refer to the later section) o Integrating Tomcat with JBoss (refer to the later section) |
Installing JBoss
Version | 3.0.0 Release Candidate 1 (soon will add a seperate section on building 3.1.0 Alpha by yourself) |
Download | Get zip binary from SourceForge at http://prdownloads.sourceforge.net/jboss/jboss-3.0.0RC1.zip (General download at http://sourceforge.net/project/showfiles.php?group_id=22866.) * Also available is a Tomcat-integrated version at http://prdownloads.sourceforge.net/jboss/jboss-3.0.0RC1_tomcat-4.0.3.zip. We prefer having seperated Tomcat instead of the integrated version, especially for development, for the following reasons:
|
Documentation | - Free online manual (somewhat outdated): http://www.jboss.org/online-manual/HTML/index.html - JBoss documentation site: http://www.jboss.org/doco.jsp. |
Upgrade from Previous Version | - Rename your previous installation (say C:/jboss-3.0.0beta2 to C:/jboss-3.0.0beta2_old). And remove it after you get the new version up for a while. |
Install | Unzip to destination (say C:/, which makes <install dir> to be C:/jboss-3.0.0RC1). |
Environment | Set variable JBOSS_DIST to <install dir> (e.g. C:/jboss-3.0.0RC1). |
Test | Make sure you don't have TOMCAT running, as it would conflict with JBoss over port 8080. (Integration is covered in a later section.) "cd %JBOSS_DIST%/bin" and "run" (run.bat), you should see console output and eventually --- 14:44:35,075 INFO [Server] JBoss (MX MicroKernel) [3.0.0RC1 Date:200204150356] Started in 0m:22s:383ms Check console or logfile (%JBOSS_DIST%/server/default/log/server.log), you should only see "INFO", "WARN" or "DEBUG" outputs. |
Other | o Disable clustering: If you might ever run JBoss on your machine without a network, you want to do this. - Create a subfolder %JBOSS_DIST/server/default/deployBackup. - Move file %JBOSS_DIST%/server/default/deploy/cluster-service.xml away into %JBOSS_DIST%/server/default/deployBackup. Installing Genuitec Eclipse JBoss Plugin (see below) Integrating Tomcat with JBoss (see below) Integrating JBoss with MySQL (see below) |
Version | 3.1.0 Alpha, self-build (or see a previous section for downloading 3.0.0 RC1) Coming soon... |
Installing MySQL
Version | 3.23.49 |
Download | Get zip binary at http://mirror.sit.wisc.edu/mysql/Downloads/MySQL-3.23/mysql-3.23.49-win.zip (General download at http://www.mysql.com/downloads/mysql.html.) * 4.0 is still in Alpha as of 3/14/2002, so 3.23 is recommended for the time being. |
Documentation | - Local: (after installation) <install dir>/Docs/manual_toc.html - Online documentation: http://www.mysql.com/documentation/index.html |
Upgrade from Previous Version | Coming soon... |
Install | - Unzip to a temp dir (e.g., C:/Temp/mysql_install) |
Environment | Add <install dir> to PATH (e.g. C:/mysql3.23). |
Setup (Also to enable InnoDB) | - Run winmysqladmin.exe (under bin subfolder): 1. First time (when my.ini does not exist under Windows directory, e.g. C:/WinNT), you will be prompted for username/password. Enter your choice (e.g. mysqladmin/mysqladmin). 2. Its window will come up and then minimize into System Tray. Bring it up by: Right click on System Tray icon -> Option "Show me". 3. By default, "mysqld" is used which has only ISAM, which does NOT support transaction. To use "mysqld-max" with InnoDB or BDB enabled (supporting transactions), configure my.ini as following: Select tab "my.ini Setup" -> Select "mysqld-max" -> In editor for my.ini: [mysqld] innodb_data_home_dir = C:/mysql3.23/ibdata Then click "Save Modification" to save the changes into my.ini (under e.g. C:/WinNT). 4. Manually create the folder <ibdata location> and <iblogs location> (in the above example, it's C:/mysql3.23/ibdata and C:/mysql3.23/iblogs). 5. Start the server ("mysql" service): Right click on the window -> Option "Win NT" -> item "Install the service" Then Right click again -> Option "Win NT" -> item "Start the service". It will take a moment to create the database files and log files as configured. |
Test | 1. Make sure service "Mysql" is started. CREATE TABLE table1 (id INTEGER NOT NULL, data VARCHAR(100),PRIMARY KEY (id)) type=InnoDB; * The default CREATE TABLE creates table as type ISAM, which does not support transaction. Include clause "type=InnoDB" in your CREATE TABLE statement as the above, then your table will have transaction support. * By default, AUTOCOMMIT is on. To turn it off, do "SET AUTOCOMMIT=0;". |
Other | Integrating JBoss with MySQL (see below) |
Installing Eclipse
Version | 2.0, Milestone 5 (pre-release, build 20020416). |
Download | Get zip binary at http://64.38.198.171/downloads/drops/S-M5-200204161340/download.php?dropFile=eclipse-SDK-20020416-win32.zip |
Documentation | - Eclipse FAQ: http://www.eclipse.org/eclipse/faq/eclipse-faq.html - Documentation site: http://www.eclipse.org/eclipse/index.html (Currently only 1.0 docs) - Searching News/Mailing archive: http://www.eclipse.org/search/search.cgi |
Upgrade from Previous Version | - Rename your previous installation (say C:/eclipse to C:/eclipse_old). And remove it after you get the new version up for a while. |
Install | Unzip to destination (say C:/, which makes <install dir> to be C:/eclipse). |
Test | - You should have a JDK installed (if you use Sun JDK, 1.4.0 is recommended for hot code replacement support). - Start Eclipse and it would detect the JDK (through %JAVA_HOME%) - You can also manually specify VM (option -vm <javaw.exe location>) - Specify workspace location if don't want the default (option -data <workspace location) - Recommended settings on Perspective: Menu "Workbench" -> Item "Preferences" -> Option Workbench -> "Open a new perspective" -> Select "In the same window" -> uncheck "Reuse Perspective with same input" |
Other | Tomcat Plugin for Eclipse (see below) JBoss Plugin for Eclipse (see below) |
Installing Sysdeo Eclipse Tomcat Launcher Plugin
Version | 0.96 |
Download | Get binary tomcatPluginV096.zip at http://www.sysdeo.com/eclipse/tomcatPluginV096.zip |
Documentation | Online instruction: http://www.sysdeo.com/eclipse/tomcatPlugin.html |
Upgrade from Previous Version | - If you did NOT just install a new version of Eclipse, remove the old plugin directory (for example, C:/eclipse/plugins/com.sysdeo.eclipse.tomcat/) |
Install | Unzip to <Eclipse install dir>/plugins (the plugin will reside under <Eclipse install dir>/plugins/com.sysdeo.eclipse.tomcat). |
Configure Eclipse |
For your Eclipse project, .classpath needs this to compile Servlets: <classpathentry kind="var" path="TOMCAT_HOME/lib/jasper-runtime.jar"/> |
Installing Genuitec Eclipse JBoss Plugin
Version | 1.0EA4 |
Download | Get zip binary http://www.genuitec.com/products/EASIEJBoss1.0ea4.zip |
Documentation | Online instruction (PDF): http://www.genuitec.com/products/Eclipse_JBoss.pdf |
Upgrade from Previous Version | - If you did NOT just install a new version of Eclipse, remove the old plugin directory (for example, C:/eclipse/plugins/com.genuitec.eclipse.easie.core/ and C:/eclipse/plugins/com.genuitec.eclipse.easie.jboss/) |
Install | Unzip to <Eclipse install dir> (the plugin will reside under <Eclipse install dir>/plugins as subfolder com.genuitec.eclipse.easie.core and com.genuitec.eclipse.easie.jboss. |
Configure Eclipse |
|
Integrating Tomcat with JBoss
Version | Tomcat 4.x and JBoss 3.x |
Configure JBoss | JBoss 3.0.0 comes with Jetty Servlet Engine enabled running at port 8080 as default. If you want Tomcat to run on port 8080, they will conflict. To disable Jetty in JBoss:
|
Configure Tomcat |
1. Your application EJB's client classes need to be accessible to the Web application, at preferrably WEB-INF/lib (or WEB-INF/classes). 2. For your Eclipse application, project .classpath need to include the following to compile EJB client calls: <classpathentry kind="var" path="TOMCAT_HOME/common/lib/jboss-j2ee.jar"/> |
Integrating JBoss with MySQL
Version | JBoss 3.x and MySQL 3.x |
Configure MySQL |
|
Configure JBoss |
|
From: http://www.purposesolutions.com/Resources/EclipseJ2EE.html