Saturday, September 3, 2011

Java EE6 - Install development environment

Objectives
  1. Install the environment of development
Tools

 Installation

    StepToolAction                 Optional ActionExample
    1Java SELaunch installerCustomize directoryu:\dev\java\jse\jdk7
    2JBoss- Extract JBoss
    - Set the JBOSS_HOME
    - From  <JBOSS_HOME>\bin launch either the domain or standalone script
    Customize directory u:\dev\java\srv\jboss7
    3MySQLLaunch installerCustomize directoryu:\dev\db\mysql
    -dddd



    Customize installation optionsDeveloper Default, 
    Connector/J 5.15.0, 
    Developer Machine, Enable TCP/IP Networking
    4MySQL- Launch MySQL Workbench
    - Double-click "Local instance MySQL55" to connect to the DB
    - Create database called EJB3


    5MySQL Connector/J- Unzip
    - Create dir  <JBOSS_HOME>\modules\com\mysql\main if not exists
    -  Copy the MySQL Connector/J jar file into this directory

    6JBoss
    - Create file <JBOSS_HOME>\modules\com\mysql\main\module.xml (see Notes below)
    - Edit <JBOSS_HOME>\domain\configuration\domain.xml
    and/or <JBOSS_HOME>\standalone\configuration\standalone.xml (see Notes below)


    7Eclipse- Extract Eclipse
    - Launch Eclipse
    - Install JBoss Tools from Eclipse
    - In Eclipse, add the Server View
    - From the Server View, add JBoss AS 7
    - From the Server View, launch JBoss AS 7
    - Check JBoss in running going to  http://localhost:8080/ (change port if customized)
    Customize directoryu:\dev\java\ide\eclipse\jee-indigo

    Notes on JBoss AS 7
    • JBoss Administration Console: http://localhost:8080/console (change port if customized)
    • Require JSE 6 (1.6.0) min or higher.
    • Before launching the domain or standalone scripts, ensure the port 8080 is not already in used. If already in use, change the ports in uses editing:
      If domain: <JBOSS_OME>\domain\configuration\ domain.xml and in host.xml if needed.
      If standalone: U:\srv\jboss7\standalone\configuration\standalone.xml
      And restart either the domain or standalone script.
    • JBoss domain is a new addition to JBoss AS 7.
    • See also:
      Getting Started Developing Application Guide
      User Guide
      Videos (part 1, part 2)
      JBoss docs

    Note installing MySQL/J Connector
    • modules.xml

      <module name="com.mysql" xmlns="urn:jboss:module:1.0">
        <resources>
          <resource-root path="mysql-connector-java-5.1.17-bin.jar">
        </resource-root></resources>
        <dependencies>
          <module name="javax.api">
        </module></dependencies>
      </module> 
      
    • <JBOSS_HOME>\standalone\configuration\standalone.xml  and/or <JBOSS_HOME>\domain\configuration\domain.xmlLocate the <datasources> .. </datasources> section. Replace with:

       <datasources>
         <datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS">
           <connection-url>jdbc:mysql://localhost:3307/EJB3</connection-url>
           <driver>com.mysql</driver>
           <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
           <pool>
             <min-pool-size>10</min-pool-size>
             <max-pool-size>100</max-pool-size>
             <prefill>true</prefill>
            </pool>
            <security>
              <user-name>test</user-name>
              <password>test</password>
             </security>
             <statement>
              <prepared-statement-cache-size>32</prepared-statement-cache-size>
             </statement>
            </datasource>
            <drivers>
             <driver name="com.mysql" module="com.mysql">
               <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
             </driver>
            </drivers>
          </datasources> 
    • See also: Installing the JDBC Driver on the JBoss doc in case of problem

    FAQs

    1. JBoss AS: Which version: Web Profile Only (Java EE6 Certified) or Everything (NOT Java EE6 Certified) ?

      See: Java EE6 Specs - Web Profile and JBoss Comparison Table.

    Alternatives Open Sources Recommended Tools for Developpers

    CategoryToolDescription
    JEE ServerOpenEJBEmbeddable and lightweight. Can be used as a standalone server or embedded into Tomcat, JUnit, TestNG, Eclipse, IntelliJ, Maven, Ant, and any IDE or application.

    GlassFishGlassFish is a Java EE open source application server. Also for Production environments.
    DatabaseHSQLDBOpen source relational database implemented entirely in Java.

    Apache DerbyOpen source relational database implemented entirely in Java.

    Oracle APEXOracle Application Express (Oracle APEX) is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure.

    Others JEE Applications Servers for Development and/or Production Environment

    See also: JEE 6 - Applications Servers

    No comments:

    Post a Comment