-->
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.  [ 2 posts ] 
Author Message
 Post subject: Server configuration denies access to data source
PostPosted: Wed May 26, 2004 7:13 am 
Newbie

Joined: Tue May 11, 2004 4:44 am
Posts: 5
Hi,
I've run into wierd problems trying to get hibernate to work on my linux machine. The mysql version i'm using is 4.0.18 and the mysql server is running on a network. Can anyone tell me what this message means ?

Server configuration denies access to data source

Here's my hiberbate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>

<session-factory name="java:comp/env/hibernate/SessionFactory">

<!-- properties -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://mynetworkmachine:3306/weblog</property>
<property name="hibernate.connection.username">weblog</property>
<property name="hibernate.connection.password">weblog</property>
<property name="hibernate.connection.pool_size">4</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>

<!-- mapping files -->
<mapping resource="org/weblog/user/Users.hbm.xml"/>
<mapping resource="org/weblog/user/Permissions.hbm.xml"/>
<mapping resource="org/weblog/user/Groups.hbm.xml"/>
<mapping resource="org/weblog/user/UserGroups.hbm.xml"/>
<mapping resource="org/weblog/user/GroupPermissions.hbm.xml"/>
<!-- <mapping resource="org/weblog/blog/Articles.hbm.xml"/>-->
<!-- <mapping resource="org/weblog/blog/Submissions.hbm.xml"/>-->

</session-factory>
</hibernate-configuration>


Here's the output when i run a program that creates the db schema on mysql.

/opt/j2sdk1.4.1_01/bin/java -classpath /opt/j2sdk1.4.1_01/jre/lib/sunrsasign.jar:/opt/j2sdk1.4.1_01/jre/lib/jce.jar:/opt/j2sdk1.4.1_01/jre/lib/jsse.jar:/opt/j2sdk1.4.1_01/jre/lib/charsets.jar:/opt/j2sdk1.4.1_01/jre/lib/javaplugin.jar:/opt/j2sdk1.4.1_01/jre/lib/rt.jar:/opt/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar:/opt/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar:/opt/j2sdk1.4.1_01/jre/lib/ext/localedata.jar:/opt/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar:/opt/j2sdk1.4.1_01/jre/lib/ext/lucene-1.2.jar:/usr/local/weblog/weblogWeb/web-inf/classes:/usr/local/weblog/lib/mysql-connector-java-3.0.8-stable-bin.jar:/usr/local/weblog/lib/hibernate2.jar:/usr/local/weblog/lib/cglib-asm.jar:/usr/local/weblog/lib/commons-beanutils.jar:/usr/local/weblog/lib/commons-collections.jar:/usr/local/weblog/lib/commons-dbcp.jar:/usr/local/weblog/lib/commons-digester-1.5.jar:/usr/local/weblog/lib/commons-lang.jar:/usr/local/weblog/lib/commons-logging.jar:/usr/local/weblog/lib/commons-pool.jar:/usr/local/weblog/lib/dom4j.jar:/usr/local/weblog/lib/jndi.jar:/usr/local/weblog/lib/odmg.jar:/usr/local/weblog/lib/xml-apis.jar:/usr/local/weblog/src:/usr/local/jakarta-tomcat-5.0.4/common/lib/servlet-api.jar org.weblog.user.Users
May 26, 2004 4:39:38 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.3
May 26, 2004 4:39:38 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
May 26, 2004 4:39:38 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
May 26, 2004 4:39:38 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: JVM proxy support: true
May 26, 2004 4:39:38 PM net.sf.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
May 26, 2004 4:39:39 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: org/weblog/user/Users.hbm.xml
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.weblog.user.Users -> weblog_users
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: org/weblog/user/Permissions.hbm.xml
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.weblog.user.Permissions -> weblog_permissions
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: org/weblog/user/Groups.hbm.xml
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.weblog.user.Groups -> weblog_groups
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: org/weblog/user/UserGroups.hbm.xml
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.weblog.user.UserGroups -> weblog_usergroups
May 26, 2004 4:39:40 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: org/weblog/user/GroupPermissions.hbm.xml
May 26, 2004 4:39:41 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.weblog.user.GroupPermissions -> weblog_grouppermissions
May 26, 2004 4:39:41 PM net.sf.hibernate.cfg.Configuration configure
INFO: Configured SessionFactory: null
May 26, 2004 4:39:41 PM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.MySQLDialect
May 26, 2004 4:39:41 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 4
May 26, 2004 4:39:41 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/weblog
May 26, 2004 4:39:41 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=}
May 26, 2004 4:39:41 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: 08001
May 26, 2004 4:39:41 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Server configuration denies access to data source
java.sql.SQLException: Server configuration denies access to data source
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:399)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
at com.mysql.jdbc.Connection.<init>(Connection.java:491)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:93)
at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:93)
at org.weblog.user.Users.createSchema(Users.java:98)
at org.weblog.user.Users.main(Users.java:343)
rethrown as net.sf.hibernate.HibernateException: could not get database metadata: Server configuration denies access to data source
at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:100)
at org.weblog.user.Users.createSchema(Users.java:98)
at org.weblog.user.Users.main(Users.java:343)
Caused by: java.sql.SQLException: Server configuration denies access to data source
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:399)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
at com.mysql.jdbc.Connection.<init>(Connection.java:491)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:93)
at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:93)
... 2 more
Process terminated with exit code 0

Thanks in advance,
Nilesh
[code][/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 26, 2004 7:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Not a Hibernate Problem. Most likely you don't have mysql listening to network connections. Try to get it to work with plain JDBC first, and take this to a mysql forum if you cant


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.