Tuesday, December 4, 2012

How to disable SOLR and enable Lucene on Alfresco


In Association with Amazon.in



Following are the steps to turn off SOLR and use Lucene on the fresh Alfresco install:


     1) Stop Alfresco.

     2) Comment all SOLR related properties and Uncomment all LUCENE related properties in /tomcat/shared/classes/alfresco-global.properties file.
 
      Following are properties for SOLR.
### Solr indexing ###

# The subsystem type value. Value is either solr or lucene.
index.subsystem.name=solr

# Absolute Path to your keystore directory for configuring Alfresco to talk to SOLR
dir.keystore=/alfresco/alf_data/keystore
# Solr hostname
solr.host=localhost

# Http port
solr.port=8080

# Https port
solr.port.ssl=8443

# Value can be https, or none
solr.secureComms=https

### Solr indexing ###

Following are properties for LUCENE.
### Lucene indexing ###

# The subsystem type value. Value is either solr or lucene.
index.subsystem.name=lucene

# The location for lucene index files
dir.indexes=/alfresco/alf_indexes/lucene-indexes

# The location for index backups
dir.indexes.backup=/alfresco/alf_indexes/backup-lucene-indexes

# Index recovery types; value can be NONE, VALIDATE, AUTO, FULL.
index.recovery.mode=FULL

### Lucene indexing ### 

3) Now, delete a) /alfresco/alf_data/solr folder,  
     b) tomcat/conf/Catalina/localhost/solr.xml file, &
                             c)  tomcat/webapps/solr folder.

4) Start Alfresco.

5) Now, Stop Alfresco after Full Indexing gets over and tomcat successfully starts up.

6) Edit following property in /tomcat/shared/classes/alfresco-global.properties file.

# Index recovery types; value can be NONE, VALIDATE, AUTO, FULL.
index.recovery.mode=AUTO

7) Start Alfresco.

NOTE: If you miss (Step 3) then, you may get following exceptions:

Exception #1:
SEVERE: Job (Solr.CoreTracker-alfresco threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.error.AlfrescoRuntimeException: 11040159 GetModelsDiff return status is 404]

        at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 11040159 GetModelsDiff return status is 404
        at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1036)
        at org.alfresco.solr.tracker.CoreTracker.trackModels(CoreTracker.java:1863)
        at org.alfresco.solr.tracker.CoreTracker.trackRepository(CoreTracker.java:1202)
        at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:548)
        at org.alfresco.solr.tracker.CoreTrackerJob.execute(CoreTrackerJob.java:45)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        ... 1 more

Cause: The above exception comes when you forgot to delete tomcat/conf/Catalina/localhost/solr.xml file.

Exception #2: 
SEVERE: Could not start SOLR. Check solr/home property
java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath or 'solr/conf/', cwd=/var/lib/tomcat6
      at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:262)
      at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:230)
      at org.apache.solr.core.Config.(Config.java:101)
      at org.apache.solr.core.SolrConfig.(SolrConfig.java:130)
      at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:134)
      at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
      at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Cause: The above exception comes when you forgot to delete tomcat/webapps/solr folder.

In Association with Amazon.in

Friday, November 2, 2012

Alfresco Desktop Sync Client Application



Alfresco has released an early preview of Alfresco Desktop Sync Client application which Sync files and folder on Local machine from Share Site’s files and folders on  Cloud & on-premise Alfresco.

This App works against user accounts in Alfresco in the Cloud, Enterprise 4.0+, and Community 4.0.e+. 

IMPORTANT: As this is an early preview, data loss is possible. Alfresco recommends you DO NOT use this with important data.

How to Install & Configure?

For Windows, installation is simple. Just follow the instructions and you’re done. Now, Start the application, you will the following screen.


Click on “New Account” button and select the Account Type (Private or Cloud).
Enter your User Name, Password, Server details and click on “Login”. (Select Cloud, if you have an account for Cloud) 


You will see list of Share Sites created in Alfresco Repository as shown below. 



You can choose what all Sites and Sub Folder, you want to Sync on your Local Machine.
Now, Click on “Start Syncing” button.




After Syncing, you can see all selected Sites on your local machine as below. 




Now you can create any files and folders from here and it will automatically get synced with your Alfresco Repository.

To know what is happening behind the scene, you can see the log file which keep track of all events.
The log file is kept in “%APPDATA%\AlfrescoSync” folder and can be found in these locations.

• Windows XP:
C:\Documents and Settings\@lt;username@gt;\Application Data\AlfrescoSync
• Windows 7:  C:\Users\\AppData\Roaming\AlfrescoSync

The log file AlfrescoSync.log will look like:

23:13:48.531 DEBUG PrivateAPI - Creating new PrivateAPI for account: PrivateAccount [server=http://localhost:9091/alfresco, id=0c53a08b-ce18-4caa-abe8-4b6345a87f94, user=deepak.keswani@cignex.com, password=*************************, sites=null, localFolder=null]
23:13:48.609 DEBUG PrivateAPI - Calling webscript: http://localhost:9091/alfresco/service/api/nodelocator/siteshome
23:13:48.937 DEBUG PrivateAPI - Reading response webscript: http://localhost:9091/alfresco/service/api/nodelocator/siteshome
23:13:49.062 DEBUG PrivateAPI - Reading response webscript: http://localhost:9091/alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/f6989708-ecb2-4297-8078-0a44e091fb52
23:14:02.531 TRACE SiteElement - Tree Selector -> Selected node: /Technologies/MongoDB
23:14:04.062 TRACE SiteElement - Tree Selector -> Selected node: /Technologies/Liferay
23:14:04.671 TRACE SiteElement - Tree Selector -> Selected node: /Technologies
23:14:05.265 TRACE SiteElement - Tree Selector -> Selected node: /
23:14:06.109 TRACE SiteElement - Tree Selector -> Selected node: /Technologies
23:14:07.093 TRACE SiteElement - Tree Selector -> Selected node: /
23:14:12.171 TRACE SiteElement - Tree Selector -> Selected node: /Technologies/MongoDB
23:14:14.625 TRACE SiteElement - Tree Selector -> Selected node: /Technologies/Alfresco
23:14:15.218 TRACE SiteElement - Tree Selector -> Selected node: /Technologies/Liferay
23:14:15.703 TRACE SiteElement - Tree Selector -> Selected node: /Technologies/MongoDB
23:14:16.343 TRACE SiteElement - Tree Selector -> Selected node: /Technologies
23:14:23.046 DEBUG SetupDialog - Favorite Sites Refresh Button Pressed
 



In Association with Amazon.in