Installing an environment for developing J2EE applications

Document Sample
Installing an environment for developing J2EE applications Powered By Docstoc
					Installing an environment for developing
J2EE applications Enterprise Java Beans
Component          Our choice Alternatives
Application                     JOnAS, Weblogic, IBM
Server                          Websphere
Database           MySQL        Hypersonic, Cloudspace
Development        Eclipse +    Sun ONE Studio, netBeans,
Environment        JBoss-IDE    WebSphereStudio, JBuilder
Java-based build
Code generation

Database: MySQL 4.0 (

We need a SQL-standard relational database that is accessible using JDBC. MySQL is
the most widely used and powerful Open Source database server.


Download the application from here: Download


      Unzip to a directory on your
       machine – c:\ is recommended.
       NOTE: It is not recommended that you install MySQL in to a directory whose
       name contains a space. Therefore, do not use a directory such as c:\program
       files\mysql, instead use a directory such as c:\mysql or
      Note: the installation does not create a Program Folder. To do so:
           1. Create a Program Folder "MySQL 3.23.54"
           2. Create shortcut for: <install_dir>\bin\winmysqladmin.exe
   Environment Settings
    Add <install_dir>\bin to PATH (e.g. C:\MySQL\bin).
   Start Menu
    Add a shortcut to <install_dir>\bin\winmysqladmin.exe to the
    Startup menu, so it will be automatically started.
   Setup
        1. Run winmysqladmin.exe either from the start menu (Start-
           >Programs->MySQL 3.23.54->winmysqladmin) or from a command
           prompt (winmysqladmin).
        2. First time you invoke MySQLAdmin (i.e. whenever my.ini does not exist
           under C:\Windows), you will be prompted for the username/password to
           use for the administrator. Enter your choice (e.g. root/root or
        3. The MySQL admin window will come up and then immediately minimize
           into System Tray. So long as the light is green then it is running correctly
           and you can bring it up by: Right click on System Tray icon -> Option
           "Show me". If the light is red then you may want to see what errors were
           printed in the console and fix them before proceeding.
        4. By default, "mysqld" uses ISAM files, which do NOT support
           transactions. In order to support transactions that are required for
           enterprise applications, you must configure the "my.ini" file as follows:
               1. Select the "my.ini Setup" tab
               2. Check the "mysqld-max-nt" radio button,
               3. Press the "Pick-up and Edit my.ini values" button.
               4. Edit my.ini file by adding the following lines before the
                   "[WinMySQLadmin]" line. You may want to customize the
                   underlined fields; which specifies two 500MB database files are
                   created at C:\mysql\ibdata, and three 10MB log files are
                   created at C:\mysql\iblogs.

                   innodb_data_home_dir = C:\mysql\ibdata
                   innodb_data_file_path =
                   set-variable = innodb_buffer_pool_size=70M
                   set-variable =
                   innodb_log_group_home_dir = C:\mysql\iblogs
                   innodb_log_arch_dir = C:\mysql\iblogs
                   set-variable = innodb_log_files_in_group=3
                   set-variable = innodb_log_file_size=10M
                   set-variable = innodb_log_buffer_size=8M
                   set-variable = innodb_file_io_threads=4
                   set-variable = innodb_lock_wait_timeout=50
               5. Finally, press "Save Modification" button to save changes into
                   my.ini (under e.g. C:\Windows).
        5. Manually create the folder <ibdata location> and <iblogs
           location> (in the above "my.ini" file, it's C:\mysql\ibdata and
           C:\mysql\iblogs). You can create these directories from windows
        6. Now go back to the MySQLAdmin tool to re-start the MySQL service. To
           do that:
               1. Right click on the window -> Option "Win NT" -> item "Stop the
               2. Then Right click again -> Option "Win NT" -> item "Start the

    Note that it will take a moment to create the database files and log files as

   Test and Validation:
       1. Make sure service "Mysql" is started. The green light in the upper right
           hand corner of the winmysqladmin window means that the service is
           started; a red light means it is stopped. If its stopped then start it by right
           click on the window -> Option "Win NT" -> item "Start the service".
       2. Test whether MySQL is working by executing the following commands
           from a Command prompt:

            >   mysqlshow
            >   mysqlshow -u root mysql
            >   mysqladmin version status proc
            >   mysql test

        3. Try to login.
              1. Open a Command window, try "mysql -u <username> -p".
                   You'll be prompted for password (use the one you specified in
                   my.ini, e.g. root/root); which will put you into the mysql
              2. In the mysql console, enter SELECT user();. (Be sure to end
                   your SQL with semicolon.)
              3. Create the database for JBoss, for instance test.
                   CREATE DATABASE test;
              4. Add a user with host="localhost", user="jboss", and
                   password="11223344" and grant that user all privileges in the
                   table test. To do that, enter the following commands in the
                   mysql console:

                    INSERT INTO mysql.user (host,user,password)
                    VALUES ('localhost', 'jboss', '11223344');
                    GRANT ALL PRIVILEGES ON test.* TO
                      jboss@localhost IDENTIFIED BY '11223344';
                      GRANT ALL PRIVILEGES ON test.* TO jboss@'%'
                      IDENTIFIED BY "11223344";

           4. Try to login to database "test" as user "jboss": In DOS, enter "mysql
              -u jboss -p test" (Note: test here is the database name, NOT the
              password. You will be prompted for the password. After giving the
              password (11223344), you should be logged into the test database as
              the jboss user.

MySQL Control Center 0.9.3

Graphical client GUI interface to administer MySQL and data.


Download the application from here: Download


Simply run the Setup.exe.


The first time you launch the ControlCenter you have to specify how to connect to the

      Name: root@localhost:3306
      Host Name: localhost
      User Name: root
      Password: root (enter the appropriate password of your configuration for the
       root user!!)

MySQL Connector/J 3.0 : official JDBC driver

Official API (Application Programming Interface)


Download the API from here: Download


Unzip the downloader archive. Find the mysql-connector-java.3.0.8-
stable-bin.jar file , which will be used in the JBoss configuration.
Application Server: JBoss 3.2.2 (

JBoss is an Open Source, standards-compliant, application server implemented in 100%
Pure Java and distributed for free.

Download : includes Tomcat 4.1.27 JBossWeb HTTP server and
JSP/Servlet engine, EJB, CMP2.0, JCA, IIOP, Clustering, JTS, JMX and more

Download the application from here: Download


Simply unzip the downloaded file to your hard disk (for instance
in C:\).

Environment Settings

It may be useful to create an environment variable JBOSS_HOME with the value


The command c:\jboss-3.2.2RC3\bin\run launches the application server.

Configuration of JBoss 3.2.2 for working with an external relational database,
MySQL, by default

      Remove Hypersonic DataSource by deleting
       Replace it by copying the file \docs\examples\jca\mysql-ds.xml into
       Edit it, i.e. it to have following content:


   Copy mysql-connector-java.3.0.8-stable-bin.jar to
   Edit \server\default\conf\standardjbosscmp-jdbc.xml, i.e.
    change the name and mapping of datasoure:
   Edit \server\default\conf\standardjaws.xml, i.e. change the name
    and mapping of datasoure:
   Remove the file server\default\deploy\jms\hsql-jdbc2-
    Replace it by copying the file \docs\examples\jms\mysql-jdbc2-
    service.xml into server\default\deploy\jms\
    Edit it, i.e. change MySqlDS to DefaultDS (on line 47)
   Edit the file server\default\conf\login-config.xml by adding
    following block of text:

    <application-policy name = "MySqlDbRealm">
    <login-module code =
    flag = "required">
    <module-option name = "principal">jboss</module-
    <module-option name = "userName">jboss</module-option>
    <module-option name = "password">11223344</module-
    <module-option name =
Eclipse 2.1.1 (
Universal Tool Platform


Download the application from here: Download


Simply unzip the downloaded file to your hard disk. Foo example c:\

To run Eclipse, execute c:\eclipse\eclipse.exe.

JBoss - IDE 1.2.0
JBoss-IDE is a project with the aim to provide a world class IDE for JBoss. JBoss-IDE is
based on the following technologies : Eclipse and XDoclet. It is a set of plug-ins.


Download the set of plug-ins from here: Download


Simply copy the content of the plugins folder of the downloaded ZIP-file to
c:\eclipse\plugins and the content of the feature folder of the contained the ZIP-
file to c:\eclipse\features

Using the launcher

      Launch Eclipse.
      To use the JBoss-IDE launcher select Window> Show View > Other >
       JBoss-IDE > Server Navigator from the main menu bar. The Server
       Navigator is the control center.
      Right-click in the "Server Navigator" panel (it should have just appeared at
       the right-bottom of the eclipse window) and choose "Configuration".
      Select JBoss 3.2.x, then New.
      Define the home directory of JBoss (normally c:\jboss-3.2.2RC3) and
       change the name to JBoss-3.2.2 for example.
      Now you should be able to launch JBoss from the Java View and the "Debug"

Ant 1.5.4 (
Ant is an extremely powerful Java-based project build tool (Apache Software License)


XDoclet 1.2 (
Code generation tool


JUnit 3.8.1 (
JUnit is a unit testing framework (IBM Common Public Licence).


Database: HSQLDB (

HSQLDB, based on HypersonicSQL, is a general purpose Open Source Java Database,
FREE to use and re-distribute


Java 2 SDK, Standard Edition (J2SE™ SDK), v1.4.1 or

Java 2 SDK, Enterprise Edition (J2EE™ SDK),


Concurrent Versions System

A free CVS Client for Windows: TortoiseCVS

Shared By: