cancel
Showing results for 
Search instead for 
Did you mean: 

The database is empty

peppelinux
Champ in-the-making
Champ in-the-making
Hello I have a problem. I installed Alfresco-Labs-3Stable-Linux-x86-Install and I have a mysql installed in my linux red-hat. I run the installation script and the result is good but the dababase remains empty. When I prove to run alfresco I receive an exception in the log file, this exception is obviously caused by the lack of the tables.
I create the db with the script db_setup.sql

create database alfresco default character set utf8;
grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

Who should fills the database? The installer doesn't do it, I don't know which script fills the db.
Anybody can help me?
Thanks
6 REPLIES 6

mrogers
Star Contributor
Star Contributor
Alfresco will initialise the database itself as part of its bootstrap.

There is probably an error in your alfresco configuration such that alfresco fails to connect to your mySql database.    Take a look at your alfresco log for more information.    

Your error is likely to be that you have not configured your repository.properties correctly.

You need to set the following properties.
db.password
db.username
db.driver
db.url

mikeh
Star Contributor
Star Contributor
Alfresco fills the database on first bootstrap.

Please post the contents of the log file with the full exception. It's likely to be either a missing mysql connector jar, or perhaps a local firewall blocking connections to the db or maybe some missing config.

Thanks,
Mike

peppelinux
Champ in-the-making
Champ in-the-making
This is the error in alfresco.log

15:32:14,479 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
15:32:19,829 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 67 Web Scripts (+0 failed), 71 URLs
15:32:19,832 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised Presentation Web Script Container (in 603.937ms)
15:33:22,737 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 101 Web Scripts (+0 failed), 105 URLs
15:33:22,738 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised WebFramework Web Script Container (in 62875.83ms)
15:33:22,818 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
15:33:44,207 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:alfresco/extension/*-context.xml]
Offending resource: class path resource [alfresco/application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from file [/var/Alfresco-Labs/tomcat/shared/classes/alfresco/extension/._custom-repository-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Content is not allowed in prolog.
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from file [/var/Alfresco-Labs/tomcat/shared/classes/alfresco/extension/._custom-repository-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Content is not allowed in prolog.
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.

The database is accessible,  the files custom-hibernate-dialect.properties , custom-repository.properties are correctly configured but the logs informations says "there are problems with the file -context.xml" . This file are present and accesible
ll *-context.xml
-rwxr-xr-x  1 root root  481 Jan 19 14:32 custom-activities-feed-context.xml
-rwxr-xr-x  1 root root 1.7K Jan 19 14:32 custom-repository-context.xml
-rwxr-xr-x  1 root root  958 Dec 17 13:15 wcm-bootstrap-context.xml
[root@opscp extension]# pwd
/var/Alfresco-Labs/tomcat/shared/classes/alfresco/extension
————————————————————————————————————————————-
I understand that the first run of alfresco fills the database but
in the guide Installing and Configuring Alfresco Labs 3 Stable - pag 15 is written
"10. In the Database Selection window, select the database to use from one of the following options:"
But in the process of installation there isn't nothing of similar
————————————————————————————————————————————-
Thanks for the help

mikeh
Star Contributor
Star Contributor
What's in the file [/var/Alfresco-Labs/tomcat/shared/classes/alfresco/extension/._custom-repository-context.xml]? (Note the leading . so it might be hidden by default)

Mike

peppelinux
Champ in-the-making
Champ in-the-making
This file was created when I modified the file of configuration with my editor. So I deleted all file ._custom- and the new error is this:

cat alfresco.log
08:53:05,934 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
08:53:10,752 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 67 Web Scripts (+0 failed), 71 URLs
08:53:10,754 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised Presentation Web Script Container (in 981.019ms)
08:54:13,605 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 101 Web Scripts (+0 failed), 105 URLs
08:54:13,606 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised WebFramework Web Script Container (in 62829.777ms)
08:54:13,710 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
08:55:03,239 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to perform ImageMagick transformation:
Execution result:
   os:         Linux
   command:    [/usr/local/bin/convert, /var/Alfresco-Labs/tomcat/temp/Alfresco/ImageMagickContentTransformer_init_source_4880057897826524133.gif, /var/Alfresco-Labs/tomcat/temp/Alfresco/ImageMagickContentTransformer_init_target_7677274351261660115.png]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "/usr/local/bin/convert": java.io.IOException: error=2, No such file or directory
08:55:04,461 WARN  [org.springframework.jmx.support.JmxUtils] Found more than one MBeanServer instance. Returning first from list.
08:55:07,598 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
08:55:17,914 ERROR [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer] Failed to start a runtime executable content transformer:
Execution result:
   os:         Linux
   command:    [/var/Alfresco-Labs/bin/pdf2swf, -V]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "/var/Alfresco-Labs/bin/pdf2swf": java.io.IOException: error=2, No such file or directory
08:55:34,050 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
08:55:34,707 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /var/Alfresco-Labs/tomcat/temp/Alfresco/AlfrescoSchemaCreate-org.hibernate.dialect.MySQLInnoDBDialect-8217384616221579559.sql (Generated).
08:55:34,720 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Statement execution failed:
   SQL:     create table JBPM_ACTION (
        ID_ bigint not null auto_increment,
        class char(1) not null,
        NAME_ varchar(255),
        ISPROPAGATIONALLOWED_ bit,
        ACTIONEXPRESSION_ varchar(255),
        ISASYNC_ bit,
        REFERENCEDACTION_ bigint,
        ACTIONDELEGATION_ bigint,
        EVENT_ bigint,
        PROCESSDEFINITION_ bigint,
        TIMERNAME_ varchar(255),
        DUEDATE_ varchar(255),
        REPEAT_ varchar(255),
        TRANSITIONNAME_ varchar(255),
        TIMERACTION_ bigint,
        EXPRESSION_ text,
        EVENTINDEX_ integer,
        EXCEPTIONHANDLER_ bigint,
        EXCEPTIONHANDLERINDEX_ integer,
        primary key (ID_)
    ) type=InnoDB
   Error: Syntax error: Encountered "auto_increment" at line 2, column 29.
   File: /var/Alfresco-Labs/tomcat/temp/Alfresco/AlfrescoSchemaCreate-org.hibernate.dialect.MySQLInnoDBDialect-8217384616221579559.sql
   Line: 23
08:55:34,723 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "auto_increment" at line 2, column 29.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
———————————–
The driver for the db is present
ll mysql-connector-java-5.1.6-bin.jar
-rwxr-xr-x  1 root root 687K Dec 16 12:22 mysql-connector-java-5.1.6-bin.jar
[root@opscp lib]# pwd
/var/Alfresco-Labs/tomcat/lib

the db is accessible , if I prove to run the query , to the same host where alfresco is installed I receive a good result
mysql -u alfresco -palfresco alfresco
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.0.67-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table JBPM_ACTION (
    ->         ID_ bigint not null auto_increment,
    ->         class char(1) not null,
    ->         NAME_ varchar(255),
    ->         ISPROPAGATIONALLOWED_ bit,
    ->         ACTIONEXPRESSION_ varchar(255),
    ->         ISASYNC_ bit,
    ->         REFERENCEDACTION_ bigint,
    ->         ACTIONDELEGATION_ bigint,
    ->         EVENT_ bigint,
    ->         PROCESSDEFINITION_ bigint,
    ->         TIMERNAME_ varchar(255),
    ->         DUEDATE_ varchar(255),
    ->         REPEAT_ varchar(255),
    ->         TRANSITIONNAME_ varchar(255),
    ->         TIMERACTION_ bigint,
    ->         EXPRESSION_ text,
    ->         EVENTINDEX_ integer,
    ->         EXCEPTIONHANDLER_ bigint,
    ->         EXCEPTIONHANDLERINDEX_ integer,
    ->         primary key (ID_)
    ->     ) type=InnoDB;
Query OK, 0 rows affected, 1 warning (0.76 sec)

What's the problem?
Thanks a lot for the help

mikeh
Star Contributor
Star Contributor
I've not seen that problem before.

Could you shutdown Tomcat, drop and re-create the database and also clear out anything under the alf_data folder and try a restart now those rogue config files have gone?

Thanks,
Mike