cancel
Showing results for 
Search instead for 
Did you mean: 

PROBLEM: Could not obtain connection metadata

hr61369256
Champ in-the-making
Champ in-the-making
Hi ,
I'm working with alfresco since 2006 and solved a lot of problems on my own … but now I tried all (what I knew as possible causes) … I have no more idea.

I installed release 3.4e with MySQL under Ubuntu 10.10 (with tomcat). I double checked the database connection, the database rights for user alfresco for database alfresco34e … seems all OK. I'm using "mysql-connector-java-5.1.18-bin" … I've made the corresponding settings in alfresco-global.properties:

——————————————————————
dir.root=/opt/Alfresco/alfresco34e/alf_data

web.application.context.url=http://127.0.0.1:8080/alfresco

### database connection properties ###
db.name=alfresco34e
db.username=alfresco
db.password=<password>
db.host=127.0.0.1
db.port=3306
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://127.0.0.1:3306/alfresco34e?useUnicode=yes&characterEncoding=UTF-8
——————————————————————

In alfresco.log I received a Warning and a Error, which I posted as followed in short form:

——————————————————————
23:13:41,498 WARN  [org.hibernate.cfg.SettingsFactory] Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
   at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
   at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
   at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)

——————————————————————

——————————————————————
23:13:41,537 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RepoServerMgmt' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'transactionService' while setting bean property 'transactionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

——————————————————————

Any ideas? Thank you.
14 REPLIES 14

hr61369256
Champ in-the-making
Champ in-the-making
… it would be really kind if someone could help me out here.
As additional info: in my case, no database tables were created …
Thanks, Ralf

t_sato
Champ in-the-making
Champ in-the-making
Hi,

This is typically caused either by:

1. A failure connectting to a database(not via socket, but through networking)
2. A stale pooled connection

I assume you made sure about 1.

For 2, "validationQuery" is the one to test its validation(see configuration details).  In Alfresco, db.pool.validate.query is the one. You can see some examples on the wiki.

darkmstr
Champ in-the-making
Champ in-the-making
The only thing I can tell you is that I had the same problem and at the end it was because of a host problem.
In /ALFR_ROOT/tomcat/logs/catalina.out
when I started the server it showed me an error about the domain wasn't recognized. I just added the domain they showed me in /etc/hosts and that was it.

mrogers
Star Contributor
Star Contributor
I still wonder about your database configuration: Here's a create script I used earlier today so I know it works.
substitute your database name (alfresco34e) and account name (alfresco).

create database alf_fourone DEFAULT CHARACTER SET utf8;
grant all on alf_fourone.* to 'alf_fourone'@'localhost' identified by 'alf_fourone' with grant option;
grant all on alf_fourone.* to 'alf_fourone'@'localhost.localdomain' identified by 'alf_fourone' with grant option;

darkmstr
Champ in-the-making
Champ in-the-making
For me that wasn't the problem, it just didn't fill up the db, the tables and everything was ok.