PURPOSETHIS ARTICLE COVERS Setting Up 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 * THESE INSTRUCTIONSASSUME Windows Platform. Linux Needs Slightly DiffERENT URLS & Similar Steps.
* 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 for updates.
- Ant Integration with Eclipse.- Code Examples.- XDoclet Integration Into Eclipse for EJB Developments.
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 (Click for Details) Current Version Vendor J2EE Installation JDK 1.4.0 Sun J2SE 1.4 Install Tomcat (Open Source) 4.0.4 Beta 2 Apache J2EE 1.3 (servlet 2.3, JSP 1.2, etc.) Unzip JBoss (OEPN SOURCE) 3.0. 0 Release Candidate 1 JBoss Group J2EE 1.3 (EJB 2.0, JMS 1.1, JCA 1.0, JAXP 1.1, etc.) UnziporBuild MySQL (Open Source) 3.23.49 MySQL AB RDBMS Install Eclipse (Open Source) 2.0, pre-release build 20020321 Eclipse Java IDE Unzip Eclipse Tomcat Plugin 0.96 Sysdeo (France) IDE PLUGIN UNZIP Eclipse JBoss Plugin 1.0ea4 Genuitec IDE PLUGIN UNZIPINSTALLING JDK
Version 1.4.0 Download Get Get Binary J2SDK-1_4_0-win.exe at http://java.sun.com/j2se/1.4/download.html* Be Sure To Download The SDK, NOT JUST THE JRE.Documentation - Online - HTTP : //java.4/docs/Index.html- Downloadable - http://java.sun.com/j2se/1.4/download.html Install Run The Executable Which Will Install The Following:
Java 2 SDK, SE V1.4.0 Java 2 Runtime Environment, SE V1.4.0 Java Plug-in 1.4.0 Java Web Start (1.0.1) Environment Set Variable Java_Home TO
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 (General download at http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release.) * Also available is an Install version, which can run as Windows service Not recommeded for development.Documentation -. Online - http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html-doc - (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.- After the installation, copy the old server.xml (or preferrably, just the context you added) to the new.- After the installation, go Over Other Tomcat Related Sections and Check for Applicable Changes. INS Tall Unzip to Destination (Say C: /, Which Makes
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 Reason:
Debugging web application is harder - need to do build into .ear instead of using Tomcat server.xml to point to code Encountered class loader problem from Tomcat to integrate with JBoss 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.- After the installation, go over other JBoss related sections and check for applicable changes Install Unzip to destination (.. Say C: /, Which makes
outputs.Try http: // localhost: 8080, you should see Tomcat document and example - this is served through the embedded Jetty JSP / Servlet container (not Tomcat) .Also, try http: // localhost: 8082, you should see the JMX management console.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.49download 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 off 3/14/2002, so 3.23 is recommentation for the time being.documentation - local: (after install dir> /DOCS/Manual_toc.html- Online Documentation: http://www.mysql.com/documentation/index.htmlupgrade from Previous Version COMING SOON ... INSTALL - UNZIP TO A TEMP DIR (EG, C: / TEMP / MySQL_INSTALL) - Run setup.exe to install . (eg, into C: /mysql3.23) * The installation does not create Program Folder Following recommend:. (1) Create a Program Folder "MySQL 3.23" (2) Create shortcut for:
C: /mysql3.23/ibdatainnodb_data_file_path = ibdata1: 500M; ibdata2: 500Mset-variable = innodb_buffer_pool_size = 70Mset-variable = innodb_additional_mem_pool_size = 10Minnodb_log_group_home_dir = C: /mysql3.23/iblogsinnodb_log_arch_dir = C: /mysql3.23/iblogsinnodb_log_archive=0set-variable = innodb_log_files_in_group = 3set-variable = innodb_log_file_size = 10Mset-variable = innodb_log_buffer_size = 8Minnodb_flush_log_at_trx_commit = 1set-variable = innodb_file_io_threads = 4set-variable = innodb_lock_wait_timeout = 50 * The above specifies that two 500MB database files be created at C: /mysql3.23/ibdata And Three 10MB log files created at c: / mysql3.23/iblogs.then click "Save Modification" to save the change Into my.ini (Under Eg C: / Winnt) .4 .manally create the folder
............................................................. .. Enter "MySQL -U Developer -P Test" (NOTE: TEST Here is The Database Name, Not The Password. Password Will Be Pass, You Should Be in Test As Developer: - TRY "SELECT User "and you shop get" developer @ localhost ". - Try Creating a Table and Put Some Data: Creger Null Table1 (ID Integer Null, Data VARCHAR (1), Primary Key (ID)) TYPE = InnoDB; Insert Into Table1 (ID, DATA) VALUES (1, 'One'); INSERT INTO TABLE1 (ID, DATA) VALUES (2, 'Two'); Insert Into Table1 (ID, DATA) VALUES (3, 'Three'); SELECT * FROM table1; Note: * 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 autocmit = 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 (General Download At http://www.eclipse.org/downloads/index.php) 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.- After the installation, copy your workspace over (from C:. / eclipse_old / workspace / to C: . /eclipse/workspace).- After the installation, go over other Eclipse related sections and check for applicable changes Install Unzip to destination (say C: /, which makes
. Version 0.96Download Get binary tomcatPluginV096.zip at http://www.sysdeo.com/eclipse/tomcatPluginV096.zip(General page at http://www.sysdeo.com/eclipse/tomcatPlugin.html) Documentation Online instruction: http : //www.sysdeo.com/eclipse/tomcatPlugin.htmlUpgrade 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
Start Eclipse. Configure tomcat plugin.menu "Workbench" -> item "preferences" -> option "tomcat" -> "tomcat version", select "4.x" -> "Tomcat Home", Specify
Version 1.0EA4Download Get zip binary http://www.genuitec.com/products/EASIEJBoss1.0ea4.zip(General page at http://www.genuitec.com/products.htm#easie.) Documentation Online instruction (PDF) : http://www.genuitec.com/products/Eclipse_JBoss.pdfUpgrade 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
"JBoss Home Directory":
Integrating Tomcat with jboss
Version Tomcat 4.x and JBoss 3.xConfigure 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:.. Create a backup folder next to subfolder deploy / (eg% JBOSS_DIST% / server / default / deployBackup.) Move file jetty-plugin.sar from deploy / into deployBackup / (making it absent from the deploy / folder) Configure Tomcat
Add JBoss Client Library to Tomcat: Copy The Following from% JBoss_Dist% / Client INTO% Tomcat_Home% / Common / LIB: JBoss-J2EE.jar, JBoss-Client.jar, JBosssx-Client.jar, JNP-Client.jar, Jboss -common-client.jar and log4j.jar.When Tomcat starts up, these .jar would be added to its classpath. If you ever run into others that you need, just copy from% JBOSS_DIST% / client folder. Specify JNDI properties to Tomcat JVM (you probably want to do both) .o Tomcat in OS (outside Eclipse): Change% TOMCAT_HOME% / bin / setclasspath.bat (backing up the original is recommended), the line with JAVA_OPTS (following is one line): set JAVA_OPTS = -Djava.naming.factory.initial = org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url = localhost: 1099 -Djava.naming.factory.url.pkgs = org.jboss.naming: org. JNP.Interfaces o Tomcat Inside Eclipse: Menu "Workbench" -> item "preference" -> option "tomcat" -> Suboption "jvm settings" -> "append to jvm parameters, add the following threei JVM Parameters (Each Line IS) a seper ate parameter): -Djava.naming.factory.initial = org.jnp.interfaces.NamingContextFactory-Djava.naming.provider.url = localhost: 1099-Djava.naming.factory.url.pkgs = org.jboss.naming: org .jnp.interfacesNote:. 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 / jbossx-client.jar" />
Version jboss 3.x and mysql 3.xconfigure MySQL
Be sure your MySQL is using mysqld-max which supports InnoDB (or BDB) for transaction. You tables also need to have "type = InnoDB" (or BDB) .- To check, do "SHOW TABLE STATUS LIKE '