Friday, September 19, 2014

Maven problems in 4.2.e-f and 4.20

I you need access to some java classes in a Alfresco Maven project it might give you problems with an artifact which did not get properly inserted into the maven.alfresco.com repository. The issue is also described in various issues, among others: https://issues.alfresco.com/jira/browse/MNT-10118

I solved access to alfresco-repository, alfresco-web-framework-commons, alfresco-remote-api & alfresco-web-client 

Using these dependencies in my Alfresco repo maven pom, where the parent pom used the alfresco platform.

    <dependencies>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-repository</artifactId>
            <scope>provided</scope>
             <exclusions>
                <exclusion>
                    <groupId>org.alfresco</groupId>
                    <artifactId>alfresco-web-framework-commons</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
         <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-web-framework-commons</artifactId>
            <scope>provided</scope>
            <version>${alfresco.version}</version>
        </dependency>
       
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-remote-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-web-client</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.alfresco</groupId>
                    <artifactId>alfresco-web-framework-commons</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Monday, September 8, 2014

Resolving jobs kept in 'Sync Pending' in Alfresco Cloud sync

In Alfresco you can sync your on-premise documents to Alfresco Cloud, given you have a sync-enabled Alfresco Enterprise license and a Alfresco Cloud login/network.

The Cloud sync (on premise) has a pull and a push job which pulls fron or pushes to the cloud. This works out of the box and in newer version 4.2.x. Cloud sync is only for one server ('PRODUCTION').

Example for cloud sync enabling settings:

system.serverMode=PRODUCTION
syncService.mode=ON_PREMISE
sync.pushJob.enabled=true
sync.pullJob.enabled=true

Troubleshooting the sync is described here: https://docs.alfresco.com/4.2/concepts/cloud_sync_troubleshooting.html

A detail which I discovered the hard-way is that the push job is dependent on the audit-system. It uses the audit messages to findout if anything has happen, since last sync (no audit -> do not run). Therefore, if you disable the audit trail, the push-job never runs. You will not see anything in the logs.

So remove any 'audit.enabled=false' if you have sync-jobs kept in pending state on your on-premise installation. Audit is enabled OOTB, but alternatively set the last line in your alfresco-global.properties to audit.enable=true