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 4.0.18 service in JBoss 3.2.3



Information
none

Operating system used
Windows XP Home Edition Version 5.1 SP 2

Software prerequisites
JBoss version 3.2.3
MySQL version 4.0.18
MySQL Connector/J 3.0.11


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 an example mysql datasource configuration file from
    ..\jboss-3.2.3\docs\examples\jca\mysql-ds.xml to
    ..\jboss-3.2.3\server\default\deploy

    If you can not find this file, you can download it from here:

    xml file Location
    mysql-ds.xml ...\jboss-3.2.3\server\default\deploy


  3. Edit file ..\jboss-3.2.3\server\default\deploy\mysql-ds.xml into:

    <datasources>
       <local-tx-datasource>
          <jndi-name>MySqlDS</jndi-name>
          <connection-url>
             jdbc:mysql://localhost:3306/mobilefishdb
          </connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>
          <password>mysecret</password>
       </local-tx-datasource>
    </datasources>


    • jndi-name: set the jndi name to "MySqlDS".
    • connection-url: 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).
    • driver-class: set the MySQL JDBC driver name "com.mysql.jdbc.Driver"
      (mysql-connector-java-3.0.11-stable-bin.jar).
    • user-name: set your database username (e.g. "root").
    • password: set your password (e.g. "mysecret").



  4. A default datasource configuration file hsqldb-ds.xml is already available in the deploy directory. Remove the file ..\jboss-3.2.3\server\default\hsqldb-ds.xml
    Note: It is recommended to backup this file if you need it in the future.

  5. Copy file ..\jboss-3.2.3\docs\examples\jms\mysql-jdbc2-service.xml to
    ..\jboss-3.2.3\server\default\deploy\jms

    If you can not find this file, you can download it from here:

    xml file Location
    mysql-jdbc2-service.xml ..\jboss-3.2.3\server\default\deploy\jms


  6. Verify file ..\jboss-3.2.3\server\default\deploy\jms\mysql-jdbc2-service.xml:
    Check line "..jboss.jca:service=LocalTxCM,name=MySqlDS ..."

  7. Remove file
    ..\jboss-3.2.3\server\default\deploy\jms\hsqldb-jdbc2-service.xml
    Note: It is recommended to backup this file if you need it in the future.

  8. Start MySQL by opening a dos window and type: net start mysql

  9. Start jboss: ..\jboss-3.2.3\bin\run.bat

    Note 1: There should be NO error messages.
    Note 2: A warning message is displayed:
    WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class...
    This is an irrelevant warning you can safely ignore.