Integrating JDBC Type 4 Driver With JBoss Applications
Copying the t4sqlmx.jar file
The sqlmx-xa-ds.xml file from the “Configuring JDBC Type 4 data source files for the JBoss
Application Server” section defines the SQLMXDriver as the driver class to be used for the DefaultDS
datasource. This driver class is part of the t4sqlmx.jar file and must be made available to the JBoss
environment at runtime.
To do this, copy the TYPE4_HOME/lib/t4sqlmx.jar file to the JBOSS_HOME/server/default/lib
directory.
Starting the JBoss Application Server
Start the default JBoss Application Server by executing the startup script—run.bat—located at
JBOSS_HOME/bin.
Note: There may be some JMS-related errors that you can safely ignore because the Duke’s Bank
sample does not use any JMS code.
Deploying and running the sample
Deployment using the JBoss Application Server is easy: You just have to copy the EAR file to the
deploy directory. There’s also a target in the build file under the j2eetutorial14/examples/bank
directory for this purpose. So you can type:
ant -f jboss-build.xml deploy
This will assemble the EAR file and deploy it. You should see something close to the following output
from the server (shortened here somewhat for brevity):
19:30:32,966 INFO [MainDeployer] Starting deployment of package:
file:/F:/servers/jboss-3.2.3/server/default/deploy/JBossDukesBank.ear
19:30:32,997 INFO [EARDeployer] Init J2EE application: file:/F:/servers/jboss-
3.2.3/server/default/deploy/JBossDukesBank.ear
19:30:34,513 INFO [EjbModule] Deploying AccountEJB
...
19:30:45,356 INFO [Engine] StandardManager[/bank]: Seeding random number
generator class java.security.SecureRandom
19:30:45,356 INFO [Engine] StandardManager[/bank]: Seeding of random number
generator has been completed
19:30:45,356 INFO [Engine] StandardWrapper[/bank:default]: Loading container
servlet default
19:30:45,356 INFO [Engine] StandardWrapper[/bank:invoker]: Loading container
servlet invoker
19:30:45,685 INFO [EARDeployer] Started J2EE application: file:/F:/servers/jboss-
3.2.3/server/default/deploy/JBossDukesBank.ear
19:30:45,685 INFO [MainDeployer] Deployed package: file:/F:/servers/jboss-
3.2.3/server/default/deploy/JBossDukesBank.ear
If there are any errors or exceptions, make a note of the error message and the point at which it
occurred (for example, during the deployment of a particular EJB, the Web application, and so on).
Check that the EAR file is complete and inspect the WAR file and each of the EJB jar files produced
by the build to ensure they contain all the necessary components (classes, descriptors, and so on).
Note: There may be some JMS-related errors that you can safely ignore because the Duke’s Bank
sample does not use any JMS code.
8










