AnsweredAssumed Answered

Alfresco extension, Quartz -> Lucene index probleme

Question asked by yannb on Jan 19, 2010
Hi,
I installed Alfresco Entreprise 3.1 on a linux server, developped an AMP module based on Quartz Jobs.
Everything is fine, my job is able to read a file an create alfresco spaces based on a template.

When a new file is detected, the application read the first line and create an alfresco space.
I notice that i have a problem when i have a file with ~100 lines :

org.alfresco.repo.search.impl.lucene.LuceneIndexException: Failed to flush index   at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.flushPending(AbstractLuceneIndexerImpl.java:795)
   at org.alfresco.repo.search.impl.lucene.AbstractLuceneBase.getSearcher(AbstractLuceneBase.java:171)
   at org.alfresco.repo.search.impl.lucene.ADMLuceneSearcherImpl.query(ADMLuceneSearcherImpl.java:251)
   at org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:85)
   at sun.reflect.GeneratedMethodAccessor417.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy20.query(Unknown Source)
   at com.ft.edossier.alfresco.facade.AlfrescoFacade.executeRequest(AlfrescoFacade.java:92)
   at com.ft.edossier.alfresco.service.ServiceSalarie.getDossierSalarie(ServiceSalarie.java:249)
   at com.ft.edossier.alfresco.service.ServiceSalarie.creerDossierSalarie(ServiceSalarie.java:54)
   at com.ft.edossier.alfresco.web.bean.VentilationDossierSalariesActionExecuter.executeImpl(VentilationDossierSalariesActionExecuter.java:93)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:127)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:688)
   at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:625)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:487)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:475)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:696)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy22.executeAction(Unknown Source)
   at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:574)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:322)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:229)
   at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:564)
   at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:432)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:497)
   at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:398)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.io.FileNotFoundException: /exec/products/alfresco/3.1-SP1/alf_data/lucene-indexes/workspace/SpacesStore/adfea7dd-372e-4521-8b83-ca5e4125b4fa/_2n_1.del (Trop de fichiers ouverts)
   at java.io.RandomAccessFile.open(Native Method)
   at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
   at org.apache.lucene.store.FSIndexInput$Descriptor.<init>(FSDirectory.java:497)
   at org.apache.lucene.store.FSIndexInput.<init>(FSDirectory.java:523)
   at org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:434)
   at org.apache.lucene.util.BitVector.<init>(BitVector.java:180)
   at org.apache.lucene.index.SegmentReader.initialize(SegmentReader.java:171)
   at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:140)
   at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:121)
   at org.apache.lucene.index.IndexReader$1.doBody(IndexReader.java:166)
   at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:579)
   at org.apache.lucene.index.IndexReader.open(IndexReader.java:147)
   at org.apache.lucene.index.IndexReader.open(IndexReader.java:137)
   at org.alfresco.repo.search.impl.lucene.index.IndexInfo.buildAndRegisterDeltaReader(IndexInfo.java:757)
   at org.alfresco.repo.search.impl.lucene.index.IndexInfo.getDeltaIndexReader(IndexInfo.java:743)
   at org.alfresco.repo.search.impl.lucene.AbstractLuceneBase.getDeltaReader(AbstractLuceneBase.java:194)
   at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.deleteImpl(AbstractLuceneIndexerImpl.java:576)
   at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.flushPending(AbstractLuceneIndexerImpl.java:759)
   … 57 more

2 questions :

- I have to change the index mode (index.recovery.mode=VALIDATE for the moment) ?
- Can i force the commit operation at the end of each loop ?

Thx

Outcomes