cancel
Showing results for 
Search instead for 
Did you mean: 

PostgreSQL / Existing Tomcat Install Issue

jazzcat
Champ in-the-making
Champ in-the-making
Greetings,

I'm having problems installing Alfresco on an existing Tomcat 5.5.14 installation.

I have followed the instructions on this thread,

http://www.alfresco.org/forums/viewtopic.php?t=116

with the caveat that the hibernate-context.xml file did not contain the Dialect specs, instead it was in the domain/hibernate-cfg.properties file.

After modifying those files, I created the WAR file and deployed it under webapps of my tomcat server by restartng the sever.  The alfresco app did not start.  Instead, in the catalina.out file, it gave the following output:

INFO: Deploying web application archive alfresco-ll.war
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'descriptorComponent' defined in class path resource [alfresco/application-context.xml]: Can't resolve reference to bean 'systemBootstrap' while setting property 'systemBootstrap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:265)
12:15:22,557 ERROR [[Catalina].[localhost].[/alfresco-ll]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'descriptorComponent' defined in class path resource [alfresco/application-context.xml]: Can't resolve reference to bean 'systemBootstrap' while setting property 'systemBootstrap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:265)
12:15:22,578 ERROR [[Catalina].[localhost].[/alfresco-ll]] Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'descriptorComponent' defined in class path resource [alfresco/application-context.xml]: Can't resolve reference to bean 'systemBootstrap' while setting property 'systemBootstrap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.

Does anyone know what might be going on?  Why can't it create the systemBootstrap bean??  The database exists and can be connected to.
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
Although you say the database exists and can be connected to it does seem like there is an issue with the database as you are getting the following exception:

org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection


Have you placed the MySQL driver in the tomcat/common/lib? If you have done that have you tried connecting to the database as alfresco/alfresco?

jazzcat
Champ in-the-making
Champ in-the-making
Do I need the MySQL driver even though I'm using PG?

I downloaded the PG JDBC driver and put it under {tomcat_root}common/lib; then I restarted Tomcat.

In the catalina.out file, I get this message now:

Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresqlDriver'…
…Caused by: java.lang.ClassNotFoundException: org.postgresqlDriver

I also explicitly added the {tomcat_root}/common/lib directory to the normal JAVA CLASSPATH for my user account.

I'm going to go visit a PostgreSQL JDBC list, but is there anything else from an alfresco point of view that I need to do to let it know to load the driver?

Thanks,
-Josh

steve
Champ in-the-making
Champ in-the-making
Hello,

I believe PostgreSQL changed it's class structure for it's JDBC driver at some point, it might be worth checking you have the most up-to-date version, or if you are running an old PostgreSQL version then check your hibernate mappings:

If You are running an older version of JDBC, the driver name may be wrong. Version 6.5 and lower use "postgresql.Driver", and later versions use "org.postgresql.Driver".

Steve

arnab
Champ in-the-making
Champ in-the-making
Please note that if you are running PostgreSql Server on the default port then a slight modification is required to the settings instructions that have been posted in this url: 
http://www.alfresco.org/forums/viewtopic.php?t=23

The settings in respository.properties should look like this:

# Database configuration

db.driver=org.postgresql.Driver
db.name=alfresco
db.url=jdbcSmiley Tongueostgresql://localhost:5432/${db.name}
db.username=alfresco
db.password=alfresco

Note the port number (5432 default) that has been appended to the db url

The 3 drivers that I am using are:
1. pg80b1.308.jdbc2.jar
2. pg80b1.308.jdbc2ee.jar
3. pg80b1.308.jdbc3.jar
These can be found in C:\Program Files\PostgreSQL\8.0\jdbc directory (ie. the jdbc directory in your Postgres installation).

Hope that helps.

Cheers

-Arnab