jboss 6.2 EAP unable to add mysql datasource and module - mysql

I am having trouble to add a mysql jdbc driver to my jboss 6.2 EAP. I followed each step as described there : Install a JDBC Driver as a Core Module
but whenever I try to create datasource in command line, jboss return this message:
[standalone#localhost:9999 /] /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource)
{
"outcome" => "failed",
"failure-description" => "JBAS014749: Operation handler failed: Service jboss.jdbc-driver.mysql is already registered",
"rolled-back" => true
}
I obtain the same message at boot time when I try to manually add datasource configuration to my standalone-full.xml file.
I placed my jar driver in EAP_HOME/modules/com/mysql/main/ and this is my module configuration:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.31.jar" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
My development environment: ubuntu 14.04, sun jdk 7 or 8.
thanks

The problem is caused by 2 entries in META-INF/services/java.sql.Driver in the MySQL JDBC driver JAR:
com.mysql.jdbc.Driver
com.mysql.fabric.jdbc.FabricMySQLDriver
JBoss EAP 6.2 probably doesn't expect more than 1 entry there. I filled an issue with the problem description.
Nevertheless, you can define value for driver-class-name attribute in the CLI command and you should get the expected behavior:
/subsystem=datasources/jdbc-driver=mysql:add( \
driver-name=mysql, \
driver-module-name=com.mysql, \
driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource, \
driver-class-name=com.mysql.jdbc.Driver)

#kwart's answer didn't work for me (running on JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14), using mysql-connector-java-5.1.32 jdbc driver), I fixed it by adding the following directly to standalone.xml
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
<datasources>
<!-- snip -->
<drivers>
<driver name="mysql" module="com.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Make sure the server is stopped when you do this otherwise the change will disappear..

I had the same problem and solved with an old version driver: mysql-connector-java-5.1.27-bin.jar
org.jboss.msc.service.DuplicateServiceException: Service jboss.jdbc-driver.mysql is already registered -> https://access.redhat.com/site/solutions/878573

I had the same problem using mysql-connector-java-5.1.33.jar and solved it by using an old version: mysql-connector-java-5.1.29.jar.
The server now starts properly

Related

Exception org.jboss.modules.ModuleNotFoundException: org.lg.log4j2 when attempting to add log4j 2 as module in jBoss eap 7

I am using log4j 2.16 for my EJBs. Im meaning to add the log4j-core (and log4j-api if necessarily ) as module in jBoss eap 7 but I keep getting the ModuleNotFoundException exception.
here is my configurations :
src/main/ressource/META-INF/jboss-deployement-structure.xml
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.lg.log4j2"/>
</dependencies>
<exclude-subsystems>
<subsystem name="logging"/>
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
pom.xml
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.16.0</version>
<scope>provided</scope>
</dependency>
jboss-eap-7.0 - 22\modules\system\layers\base\org\lg\main
<module xmlns="urn:jboss:module:1.1" name="org.lg.log4j2">
<resources>
<resource-root path="log4j-api.jar"/>
<resource-root path="log4j-core.jar"/>
</resources>
</module>
the two jar exist in the current folder.
EJBXX.jar.failed
WFLYSRV0179: Failed to load module: deployment.EJBXX.jar:main
Caused by: org.jboss.modules.ModuleNotFoundException: org.lg.log4j2:main\"}}"
I am not sure about my solution so please correct me if there is another way to achieve it.
N.B: I spot this error in my jBoss console :
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
Your module is in the wrong directory. It needs to be in org/lg/log4j2/main. You’re also likely missing some module dependencies too.

"WFLYJCA0041: Failed to load module for driver [com.mysql]" on Jboss 7 with MySQL database

I am creating a web application for JBoss EAP 7 and trying to connect to MySQL 8.0 database.
Am getting the error as
[org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 39) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "datasources"),
("jdbc-driver" => "mysql")]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"
My module.xml file in \jboss-eap-7.1.0\modules\system\layers\base\com\mysql\main is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-8.0.12" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
And placed "mysql-connector-java-8.0.12.jar" in \jboss-eap-7.1.0\modules\system\layers\base\com\mysql\main path where module.xml exist.
Datasource configuraion is:
<datasources>
<datasource jta="true" jndi-name="java:jboss/datasources/jdbc/sdmspool" pool-name="sdmspool" enabled="true" use-java-context="true">
<connection-url>jdbc:sqlserver://database;databaseName = sdms</connection-url>
<driver>mysql-connector-java-8.0.12</driver>
<security>
<user-name>user</user-name>
<password>password</password>
</security>
</datasource>
<drivers>
<driver name="mysql-connector-java-8.0.12" module="com.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
Can anyone help me in solving this?
Try creating the module by using jboss-cli as follows:
Run the below commands:
./jboss-cli.sh (this will start cli in disconnected mode,in the same mode run the below command)
module add --name=com.mysql --resources=/path/to/mysql.jar --dependencies=javax.api,javax.transaction.api
and then try adding respective driver in your eap configuration.
You don't have to explicitly define driver-class and xa-datasource-class.
resource root path should be as well mysql-connector-java-8.0.12.jar
please note that the extension (.jar) is missing in your xml config

Why I've a cayenne connection error when I put my web site on a debian server

I'm trying to put my web site on line.
For that, I've a debian and a jetty server.
When I try to go on my web site, it show my the homepage, so, this is ok.
But, when I try to log in, it put me an error message.
It's working on my local machine with this configuration :
<?xml version="1.0" encoding="utf-8"?>
<domain project-version="6">
<map name="datamap"/>
<node name="datanode"
factory="org.apache.cayenne.configuration.server.XMLPoolingDataSourceFactory"
>
<map-ref name="datamap"/>
<data-source>
<driver value="com.mysql.jdbc.Driver"/>
<url value="jdbc:mysql://127.0.0.1:3306/database"/>
<connectionPool min="1" max="10"/>
<login userName="username" password="password"/>
</data-source>
</node>
</domain>
So,I verified the username and password are ok. I tried to execute my web site on my own machine with the new configuration :
<url value="jdbc:mysql://serverip:3306/database"/>
What did I miss?
The error message is :
(I'm sorry, I'm trying to find where I can find the jetty log on the server, I will update it with the full stack)
I supposed I forget one information?
I'm sure about my password and login for the mysql on the server. I'm using SSH, the configuration is in my workbench :
I'm using maven, so I add mysql in the pom.xml :
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
I read that can be because we didn't put the mysql in the classpath. But, that should works, shouldn't it?
EDIT : I tried : <url value="jdbc:mysql://serverusername#serverpwd/serverip:3306/database"/>, without success...
EDIT 2 : This configuration is working :
<node name="datanode"
factory="org.apache.cayenne.configuration.server.XMLPoolingDataSourceFactory"
schema-update-strategy="org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy">
<map-ref name="datamap" />
<data-source>
<driver value="com.mysql.jdbc.Driver" />
<url value="jdbc:mysql://127.0.0.1/database" />
<connectionPool min="1" max="1" />
<autoReconnect> true</autoReconnect>
<failOverReadOnly> false</failOverReadOnly>
<login userName="userName" password="password" />
</data-source>
</node>
The connection may be timing out. Try adding this to the URL: ?connectTimeout=0&autoReconnect=true. For an even more reliable result, try using an external connection pool, e.g. Hikari, with appropriate reconnect properties. Cayenne can be instructed to use an external connection pool on startup via ServerRuntime.builder(..).dataSource(dataSource)..

JBoss server exception while connecting to mysql

I have recently tried JPA program with jboss and eclipse. For connecting to MySQL i have put in the required mySQL-connector JAR in the JBoss installation directory path and I have added the configuration in the standalone.xml of jboss and with that if i start the jboss from eclipse it starts up fine and it shows me the configured connection as well.
But if i add my ejb program and start the server it is giving me the following error and when i searched to solve this, each of the forum is giving me different solutions, but nothing seems to address my problem.
ERROR
17:34:17,195 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service
jboss.deployment.unit."FirstEJBProject.jar".INSTALL:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."FirstEJBProject.jar".INSTALL: Failed to process
phase INSTALL of deployment "FirstEJBProject.jar" at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA] at
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[rt.jar:1.7.0_13] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[rt.jar:1.7.0_13] at java.lang.Thread.run(Unknown Source)
[rt.jar:1.7.0_13] Caused by: java.lang.IllegalArgumentException: Empty
name segment is not allowed for java at
org.jboss.msc.service.ServiceName.of(ServiceName.java:85)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA] at
org.jboss.msc.service.ServiceName.append(ServiceName.java:112)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA] at
org.jboss.as.naming.deployment.ContextNames.buildServiceName(ContextNames.java:178)
at
org.jboss.as.naming.deployment.ContextNames$BindInfo.(ContextNames.java:190)
at
org.jboss.as.naming.deployment.ContextNames$BindInfo.(ContextNames.java:181)
at
org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:124)
at
org.jboss.as.naming.deployment.ContextNames.bindInfoForEnvEntry(ContextNames.java:165)
at
org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:319)
at
org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)
at
org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:145)
at
org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:120)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more
17:34:17,430 INFO [org.jboss.as.server] (DeploymentScanner-threads -
2) JBAS015870: Deploy of deployment "FirstEJBProject.jar" was rolled
back with failure message {"JBAS014671: Failed services" =>
{"jboss.deployment.unit.\"FirstEJBProject.jar\".INSTALL" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"FirstEJBProject.jar\".INSTALL: Failed to
process phase INSTALL of deployment
\"FirstEJBProject.jar\""},"JBAS014771: Services with
missing/unavailable dependencies" =>
["jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.Validatorjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogicMissing[jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.Validatorjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic]","jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.ValidatorFactoryjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogicMissing[jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.ValidatorFactoryjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic]"]}
17:34:17,430 INFO [org.jboss.as.server.deployment] (MSC service
thread 1-2) JBAS015877: Stopped deployment FirstEJBProject.jar in 13ms
17:34:17,445 INFO [org.jboss.as.controller]
(DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic
(missing) dependents: [service
jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.ValidatorFactory,
service
jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.Validator]
JBAS014777: Services which failed to start: service
jboss.deployment.unit."FirstEJBProject.jar".INSTALL:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."FirstEJBProject.jar".INSTALL: Failed to process
phase INSTALL of deployment "FirstEJBProject.jar"
17:34:17,461 ERROR [org.jboss.as.server.deployment.scanner]
(DeploymentScanner-threads - 1) {"JBAS014653: Composite operation
failed and was rolled back. Steps that failed:" => {"Operation step-2"
=> {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"FirstEJBProject.jar\".INSTALL" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"FirstEJBProject.jar\".INSTALL: Failed to
process phase INSTALL of deployment
\"FirstEJBProject.jar\""},"JBAS014771: Services with
missing/unavailable dependencies" =>
["jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.Validatorjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogicMissing[jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.Validatorjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic]","jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.ValidatorFactoryjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogicMissing[jboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic.ValidatorFactoryjboss.naming.context.java.comp.FirstEJBProject.FirstEJBProject.StudentLogic]"]}}}
persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
<!-- MySQL DataSource -->
<persistence-unit name="STUD">
<jta-data-source>java:/</jta-data-source>
<properties>
<property name="showSql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
</properties>
</persistence-unit>
sstandalone.xml
<datasource jndi-name="java:/mydb" pool-name="my_pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/myschema</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password>password</password>
</security>
<statement>
<prepared-statement-cache-size>
100
</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql"/>
</drivers>
</datasources>
Am I missing something here.
I have tried using mySQL-ds.xml and if i use that it is giving a different error as the datasource is unresolvable. It will be helpful if i know the solution for that as well since will packaging my program and deploying there is no need for me to do the SQL connections in the JBoss again.
Thank You.
The problem was with the <jta-data-source>java:/</jta-data-source> I need to fill in the same name as i have provided in <datasource jndi-name="java:/mydb" so finally fixed it myself, thank you for everyones help.
The fixed persistence XML code
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
<!-- MySQL DataSource -->
<persistence-unit name="STUD">
<jta-data-source>java:/mydb</jta-data-source>
<properties>
<property name="showSql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
</properties>
</persistence-unit>
Hope this will help
You will need to define <driver>mysql</driver. This is typically done by defining a module. You can find all about it here http://bnlconsulting.com/index.php/blog/item/88-jboss-71-adding-mysql-datasource

Can't find mysql.jdbc.Driver - MySQL, JBoss

I'm unable to deploy my web app with MySQL 5.5.11 backend to JBoss 5. I get this error:
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from BaseClassLoader#262b2310
I pasted my stack trace below.
Here's what I've done...
I added mysql-connector-java-5.1.14-bin.jar to {JBOSS_HOME}/lib (that connector should work with MySQL 5.5.11 right?). I also added mysql-ds.xml to {JBOSS_HOME}/server/default/deploy.
<datasources>
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/my_libl_db</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>test</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
</local-tx-datasource>
</datasources>
Also, I made sure the mysql-connector-java-5.1.14-bin.jar in my lib folder is in my web apps classpath. In the JBoss Admin Console, under Resources/Datasources, I do see MySqlDS with a status of up.
My project (in Eclipse Indego Release) is an Enterprise Application Project with 1 Dynamic Web Project. The web app has has an #Entity bean and a #Stateless bean. The #Stateless is being injected to a servlet (using #EJB). Here's my persistence.xml:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
<persistence-unit name="ContactBookPersistUnit" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/MySqlDS</jta-data-source>
<class>com.contact.model.Contact</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
What could I be doing wrong?
Caused by: javax.resource.ResourceException: Unable to get managed connection for MySqlDS
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
... 65 more
Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.mysql.jdbc.Driver; - nested throwable: (java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from BaseClassLoader#262b2310{VFSClassLoaderPolicy#5a0b0303{name=vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/ domain=ClassLoaderDomain#5e33f929{name=vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/ parentPolicy=AFTER_BUT_JAVA_BEFORE parent=BaseClassLoader#7cdd93a5{vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/}} roots=[ZipEntryHandler#150136868[path=ContactBook.ear/ContactBookWeb.war/WEB-INF/classes context=file:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ real=file:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/WEB-INF/classes]] delegates=null exported=[, com.contact.servlet, com.contact.service, com.contact.model, com.contact.control, META-INF] <IMPORT-ALL>NON_EMPTY}}))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
... 69 more
Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: com.mysql.jdbc.Driver; - nested throwable: (java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from BaseClassLoader#262b2310{VFSClassLoaderPolicy#5a0b0303{name=vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/ domain=ClassLoaderDomain#5e33f929{name=vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/ parentPolicy=AFTER_BUT_JAVA_BEFORE parent=BaseClassLoader#7cdd93a5{vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/}} roots=[ZipEntryHandler#150136868[path=ContactBook.ear/ContactBookWeb.war/WEB-INF/classes context=file:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ real=file:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/WEB-INF/classes]] delegates=null exported=[, com.contact.servlet, com.contact.service, com.contact.model, com.contact.control, META-INF] <IMPORT-ALL>NON_EMPTY}})
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:489)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:206)
... 74 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from BaseClassLoader#262b2310{VFSClassLoaderPolicy#5a0b0303{name=vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/ domain=ClassLoaderDomain#5e33f929{name=vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/ parentPolicy=AFTER_BUT_JAVA_BEFORE parent=BaseClassLoader#7cdd93a5{vfszip:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/}} roots=[ZipEntryHandler#150136868[path=ContactBook.ear/ContactBookWeb.war/WEB-INF/classes context=file:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ real=file:/Users/Albert/DEV/Servers/JBoss5/server/default/deploy/ContactBook.ear/ContactBookWeb.war/WEB-INF/classes]] delegates=null exported=[, com.contact.servlet, com.contact.service, com.contact.model, com.contact.control, META-INF] <IMPORT-ALL>NON_EMPTY}}
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:474)
This bit of documentation says you need to add the JAR to the /lib file in your default server configuration:
http://docs.jboss.org/jbossas/getting_started/v4/html/db.html
UPDATE: JBOSS 6 and newer has been rewritten to be more modular. You have to add JBDC drivers to your /module directory.