-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Access denied error using Hibernate and MYSQL
PostPosted: Tue Oct 18, 2005 11:21 pm 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
Hi Everbody,

I am using Hibernate3.0 and MYSQl (version 5.02 alpha nt)as DB. While starting tomcat serevr I get following error message :





Oct 19, 2005 9:07:43 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://192.168.253.10:3306/retailpc
Oct 19, 2005 9:07:43 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=retailpc , password=****}
Oct 19, 2005 9:07:44 AM org.hibernate.cfg.SettingsFactory buildSettings
WARNING: Could not obtain connection metadata
java.sql.SQLException: Access denied for user 'retailpc '@'192.168.253.21' (using password: YES)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3647)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2544)
at com.mysql.jdbc.Connection.<init>(Connection.java:1474)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at utilities.HibernateUtil.<clinit>(Unknown Source)
at com.transending.TransendingStartup.initialize(Unknown Source)
at com.transending.TransendingStartup.init(Unknown Source)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Oct 19, 2005 9:07:44 AM org.hibernate.dialect.Dialect <init>



Entry in hibernate.properties


hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url =jdbc:mysql://192.168.253.10:3306/retailpc
hibernate.connection.username = retailpc
hibernate.connection.password = retailpc_dev


I checked my MYSQL permission, all grant is assigned to the user. I am able to generate Java class and hbm.xml file using middlegen. When I try to connect same database using java "connection" object and sql , I am able to make it but somehow this error is comming. Please help me to sort out this bug. Thanks in advance

Thanks
Vikram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 1:18 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
the red stuff has password = YES, the blue stuff has a password of retailpc_dev .


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 1:26 am 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
dennisbyrne wrote:
the red stuff has password = YES, the blue stuff has a password of retailpc_dev .


Thanks for reply, red stuff "password = YES " means that this require password, if it is No than password is not required

Thanks
Vikram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 2:42 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
is the web server on the same machine as the one you used middlegen w/ ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 2:44 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
there also appears to be a space after the username in the logging output.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 2:45 am 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
Yes webserevr(Tomcat/5.0.28) is on the same machine as the middlegen.

Thanks
Vikram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 2:52 am 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
dennisbyrne wrote:
there also appears to be a space after the username in the logging output.



In this line ?

java.sql.SQLException: Access denied for user 'retailpc '@'192.168.253.21' (using password: YES)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 3:16 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
yes, there is a space. is this your problem?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:31 am 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
dennisbyrne wrote:
yes, there is a space. is this your problem?


Hi Dnnis,

It does not seems to be problem....


Thanks
Vikram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:55 am 
Newbie

Joined: Sat Jul 23, 2005 8:31 am
Posts: 18
try
jdbc:mysql://localhost:3306/retailpc
instead of
jdbc:mysql://192.168.253.10:3306/retailpc


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 5:11 am 
Newbie

Joined: Sat Jul 30, 2005 7:44 am
Posts: 15
Hi chirigi,

Thanks for reply, actually my DB server is on remote machine, so I have to give remote address.

Vikram


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.