?
Solved

Error in connecting Mysql in JBoss

Posted on 2005-03-03
8
Medium Priority
?
634 Views
Last Modified: 2012-05-05
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


0
Comment
Question by:vblovebug
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Expert Comment

by:msinan
ID: 13610733
Have you checked for the latest released provider of mySql?
0
 

Accepted Solution

by:
vkathiravan earned 400 total points
ID: 13610934
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
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 14105837
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
The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

 
LVL 23

Expert Comment

by:rama_krishna580
ID: 14327296
My Solution also supports the problem , bcz its under database level checking also needed !

R.K
0
 
LVL 20

Expert Comment

by:Venabili
ID: 14327330
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
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 14327376
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

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question