Topic
  • 5 replies
  • Latest Post - ‏2012-07-27T04:07:44Z by Dave Sanders
Pratz25
Pratz25
8 Posts

Pinned topic Problem in connection with repository.

‏2012-07-18T11:38:48Z |
Hi all

I am learning CMIS and Filenet.

I am developing CMIS using GWT.

For the first time is a day when ever i tries to run my webAppplication it
Gives me CmisConnectionCmisException.
**
*session*=sessionFactory.createSession(getConnectionParameter());

Caused by: *
org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException*:
Cannot access
http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0:
Timeout while fetching:
http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0
Now i restart the webapplication , everything is perfectly fine.

now when i tries to to search document and for and was trying to add the
properties of folder
SEVERE: javax.servlet.ServletContext log: Exception while dispatching
incoming RPC call
*

com.google.gwt.user.server.rpc.UnexpectedException*: Service method 'public
abstract com.filenet.shared.FilenetFolder
com.filenet.client.CmisQueryInterface.search(com.filenet.shared.FilenetFolder,java.lang.String,int)'
threw an unexpected exception: *
org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException*:
Cannot access
http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0:
Timeout while fetching:
http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0

at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(*RPC.java:385
*).

but after restarting the webapplication it is executing perfectly fine.

Every time i do new thing it gives me adding Document, searching document, getting property of he document etc for the first time it will give me CmisConnectionCmisException. but after restarting the webApplication everything works fine.

How to solve this.

Plz help.

Thanks.
Updated on 2012-07-27T04:07:44Z at 2012-07-27T04:07:44Z by Dave Sanders
  • jay.brown
    jay.brown
    41 Posts

    Re: Problem in connection with repository.

    ‏2012-07-18T17:06:46Z  
    Just to confirm. Do all of these CMIS operations you are trying work correctly when executed from a known stable test client like Apache Chemistry Workbench? Just trying to eliminate the server from things we need to look at.
  • Pratz25
    Pratz25
    8 Posts

    Re: Problem in connection with repository.

    ‏2012-07-19T09:17:36Z  
    • jay.brown
    • ‏2012-07-18T17:06:46Z
    Just to confirm. Do all of these CMIS operations you are trying work correctly when executed from a known stable test client like Apache Chemistry Workbench? Just trying to eliminate the server from things we need to look at.
    I checked all the operation with Apache Chemistry Workbench. all the operations are executing perfectly fine in workbench.
    i reemphasize that for my CMIS web Application when i try to do any operation for the first time in a day its gives cmisConnectionException.
    But when i restart my web Application , all the operations works fine.
    I am using GWT for developing my WebApplication.

    Also ,if i am not executing the the webApplication for the time more the 1 hour, then also there is CmisConnectionException
    at session=sessionFactory.createSession(getConnectionParameter()) ;

    org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException*:
    Cannot access
    http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0:
    Timeout while fetching:
    http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0

    but after restarting the webAplication every operations executs perfectly fine.
  • jay.brown
    jay.brown
    41 Posts

    Re: Problem in connection with repository.

    ‏2012-07-23T21:03:16Z  
    • Pratz25
    • ‏2012-07-19T09:17:36Z
    I checked all the operation with Apache Chemistry Workbench. all the operations are executing perfectly fine in workbench.
    i reemphasize that for my CMIS web Application when i try to do any operation for the first time in a day its gives cmisConnectionException.
    But when i restart my web Application , all the operations works fine.
    I am using GWT for developing my WebApplication.

    Also ,if i am not executing the the webApplication for the time more the 1 hour, then also there is CmisConnectionException
    at session=sessionFactory.createSession(getConnectionParameter()) ;

    org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException*:
    Cannot access
    http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0:
    Timeout while fetching:
    http://192.168.1.32:9083/CaseManager/resources/ECM/TypeFlat/cmis:document?typeId=cmis%3Adocument&includePropertyDefinitions=true&maxItems=100&skipCount=0

    but after restarting the webAplication every operations executs perfectly fine.
    Things to look at to narrow this down:
    1. Compare the request headers sent by Workbench and the GWT app with Fiddler or other HTTP capture tool. The interesting headers are Cookie and Authorization but compare all the headers.
    2. Compare the org.apache.chemistry.opencmis.* parameters specified in Workbench (Connection's Expert tab) and GWT.

    Lastly, do you have ICM widgets deployed under this same profile where CMIS is running by chance?
  • Pratz25
    Pratz25
    8 Posts

    Re: Problem in connection with repository.

    ‏2012-07-25T10:30:04Z  
    • jay.brown
    • ‏2012-07-23T21:03:16Z
    Things to look at to narrow this down:
    1. Compare the request headers sent by Workbench and the GWT app with Fiddler or other HTTP capture tool. The interesting headers are Cookie and Authorization but compare all the headers.
    2. Compare the org.apache.chemistry.opencmis.* parameters specified in Workbench (Connection's Expert tab) and GWT.

    Lastly, do you have ICM widgets deployed under this same profile where CMIS is running by chance?
    In workbench parameter are like this and able to Load Repository using Workbench.

    org.apache.chemistry.opencmis.binding.spi.type=atompub
    org.apache.chemistry.opencmis.binding.atompub.url=http://192.168.1.32:9083/CaseManager/resources/Service
    org.apache.chemistry.opencmis.user=p8admin
    org.apache.chemistry.opencmis.password=filenet
    org.apache.chemistry.opencmis.binding.compression=true
    org.apache.chemistry.opencmis.binding.cookies=true
    Now in my GWT CMIS

    private void setSession() {
    try {
    System.out.println("set Session");
    Iterator<String> iterator = parameter.keySet().iterator();
    while (iterator.hasNext()) {
    String key = (String) iterator.next();
    String value = parameter.get(key);
    System.out.println(" key1 " + key + " value " + value);
    }
    session=sessionFactory.createSession(parameter);
    System.out.println("session -> " +session.getRepositoryInfo());

    } catch (CmisConnectionException e) {
    // TODO Auto-generated catch block

    System.out.println("Session Is Not Created" +e.getExceptionName());

    e.printStackTrace();
    }

    }

    and the output of above code.

    set Session

    key1 org.apache.chemistry.opencmis.binding.spi.type value atompub
    key1 org.apache.chemistry.opencmis.user value p8admin
    key1 org.apache.chemistry.opencmis.binding.atompub.url value http://192.168.1.32:9083/CaseManager/resources/Service
    key1 org.apache.chemistry.opencmis.session.repository.id value ECM
    key1 org.apache.chemistry.opencmis.password value filenet

    Session Is Not Createdconnection
    org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://192.168.1.32:9083/CaseManager/resources/Service?repositoryId=ECM: Timeout while fetching: http://192.168.1.32:9083/CaseManager/resources/Service?repositoryId=ECM
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils.invoke(HttpUtils.java:200)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils.invokeGET(HttpUtils.java:61)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:548)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:716)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:62)
    at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:69)
    at org.apache.chemistry.opencmis.client.runtime.SessionImpl.connect(SessionImpl.java:610)
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:90)
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:64)
    at com.filenet.server.CmisConnectionServiceImpl.setSession(CmisConnectionServiceImpl.java:92)
    at com.filenet.server.CmisConnectionServiceImpl.connectionCMIS(CmisConnectionServiceImpl.java:54)
  • Dave Sanders
    Dave Sanders
    19 Posts

    Re: Problem in connection with repository.

    ‏2012-07-27T04:07:44Z  
    • Pratz25
    • ‏2012-07-25T10:30:04Z
    In workbench parameter are like this and able to Load Repository using Workbench.

    org.apache.chemistry.opencmis.binding.spi.type=atompub
    org.apache.chemistry.opencmis.binding.atompub.url=http://192.168.1.32:9083/CaseManager/resources/Service
    org.apache.chemistry.opencmis.user=p8admin
    org.apache.chemistry.opencmis.password=filenet
    org.apache.chemistry.opencmis.binding.compression=true
    org.apache.chemistry.opencmis.binding.cookies=true
    Now in my GWT CMIS

    private void setSession() {
    try {
    System.out.println("set Session");
    Iterator<String> iterator = parameter.keySet().iterator();
    while (iterator.hasNext()) {
    String key = (String) iterator.next();
    String value = parameter.get(key);
    System.out.println(" key1 " + key + " value " + value);
    }
    session=sessionFactory.createSession(parameter);
    System.out.println("session -> " +session.getRepositoryInfo());

    } catch (CmisConnectionException e) {
    // TODO Auto-generated catch block

    System.out.println("Session Is Not Created" +e.getExceptionName());

    e.printStackTrace();
    }

    }

    and the output of above code.

    set Session

    key1 org.apache.chemistry.opencmis.binding.spi.type value atompub
    key1 org.apache.chemistry.opencmis.user value p8admin
    key1 org.apache.chemistry.opencmis.binding.atompub.url value http://192.168.1.32:9083/CaseManager/resources/Service
    key1 org.apache.chemistry.opencmis.session.repository.id value ECM
    key1 org.apache.chemistry.opencmis.password value filenet

    Session Is Not Createdconnection
    org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://192.168.1.32:9083/CaseManager/resources/Service?repositoryId=ECM: Timeout while fetching: http://192.168.1.32:9083/CaseManager/resources/Service?repositoryId=ECM
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils.invoke(HttpUtils.java:200)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils.invokeGET(HttpUtils.java:61)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:548)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:716)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:62)
    at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:69)
    at org.apache.chemistry.opencmis.client.runtime.SessionImpl.connect(SessionImpl.java:610)
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:90)
    at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:64)
    at com.filenet.server.CmisConnectionServiceImpl.setSession(CmisConnectionServiceImpl.java:92)
    at com.filenet.server.CmisConnectionServiceImpl.connectionCMIS(CmisConnectionServiceImpl.java:54)
    Things to try to determine why GWT OpenCMIS app cannot connect to the repository, but Workbench can.

    1) Verify that the GWT app specified the repository's Id instead of (if they're different) its Name. That is, look for <cmis:repositoryId>ECM</cmis:repositoryId> in the service document's repository info. Can also look at Workbench > Repository Info.

    2) In the GWT app, iterate through sessionFactory.getRepositories(), calling getRepositoryInfo() on each repository. Can GWT connect to any repository?

    3) Set the following to false in Workbench since the GWT app did not explicitly set them, and they default to false.
    org.apache.chemistry.opencmis.binding.cookies
       org.apache.chemistry.opencmis.binding.compression

    4) If still not resolved, capture HTTP requests and responses for both Fiddler and GWT app. Fiddler2 is one tool that can do that. If you use Fiddler2, start Java with "-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888". For Workbench, you can add that to workbench.bat after "start /B javaw".