FileCSV myCSV = new FileCSV (export.getDestinationFile());
Query query = new Query(Constants.QUERY_LANG_LUCENE, requete);
QueryResult result = getRepositoryService().query(store, query, true);
if (result != null && result.getResultSet() != null) {
ResultSetRow[] rows = result.getResultSet().getRows();
if (rows == null || rows.length == 0) {
System.out.println("AUCUN document trouvé par la requete !!");
myCSV.close();
return;
} else
System.out.println("Nombre de documents trouvés par la requete : " + String.valueOf(rows.length));
// Pour chaque resultat = node
for (int i = 0; i < rows.length ; ++i) {
NamedValue[] props = rows[i].getColumns();
List<Column> columns = export.getColumns();
…
// set the batch size in the query header
int batchSize = 500;
QueryConfiguration queryCfg = new QueryConfiguration();
queryCfg.setFetchSize(batchSize);
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
repositoryService.setHeader(new RepositoryServiceLocator().getServiceName().getNamespaceURI(), "QueryHeader", queryCfg);
// Propietes de repository service (la fonction getRepositoryService() ne doit plus être utilisée car elle ne prend pas le Header)
repositoryService.setUsername(username);
repositoryService.setPassword(password);
repositoryService.setTimeout(timeout);
Query query = new Query(Constants.QUERY_LANG_LUCENE, requete);
// get the first batch of results
QueryResult result = repositoryService.query(store, query, true);
// Write the first lines (process the first query result) :
writeLines(result, myCSV, export);
// Look for next lines (process the next query results) :
String querySession = result.getQuerySession();
while (querySession != null) {
// get the next batch of results
result = repositoryService.fetchMore(querySession);
// Write the next lines :
writeLines(result, myCSV, export);
// process subsequent query results
querySession = result.getQuerySession();
}
requete Lucene : @cm\:name:*pdf AND @cm\:name:BD_01* AND PATH:"/app:company_home/cm:MYPATH//*" AND @cm\:created:[2007\-09\-01T00:00:00 TO 2008\-09\-30T00:00:00]
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode> 0</ns1:errorCode><ns1:message>org.alfresco.error.AlfrescoRuntimeException: Exception in Tr ansaction.</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository .RepositoryFault
{http://xml.apache.org/axis/}stackTrace:
at org.alfresco.repo.webservice.repository.RepositoryWebService.executeQuery(Repos itoryWebService.java:176)
at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWe bService.java:195)
at sun.reflect.GeneratedMethodAccessor473.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode> 0</ns1:errorCode><ns1:message>org.alfresco.error.AlfrescoRuntimeException: Exception in Tr ansaction.</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository .RepositoryFault
{http://xml.apache.org/axis/}stackTrace:
at org.alfresco.repo.webservice.repository.RepositoryWebService.executeQuery(Repos itoryWebService.java:176)
at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWe bService.java:195)
at sun.reflect.GeneratedMethodAccessor473.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327 )
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java: 96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociati onValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve .java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:10 7)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConn ection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:5 27)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread. java:112)
at java.lang.Thread.run(Thread.java:595)
{http://xml.apache.org/axis/}hostname:XXX.XXX.fr
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor Impl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at org.alfresco.webservice.repository.RepositoryFault.getDeserializer(RepositoryFa ult.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeseria lizerFactory.java:154)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDese rializerFactory.java:84)
at org.apache.axis.encoding.DeserializationContext.getDeserializer(Deserialization Context.java:464)
at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(Deserial izationContext.java:547)
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBu ilder.java:157)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationCon text.java:1035)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Abstr actSAXParser.java:533)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartEleme nt(XMLNSDocumentScannerImpl.java:330)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fragment ContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocu ment(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Config uration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Config uration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXP arser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.ja va:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecke r.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub.query(Repos itoryServiceSoapBindingStub.java:753)
at fr.acxio.agea.DocumentHandler.readChilds(DocumentHandler.java:456)
at fr.acxio.agea.Connector.doExport(Connector.java:88)
at fr.acxio.agea.Connector.main(Connector.java:72)
public QueryResult queryParents(Reference node)
throws RemoteException, RepositoryFault
{
UserTransaction tx = null;
try
{
tx = Utils.getUserTransaction(MessageContext.getCurrentContext());
tx.begin();
QuerySession querySession = new ParentsQuerySession(Utils.getBatchSize(MessageContext.getCurrentContext()), node);
QueryResult queryResult = querySession.getNextResultsBatch(searchService, nodeService, namespaceService, dictionaryService);
if(queryResult.getQuerySession() != null)
querySessionCache.put(queryResult.getQuerySession(), querySession);
tx.commit();
return queryResult;
}
catch(Throwable e)
{
try
{
if(tx != null)
tx.rollback();
}
catch(Exception ex) { }
if(logger.isDebugEnabled())
logger.error("Unexpected error occurred", e);
throw new RepositoryFault(0, e.toString());
}
}
Donc visiblement, le fait d'avoir augmenté le "setFetchSize" fait planter lors de l'exécution de la requête, mais je ne sais toujours ni pourquoi ni comment augmenter le nombre de résultats …Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.