JBoss

 
 
JBoss is an Open Source, standard compliant, Enterprise JavaBeans Application Server implemented in 100% Pure Java. It is usable for both development and production.

JBoss is licensed under the LGPL. Which means that you are entitled to redistribute the jboss binary (the jar) free of charge without modifications. You can distribute your code under any license you wish.

JBoss 2 is designed to be an EJB v1.1 container and server. Some parts of EJB 2.0 are supported in the 2.4.x versions, for example Message Driven Beans. JBoss 3.x supports EJB v2.0 including Container Managed Persistence.

JBoss comes bundled with Jakarta Tomcat or Jetty to serve web pages, JSP pages and Servlets. JBoss can be run on different machines.

There is no requirement for root access to run JBoss as none of the default ports are below the 1024 priveledged port range. JBoss will run very effectively on a machine with 64 megabytes of RAM, and requires only a few megabytes of disk (including source code!). One of the nicest features of JBoss is its support for "hot" deployment. What this means is that deploying a Bean is a simple as copying its JAR file into the deployment directory. If this is done while the Bean is already loaded, JBoss automatically unloads it, then loads the new version. There is a built-in SQL database server for handling persistent beans, and this starts up automatically with the server.

The latest JBoss version can be downloaded from: http://labs.jboss.com

rss feed






Define MySQL 3.23 service in JBoss 3.0.4 with Jetty



Information
none

Operating system used
Windows XP Home Edition Version 5.1 SP 2

Software prerequisites
JBoss version 3.0.4 with Jetty
MySQL version 3.23
MySQL Connector/J 2.0.14


Procedure
  1. Create a database and tables. If you do not know how to do so, see Quick installation guide: Create database and tables.

  2. Copy ..\jboss-3.0.4\docs\examples\jca\mysql-service.xml into ..\jboss-3.0.4\server\default\deploy

  3. Edit file ..\jboss-3.0.4\server\default\deploy\mysql-service.xml:
    • JndiName: set the jndi name to "MySqlDS".
    • ConnectionURL: set your host and database name (e.g. host is "localhost" and database name is "mobilefishdb"). The portnumber is 3306. You can verify this by entering command:
      C:\..\mysql\bin>mysqladmin version (MySQL must be started first).
    • DriverClass: set the MySQL JDBC driver name "org.gjt.mm.mysql.Driver"
      (See mysql-connector-java-2.0.14-bin.jar).
    • UserName: set your database username (e.g. "root").
    • Password: set your password (e.g. "mysecret").



    <attribute name="JndiName">MySqlDS</attribute>
    <attribute name="ManagedConnectionFactoryProperties">
      <properties>
        <config-property name="ConnectionURL" type="java.lang.String">
          jdbc:mysql://localhost:3306/mobilefishdb
        </config-property>
        <config-property name="DriverClass" type="java.lang.String">
          org.gjt.mm.mysql.Driver
        </config-property>
        <config-property name="UserName" type="java.lang.String">
          root
        </config-property>
        <config-property name="Password" type="java.lang.String">
          mysecret
        </config-property>
      </properties>
    </attribute>


  4. Edit file: ..\jboss-3.0.4\server\default\conf\standardjbosscmp-jdbc.xml
    • Change "java:/DefaultDS" into "java:/MySqlDS"
      Note: This is the jndi name you previously set.
    • Change "Hypersonic SQL" into "mySQL"
      Note: Both are type-mappings defined below in the file.

    <datasource>java:/MySqlDS</datasource>
    <datasource-mapping>mySQL</datasource-mapping>

  5. [Optional] You can override the values you specified in the standardjbosscmp-jdbc.xml, by the jbosscmp-jdbc.xml file which each EJB jar will have.
    An example of such a file can be found at:
    ..\jboss-3.0.4\cmp2\src\resources\ejb-jar\META-INF\jbosscmp-jdbc.xml