Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

This will bring up the MySQL command interface as shown in the following example:

No Format
borderStylesolid
titleMySQL monitor interface
borderStylesolid
Welcome to the MySQL monitor.  Commands end with *;* or *\g*.
Your MySQL connection id is 7 to server version: 4.1.14-nt

Type *help;* or *\h* for help. Type *\c* to clear the buffer.

mysql>

...

Copy the mysql-ds.xml file to the deploy directory of your JBoss server (<jboss_home>\server\<your_server_name>\deploy) and edit it as shown in the following example:

Code Block
xmlborderStylesolid
titleUpdate the mysql-ds.xml file
borderStylesolid
xml
<jndi-name>jdbc/TradeDB</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/tradedb</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>password</password>
<exception-sorter-class-name>
org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
</exception-sorter-class-name>

...

After extracting the zip file, a brokerage directory is created. In that directory open the build.properties file and edit the properties to match your environment as shown in the following example:

solid
No Format
borderStyle
titleUpdate the build.properties file
borderStylesolid
# Replace server.name with either jboss or geronimo depending on which server to deploy.
server.name=jboss
#Replace <JAVA_HOME> with your JDK home directory
java.home=<JAVA_HOME>
#Replace <JBOSS_HOME> with the root directory for your specific JBoss server <jboss_home>\servers\<server_name>
jboss.home=<JBOSS_HOME>
#Replace <GERONIMO_HOME> with the root directory for Geronimo
geronimo.home=<GERONIMO_HOME>
#fully qualified name of the JDBC driver class
db.driver=com.mysql.jdbc.Driver
#database URL
db.url=jdbc:mysql://localhost:3306/tradedb
#database userId
db.userid=root
#database password
db.password=password
#script files for creating the tables
sql.file=sql/db.sql
#location of the jdbc driver jar.
driver.classpath=<jboss_home>/server/<your_server_name>/lib/mysql-connector-java-3.1.14-bin.jar

...

From a command prompt or shell go to the brokerage directory and run ant. This will build the war file and place it directly in the brokerage directory. The war created by the ant build contains a JBoss specific deployment descriptor, the jboss-web.xml file in the WEB-INF directory of the WAR is shown in the following example.

Code Block
xmlborderStylesolid
titleJBoss deployment descriptor
borderStylesolid
xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
  <context-root>/brokerage</context-root>
  <resource-ref>
      <res-ref-name>jdbc/TradeDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <jndi-name>java:jdbc/TradeDB</jndi-name>
  </resource-ref>
</jboss-web>

...

First, create an xml file called mysql-geronimo-plan.xml. Copy the plan shown in the following example and paste it in the xml file.

Code Block
xmlborderStylesolid
titleData source deployment plan
borderStylesolid
xml
<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">

  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
	  <dep:groupId>user</dep:groupId>
	  <dep:artifactId>jdbcdatasource</dep:artifactId>
	  <dep:version>2.0</dep:version>
	  <dep:type>car</dep:type>
	</dep:moduleId>
	<dep:dependencies>
	  <dep:dependency>
	    <dep:groupId>mysql</dep:groupId>
		<dep:artifactId>mysql-connector-java</dep:artifactId>
		<dep:version>3.1.14-bin</dep:version>
		<dep:type>jar</dep:type>
	  </dep:dependency>
	</dep:dependencies>
  </dep:environment>
<resourceadapter>
  <outbound-resourceadapter>
    <connection-definition>
      <connectionfactory-interface>
        javax.sql.DataSource
      </connectionfactory-interface>
      <connectiondefinition-instance>
        <name>TradeDS</name>
        <config-property-setting name="UserName">
          root
        </config-property-setting>
        <config-property-setting name="Password">
          password
        </config-property-setting>
        <config-property-setting name="Driver">
          com.mysql.jdbc.Driver
        </config-property-setting>
        <config-property-setting name="ConnectionURL">
          jdbc:mysql://localhost:3306/tradedb
        </config-property-setting>
        <config-property-setting name="CommitBeforeAutocommit">
           false
        </config-property-setting>
        <config-property-setting name="ExceptionSorterClass">
           org.tranql.connector.NoExceptionsAreFatalSorter
        </config-property-setting>
        <connectionmanager>
          <local-transaction/>
          <single-pool>
             <max-size>10</max-size>
             <min-size>0</min-size>
             <blocking-timeout-milliseconds>
                5000
              </blocking-timeout-milliseconds>
              <idle-timeout-minutes>
                30
              </idle-timeout-minutes>
              <match-one/>
          </single-pool>
        </connectionmanager>
      </connectiondefinition-instance>
    </connection-definition>
  </outbound-resourceadapter>
</resourceadapter>
</connector>

...

The geronimo-web.xml file is located in the <brokerage_home>\web\descriptors\geronimo directory and looks like the following example.

Code Block
xmlborderStylesolid
titlegeronimo-web.xml
borderStylesolid
xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
	    <dep:moduleId>
		    <dep:groupId>BrokerageApp</dep:groupId>
			<dep:artifactId>MySqlDS</dep:artifactId>
			<dep:version>2.0</dep:version>
			<dep:type>car</dep:type>
		</dep:moduleId>

		<dep:dependencies>
		    <dep:dependency>
		        <dep:groupId>user</dep:groupId>
			    <dep:artifactId>jdbcdatasource</dep:artifactId>
			    <dep:version>2.0</dep:version>
			    <dep:type>car</dep:type>
			</dep:dependency>
		</dep:dependencies>

	</dep:environment>
<context-root>/brokerage</context-root>

<resource-ref>

	<ref-name>jdbc/TradeDB</ref-name>

     <resource-link>TradeDS</resource-link>

</resource-ref>

</web-app>

...