cancel
Showing results for 
Search instead for 
Did you mean: 

Fresh community 3.4 WAR install fails to start

cgr
Champ in-the-making
Champ in-the-making
I've looked through these forums and haven't found a topic that exactly describes the problem I'm running into.

I have installed alfresco-community-3.4.d.zip on Red Hat Enterprise Linux Server release 5.5, with Sun JDK 6, Tomcat 6 and mysql-connector-java-5.1.15-bin.jar.  Alfresco fails to start.  It looks as if the error is because Alfresco can't communicate with the database server.  The server is running MySQL 5.0.77 (stock RHEL RPM install) on a different RHEL server.  I'm able to connect to the remote MySQL server as the Alfresco user via a MySQL command-line client.

Here is the Alfresco config file snippet (from $TOMCAT_HOME/classes/alfresco-global.properties):

db.username=alfresco
db.password=_my_alfresco_user_pwd
db.pool.initial=10
db.pool.max=100
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://192.168.0.42/alfresco?useUnicode=yes&characterEncoding=UTF-8

The alfresco log file is 2127 lines long–here is a part showing the db connection failing:

   .
   .
   .
   .
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:50)
        at $Proxy5.setAutoCommit(Unknown Source)
        at org.alfresco.hibernate.DialectFactoryBean.getObject(DialectFactoryBean.java:71)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:143)
        … 158 more
Caused by: 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)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
        … 163 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1118)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2308)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2122)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
        … 166 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
        at java.net.Socket.connect(Socket.java:546)
        at java.net.Socket.connect(Socket.java:495)
        at java.net.Socket.<init>(Socket.java:392)
        at java.net.Socket.<init>(Socket.java:235)
        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
        … 181 more

I've verified the datbase name and password, and have logged in to the MySQL server from the Alfresco server as the Alfresco user.  The Alfresco database exists, and the Alfresco user's password gives access to the database.

How do I debug the connection problem?

Thanks,
Carl
1 REPLY 1

cgr
Champ in-the-making
Champ in-the-making
This is fixed.  I had a typo in the MySQL server IP address–cut and paste error.  Once that was fixed I could connect to the Alfresco server on localhost:8080/alfresco.

I then had to modify this file:
  /etc/httpd/conf/httpd.conf
to allow connections from anywhere else.  Here are the diffs for that change:
===================================================================
RCS file: RCS/httpd.conf,v
retrieving revision 1.4
diff -r1.4 httpd.conf
966a967,978
> # set up this proxy configuration for Alfresco
> # cgr
> # 29 Apr 2011
> ProxyRequests Off
> ProxyPass /alfresco http://localhost:8080/alfresco
> ProxyPassReverse /alfresco http://localhost:8080/alfresco
> ProxyPreserveHost On
> ProxyRequests Off
> ProxyPass /share http://localhost:8080/share
> ProxyPassReverse /share http://localhost:8080/share
> ProxyPreserveHost On
>

Onward and upward…..

Carl