Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql connectivity with jboss

 
archie gall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am working on one project for which i am using eclipse(helios) ,jboss(jboss-5.0.1-GA) as server and mysql(Microsoft SQL Server 2005) as database.
When i am trying to connect to database i am getting following error:

12:58:56,578 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
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..........

i tried every possible alternative to solve this error.. replace hsql-ds.xml with mysql-ds.xml.

Please help on this.
Its very urgent.

Thanks in advance.

Waiting for your reply.
Reply soon

Regards,
Archie
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post your datasource, or your url connection?

ps.: welcome to javaranch. [=
 
archie gall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hebert,

Thanks for replying.

Please find the below code of my "mysql-ds.xml":

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/ProjectDB</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>sa</user-name>
<password>archana</password>
</local-tx-datasource>
</datasources>
 
archie gall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is my connection class. Please let me know if I am doing anything wrong in this class file.

 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Archie!
Can you please UseCodeTags next time? See how much better your code looks with them.

archie gall wrote:12:58:56,578 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
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..........

There is probably no error in your code. What this error says is that the MySQL driver is missing from the class path - that's the ClassNotFoundException you're seeing.

Its very urgent.
...
Reply soon

Please EaseUp. There is no such thing as urgent around here.

archie gall wrote:

Never ever ever ever do that. If an exception occurs you won't even know it, and you'll be asking yourself why things are going wrong. The least you should do is print the exception; not with System.out.println the way you are doing at other points but with e.printStackTrace(). This will not only show you the exception itself, but also the path leading up to it. This will help you find the cause.
 
archie gall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But what can be the reason for getting following error:

Caused by: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable:

this is the first time i using jboss and mysql....

so dont have much idea...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic