Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could not load com.mysql.jdbc.SQLError

 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am developing Jsf 1.2 application using mysql database, deployed using jboss 4 Application Server , the application works fine without any bugs but I have found the following error in jboss logs

BTW , the same error is displayed so many times in jboss logs (note that this error does not effect the working of the application)

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently you are wrong about the "without any bugs" part.

I can't really tell what is wrong, except that it almost certainly has nothing to do with JSF. The two most likely causes I can think of are these:

1. You are using JDBC connection objects but not properly releasing them in one or more webapps.

2. You are spawning threads that use JDBC in a way that violates the JEE restrictions on threading.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply ,

here is some of my code for dealing with database









 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than



Try:

 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James Boswell for your reply ,

1. session.endTransaction();

No such method , the nearest method to your suggested method is


I have replaced



with



but it is the same error as well as new error
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What directory is your MySQL driver jar in?
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim Holloway

What directory is your MySQL driver jar in?


I am using maven , mysql jar locates in the directory
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That didn't help. Maven won't be available when you run the app in production, nor will your IDE. I need to know where the driver jar was installed in your web application server.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim Holloway for your reply ,

I need to know where the driver jar was installed in your web application server

I have local jboss application server 4.2 , mysql 5 , so everything (jboss application server , mysql database server , ....etc) is running locally in the same machine
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh Khant wrote:Thanks Tim Holloway for your reply ,

I need to know where the driver jar was installed in your web application server

I have local jboss application server 4.2 , mysql 5 , so everything (jboss application server , mysql database server , ....etc) is running locally in the same machine


It doesn't matter what machines are being used. What matters is that JBoss does not come with database drivers. You have to manually install whatever database drivers you'll be using. If you install them in the wrong place, it can cause problems. I have a strong suspicion that that is what is wrong here.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim Holloway for your reply ,
You have to manually install whatever database drivers you'll be using. If you install them in the wrong place

How to install database drivers ? do you mean adding the mysql jar file to the build path ? what is the right place for installation it ?

Your help, support and reply is really appreciated
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The build path does not exist when a production server runs. It only exists when the application is being built.

You have some basic things to learn about JBoss and how it interacts with databases. They have nothing to do with JSF, so I'm going to move this thread over to the JBoss forum.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim is right - there's a difference between build time environment of an application and the runtime environment of an application. As for the question about where to place the JDBC driver jar(s), it should go in JBOSS_HOME/server/<servername>/lib folder.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jaikiran Pai for your reply,
I have copied mysql jar file into JBOSS_HOME/server/messaging/lib but am still getting the same error
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the suggestions are appreciated
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh Khant wrote:
I have copied mysql jar file into JBOSS_HOME/server/messaging/lib but am still getting the same error


What command do you use to start the server and please post the entire exception stacktrace that you see after copying that driver jar to that location.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jaikiran Pai for you reply,

What command do you use to start the server and please post the entire exception stacktrace that you see after copying that driver jar to that location.



I am starting jboss server from eclipse ,

Everything goes correctly after copying that driver jar to that location.(no error)

the error will be generated after long time of deploying (sometimes after one hour of deployment)

I have already post the stacktrace in my first post

Thaking you in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic