LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2013, 01:56 AM   #1
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Rep: Reputation: Disabled
Unable to connect mysql database in Jboss AS 7


Hi ,
I am trying deploy a java servlet with hibernate connector into Jboss AS 7.I am trying add mysql datasource as module to Jboss AS7.

I followed this article for configuration:
https://community.jboss.org/thread/198129

my files look like this:

Created module.xml in $JBOSS_HOME/modules/com/mysql/main/
module.xml:

Code:
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
   <resources>
     <resource-root path="mysql-connector-java-5.1.25-bin.jar"/>

   </resources> 

   <dependencies>
      <module name="javax.api"/>
    </dependencies>
</module>
And i copied mysql-connector-java-5.1.25-bin.jar to $JBOSS_HOME/modules/com/mysql/main

I modified standalone.xml like this :
Code:
</datasource>
                <datasource jta="true" jndi-name="java:/MySqlDS" pool-name="MySqlDS_Pool" enabled="true" use-java-context="true" use-ccm="true">
                    <connection-url>jdbc:mysql://localhost:3306/mydb-name</connection-url>
                    <driver>com.mysql</driver>
                    <security>
                        <user-name>root</user-name>
                        <password>mydb-password</password>
                    </security>
                    <timeout>
                        <idle-timeout-minutes>0</idle-timeout-minutes>
                        <query-timeout>600</query-timeout>
                    </timeout>
                    <statement>
                        <prepared-statement-cache-size>100</prepared-statement-cache-size>
                        <share-prepared-statements>true</share-prepared-statements>
                    </statement>
                </datasource>
And added mysql driver in <driver> element

Code:
<driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                    </driver>
When i start the Jboss server i get the following error:

Quote:
New missing/unsatisfied dependencies:
service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:jboss/datasources/MySqlDS]
My configuration details :

Server : RHEL 5.9
JDK version : 7
JBOSS version : AS 7.1.1 Final
Hibernate version : 3
Mysql version : 5.5
Mysql-connector version : 5.1.25

Any help would be greatly appreciated...
 
Old 08-04-2013, 10:56 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,609

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Quote:
Originally Posted by mlnm View Post
Hi ,
I am trying deploy a java servlet with hibernate connector into Jboss AS 7.I am trying add mysql datasource as module to Jboss AS7.

Code:
<driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>                   </driver>
When i start the Jboss server i get the following error:

My configuration details :

Server : RHEL 5.9
JDK version : 7
JBOSS version : AS 7.1.1 Final
Hibernate version : 3
Mysql version : 5.5
Mysql-connector version : 5.1.25

Any help would be greatly appreciated...
Did you read the message, where it tells you that you have a missing dependency? Did you try to look the error up on the Jboss forum, where that exact message is, along with several possible solutions?
https://community.jboss.org/message/621516

..or Google?
http://stackoverflow.com/questions/1...ure-datasource

You've not installed/enabled the MySQL connector. And have you contacted Red Hat support, since you're paying for RHEL, right???
 
Old 08-04-2013, 10:56 PM   #3
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
First of all thank you TB0ne for taking time.I have gone through a lot of articles from both Google and Jboss community forums but, any of them didn't work.When i checked datasource from Jboss Admin console it shows as enabled.As i posted,you can see that i downloaded the latest mysql-connector and copied it and followed everything according to the tutorials but still got the same error.It would be great if you could check my configuration files and tell me if i am doing anything wrong with the configuration.Thanks again.
 
Old 08-05-2013, 08:25 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,609

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Quote:
Originally Posted by mlnm View Post
First of all thank you TB0ne for taking time.I have gone through a lot of articles from both Google and Jboss community forums but, any of them didn't work.
How about telling us which ones you tried, and what you mean by "didn't work"??? Giving us no information about what you've done tells us nothing.
Quote:
When i checked datasource from Jboss Admin console it shows as enabled.As i posted,you can see that i downloaded the latest mysql-connector and copied it and followed everything according to the tutorials but still got the same error.It would be great if you could check my configuration files and tell me if i am doing anything wrong with the configuration.
Since you're not able to get connected you are quite obviously doing something wrong. And the link you posted in your first thread isn't a tutorial or installation guide....but someone who cannot get the connection to work, and they're asking for help.

What installation guide/how-to did you follow to perform the installation? Again, the links I posted to you first tell you about the error, offer solutions, and even point you to official guides, like this:
https://community.jboss.org/wiki/Dat...igurationInAS7

And again...have you contacted Red Hat support yet???
 
Old 08-06-2013, 12:10 AM   #5
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
1. In my first post i mentioned that i followed this article from Jboss community forums https://community.jboss.org/thread/198129.

2. Red hat support is not available because we have not subscribed yet but will do very shortly.

3. Now what i have done is installed Jboss AS 7 freshly and configured datasource for Mysql but not added it as a module.Simply i deployed the
mysql-connector-java-5.1.25-bin.jar file and enabled it.And then from the again from the Jboss Admin console i added mysql datasource and enabled it.And i tested connection from Admin console it was successful.So now i am not getting missing/unsatisfied dependencies error any more.
But when i deploy the war file i get this error:

Quote:
0:35:02,804 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
10:35:03,029 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
10:35:03,092 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
10:35:04,783 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
10:35:04,784 INFO [org.xnio] XNIO Version 3.0.3.GA
10:35:04,857 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
10:35:04,875 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
10:35:04,909 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
10:35:04,914 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
10:35:04,998 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
10:35:05,037 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
10:35:05,037 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
10:35:05,050 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
10:35:05,121 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
10:35:05,372 INFO [org.jboss.as.security] (MSC service thread 1-1) JBAS013100: Current PicketBox version=4.0.7.Final
10:35:05,824 INFO [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
10:35:06,105 INFO [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
10:35:06,279 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]
10:35:06,825 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
10:35:08,251 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080
10:35:09,536 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA
10:35:10,341 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
10:35:10,355 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "mysql-connector-java-5.1.25-bin.jar"
10:35:10,358 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.1.Final\standalone\deployments
10:35:10,416 INFO [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on localhost/127.0.0.1:4447
10:35:10,419 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:9999
10:35:10,932 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found Pengine.war in deployment directory. To trigger deployment create a file called Pengine.war.dodeploy
10:35:11,514 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
10:35:11,553 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/myds]
10:35:11,633 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "mysql-connector-java-5.1.25-bin.jar"
10:35:11,640 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "Pengine.war"
10:35:12,979 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry commons-fileupload.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/Pengine.war/WEB-INF/lib/struts.jar" does not point to a valid jar for a Class-Path reference.
10:35:12,980 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry commons-validator.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/Pengine.war/WEB-INF/lib/struts.jar" does not point to a valid jar for a Class-Path reference.
10:35:12,981 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jakarta-oro.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/Pengine.war/WEB-INF/lib/struts.jar" does not point to a valid jar for a Class-Path reference.
10:35:13,803 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."Pengine.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Pengine.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "Pengine.war"
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_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.apache.struts.taglib.html.JavascriptValidatorTag with ClassLoader ModuleClassLoader for Module "deployment.Pengine.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionI ndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAgg regator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnno tationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(Intercepto rAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProce ssor.java:55)
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
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/validator/ValidatorResources
at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.7.0_03]
at java.lang.Class.privateGetDeclaredMethods(Unknown Source) [rt.jar:1.7.0_03]
at java.lang.Class.getDeclaredMethods(Unknown Source) [rt.jar:1.7.0_03]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionI ndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.validator.ValidatorResources from [Module "deployment.Pengine.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 15 more

10:35:13,818 INFO [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990
10:35:13,819 ERROR [org.jboss.as] (MSC service thread 1-1) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 11476ms - Started 164 of 245 services (1 services failed or missing dependencies, 78 services are passive or on-demand)
10:35:13,819 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "Pengine.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"Pengine.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"Pengine.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"Pengine.war\""}}
10:35:13,867 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment Pengine.war in 47ms
10:35:13,868 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."Pengine.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Pengine.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "Pengine.war"

10:35:13,870 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.\"Pengine.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"Pengine.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"Pengine.war\""}}}}
Note :Pengine.war is my Project war file
 
Old 08-06-2013, 08:30 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,609

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Quote:
Originally Posted by mlnm View Post
1. In my first post i mentioned that i followed this article from Jboss community forums https://community.jboss.org/thread/198129.
Right...which is NOT an installation/configuration guide, but a question someone had because they had problems.
Quote:
2. Red hat support is not available because we have not subscribed yet but will do very shortly.
Well, if you're going to pay for support, why not do it right now? They can sign you up over the phone, and you can get immediate help.
Quote:
3. Now what i have done is installed Jboss AS 7 freshly and configured datasource for Mysql but not added it as a module.Simply i deployed the
mysql-connector-java-5.1.25-bin.jar file and enabled it.And then from the again from the Jboss Admin console i added mysql datasource and enabled it.And i tested connection from Admin console it was successful.So now i am not getting missing/unsatisfied dependencies error any more.
But when i deploy the war file i get this error:
Code:
10:35:13,803 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."Pengine.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Pengine.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "Pengine.war"
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_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]
Note :Pengine.war is my Project war file
Ok...so you have a problem in the pengine.war program. If you put the error you got into Google, or looked at the Jboss forums, you'd find solutions/hints to solving the problem:
https://community.jboss.org/message/804553
https://community.jboss.org/thread/223180
https://community.jboss.org/thread/222887
https://community.jboss.org/message/804794

Again, unless you completely follow the instructions on installing the MySQL source, you may have issues.
https://community.jboss.org/wiki/Dat...er_as_a_module
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Urgent] Cannot connect to MySQL database arvigeus Linux - Newbie 6 08-27-2011 12:34 AM
LXer: Deployment Seam Application against MySQL 5 database to Jboss 4.0.5 utilizing Seam Plugin for NetBeans 5.5.1 LXer Syndicated Linux News 0 06-30-2007 01:16 AM
cannot connect to mysql database PAD_LOCK Programming 5 09-01-2006 02:03 PM
Unable to connect to (working) mySQL database rcs1000 Linux - Software 1 10-16-2005 07:23 AM
cannot connect to mysql database mrosati Linux - Software 19 07-15-2004 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration