Error in connecting Mysql in JBoss

I am trying to implement CMP entity bean with JBoss 4.0.1. I have followed all the instruction from an article http://www.developer.com/java/ent/article.php/10933_3405781_3

I am using MySQL 4. While deploying the bean I am getting an error :

java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user: 'x@localhost' (Using password: YES)" at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1906)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:954)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1786)
        at com.mysql.jdbc.Connection.<init>(Connection.java:450)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:411)
................

My configuration file mysql-ds.xml is like this:

<datasources>
   <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/jbossdb
         </connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>userjboss</user-name>
      <password>zzz</password>
      </local-tx-datasource>
</datasources>

With the userjboss i am able to connect mysql from command prompt then what could be the problem in jboss.

And is it possible to use msAccess instead of mysql to implement CMP bean???
pls help

thanks


vblovebugAsked:
Who is Participating?
 
vkathiravanConnect With a Mentor Commented:
Hello,

   Probably the error may be due to NOT granting privillages for that particular user (userjboss) in MySQL.

     You have to run following command in MySql as a root user ( or any privillaged user to run this command),
 
 GRANT ALL PRIVILEGES ON jbossdb.* TO userjboss@localhost IDENTIFIED BY 'zzz' WITH GRANT OPTION;

      Now restart Jboss server. Make sure that you have placed the correct mysql-connector-j jar file (http://dev.mysql.com/downloads/connector/j/ ) in correct jboss configuration directory.

      ie. if you want to run jboss in default configure option, you have to place that mysql driver jar file in <JBoss-Server>/server/default/lib directory.

      Hope this will get rid of this error.

Regards,
Kathir
0
 
msinanCommented:
Have you checked for the latest released provider of mySql?
0
 
rama_krishna580Commented:
Hi,

The solution often suggested is to GRANT access privileges on a per-database-level. Some solutions even suggest editing the mysql tables directly. The whole thing is a bit too mysterious for my taste. The Tomcat developers should probably think of having a resolution for this problem on their website.

If you grant privileges on a TABLE level instead of a DATABASE level, for some strange reason, the access is given.

Example:
GRANT SELECT, INSERT, UPDATE, DELETE ON somedatabase.sometable TO someuser IDENTIFIED BY 'somepass';

R.K
0
Managing Security Policy in a Changing Environment

The enterprise network environment is evolving rapidly as companies extend their physical data centers to embrace cloud computing and software-defined networking. This new reality means that the challenge of managing the security policy is much more dynamic and complex.

 
rama_krishna580Commented:
My Solution also supports the problem , bcz its under database level checking also needed !

R.K
0
 
VenabiliCommented:
rama_krishna580,

:) Yes. The problem is that it is more than 2 months after ANY comment here. usually after this time the Asker do not really need the solution and the cleanup do not award points on late answers except when the Asker had returned after this...
0
 
rama_krishna580Commented:
Ok no problem ! Thank you !

I want to congratulate you for doing great job here as moderator/Page Editor and giving prompt responses ! Really appreciate your effort and time !

Best of luck Venavili!

R.K
0
All Courses

From novice to tech pro — start learning today.