Alfresco with CMIS 1.0 some time error Resource leaked

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
phong_van
Active Member II

Alfresco with CMIS 1.0 some time error Resource leaked

Hi everyone,

I'm using Alfresco 5.2 - community version with cmis on Java 8. Recently, on log file some time miss error:

http client request: GET http://ecm.mycompany/alfresco/api/-default-/public/cmis/versions/1.1/atom?repositoryId=-default-
spring controller: com.mycompany.ecm.restapi.LosDocRestApi.query()
log info: com.mycompany.ecm.restapi.LosDocRestApi - ****** Receive query request with d ... roupName=null, mandatory=0] losdocapi = com.mycompany.ecm.restapi.LosDocRestApi@a7e2060
log debug: com.mycompany.ecm.impl.DocPermisionService - ***** Receive request getPermissionList ******
http client request: POST http://com.mycompany.rule:8090/ruleengine-jax-rs/ruleengine/api/queryPermissionByGroup
log trace: com.mycompany.ecm.server.AlfrescoImpl - Starting doQuery session =Session 6570 ... ome','LifeInsuranceCertificate') server = com.mycompany.ecm.server.AlfrescoImpl@4f6b501
http client request: POST http://ecm.mycompany:80/alfresco/api/-default-/public/cmis/versions/1.1/atom/query
log warn: com.mycompany.ecm.config.CmisSessionInterceptor - Request with URI = /ecm-alfresco-jax-rs/ecm/losdoc/query process in 0 seconds
Request with URI = /ecm-alfresco-jax-rs/ecm/losdoc/query process in 0 seconds
Resource leaked (acquired during the transaction and not released): org.apache.chemistry.opencmis.client.runtime.SessionImpl
Resource leaked

I've check CPU, RAM, DISK on Alfresco server, everything still good. So someone can give me some help?

4 Replies

Re: Alfresco with CMIS 1.0 some time error Resource leaked

Are you including Basic Auth credentials in your invocation?

Software Engineer in Alfresco Search Team.
phong_van
Active Member II

Re: Alfresco with CMIS 1.0 some time error Resource leaked

Yes,

This is my code 

private void configureSessionFactory()
{
if (sessionFactory == null)
{
this.parameters = new HashMap<String, String>();

// user credentials
parameters.put(SessionParameter.USER, username);
parameters.put(SessionParameter.PASSWORD, password);

// connection settings
parameters.put(SessionParameter.ATOMPUB_URL, repoUrl);
parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

// Create session factory
this.sessionFactory = (SessionFactoryImpl) SessionFactoryImpl.newInstance();
}
}


private void getRepository()
{
configureSessionFactory();
List<Repository> repositories = sessionFactory.getRepositories(parameters);
this.repository = repositories.get(0);
}

public Session createSession() throws Exception
{
log.debug("try to create session");
if (repository == null)
{
throw new RepositoryUnavailableException(lastException);
}
return repository.createSession();
}

Re: Alfresco with CMIS 1.0 some time error Resource leaked

You can try to create the session just after getting the repository reference:

cmis-associations-alfresco/CmisService.java at master · aborroy/cmis-associations-alfresco · GitHub 

Software Engineer in Alfresco Search Team.
phong_van
Active Member II

Re: Alfresco with CMIS 1.0 some time error Resource leaked

Dear Angel Borroy,

Thanks for your reply. You mean that I have to change my code from:

parameters.put(SessionParameter.ATOMPUB_URL, atompubUrl);
parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

To 

parameters.put(SessionParameter.BROWSER_URL, browserUrl);
parameters.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());

And, other question, which binding type (BROWSER, ATOMPUB) is better about performance?

Once again, many thanks your help.