You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Nicolae Marasoiu <Ni...@computas.com> on 2014/10/09 11:34:07 UTC

response code -1 (request not sent?)

Hi,

session.getObjectByPath("/content-1670202666") throws a CmisRuntimeException, wrapping a response code -1 (which is a strange one, and I think that actually this is not due to a response coming from the server, since the headers is also empty and all fields of response are null).

Making a browser test with the url value which fails: "http://localhost:8080/chemistry-opencmis-server-fileshare-1.0.0-SNAPSHOT/atom11/test/path?path=%2Fcontent-1670202666&filter=&includeAllowableActions=true&includeACL=false&includePolicyIds=false&includeRelationships=none&renditionFilter=cmis%3Anone" brings a looking code xml with code 200.

This seems to happen with chemistry client 0.12.0 on both FileShare-0.12.0 and Modeshape-4.

Please advise,
Nicu

RE: response code -1 (request not sent?)

Posted by Florian Müller <fm...@apache.org>.
Hi Nicu,

Looks like the client is not receiving a valid HTTP response.
That could be caused by a proxy or firewall, but I assume you are 
running the client and the server on the same machine (-> localhost 
URL). So, that's unlikely.
It could also be a problem of the servlet engine hosting the CMIS server 
implementation. Some confusion with keep-alive connections maybe.

Is it possible to get a network trace? We need to see what is returned 
by the server.

What servlet engine are you using on the server side? And which JRE you 
are using on the client side?

Can you turn keep-alive off on the client side by setting the system 
property "http.keepAlive" to "false"?


- Florian



> Hi,
> 
> I reproduced it in a different scenario. Right now, it is checking a
> folder existence:
> 
> Here is the exception trace:
> ..Cased by: (so the below is the root cause, no more Caused by. Also
> debugging, I saw code=-1, so my feeling is that it is not the result
> of a server response. Pls check debug I made, below)
> org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException
>         at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:495)
> [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:634)
> [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:857)
> [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObjectByPath(ObjectServiceImpl.java:634)
> [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at
> org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:556)
> [chemistry-opencmis-client-impl-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at
> org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:534)
> [chemistry-opencmis-client-impl-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown
> Source) [:1.7.0_51]
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [rt.jar:1.7.0_51]
>         at java.lang.reflect.Method.invoke(Method.java:606) 
> [rt.jar:1.7.0_51]
>         at
> org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:40)
> [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
>         at
> org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)
> [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
>         at
> org.jboss.weld.proxies.Serializable$Session$2053138592$Proxy$_$$_WeldClientProxy.getObjectByPath(Unknown
> Source) [weld-core-impl-2.1.2.Final.jar:]
>         at
> org.apache.chemistry.opencmis.client.util.FileUtils.getObject(FileUtils.java:77)
> [chemistry-opencmis-client-impl-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>         at
> com.computas.contentrepo.impl.basic.cmis.CmisBasicContentRepo.getObject(CmisBasicContentRepo.java:153)
> [:]
>         at
> com.computas.contentrepo.impl.basic.cmis.CmisBasicContentRepo.exists(CmisBasicContentRepo.java:110)
> [:]
> 
> Reproduces with both 1.0.0-SNAPSHOT pulled today, as well as the stable 
> 0.12:
> 
> AbstractAtomPubService.java (1.0.0-SNAPSHOT)
> protected Response post(UrlBuilder url, String contentType, Output 
> writer) {
>         // make the call
>         // Log.d("URL", url.toString());
>         Response resp = getHttpInvoker().invokePOST(url, contentType,
> writer, session);
> 
>         // check response code
>         if (resp.getResponseCode() != 201) {
>             throw convertStatusCode(resp.getResponseCode(),
> resp.getResponseMessage(), resp.getErrorContent(), null);
>         }
> 
>         return resp;
>     }
> 
> The resp looks like an empty one, certainly not one coming from the
> server, here is why:
> - header only has one entry: {content-type=[unknown/unknown]}
> - responseCode = -1
> - all the other response fields are null
> - hasResponseStream = false!
> 
> Thanks,
> Nicu
> 
> 
> Nicu Marasoiu
> Enterprise Java Architect
> nmarasoiu@computas.com
> + 40 724746655
> 
> 
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org]
> Sent: Thursday, October 09, 2014 6:25 PM
> To: dev@chemistry.apache.org
> Cc: Nicolae Marasoiu
> Subject: RE: response code -1 (request not sent?)
> 
> Hi Nicu,
> 
> Could you please provide a stack trace?
> A CmisRuntimeException can be anything. The context and the error
> message are important.
> 
> 
> - Florian
> 
> 
> 
>> Hi,
>> 
>> In fact, calling directly works ok. But calling after some other calls
>> have been made (getting objects, creating directories), it fails like
>> this.
>> Also, creating a new session and doing
>> getObjectByPath("/content-1670202666") gives the same result after
>> those operations (after creating a folder tree).
>> 
>> Please advise,
>> Nicu Marasoiu
>> 
>> 
>> 
>> -----Original Message-----
>> From: Nicolae Marasoiu [mailto:Nicolae.Marasoiu@computas.com]
>> Sent: Thursday, October 09, 2014 12:34 PM
>> To: dev@chemistry.apache.org
>> Subject: response code -1 (request not sent?)
>> 
>> Hi,
>> 
>> session.getObjectByPath("/content-1670202666") throws a
>> CmisRuntimeException, wrapping a response code -1 (which is a strange
>> one, and I think that actually this is not due to a response coming
>> from the server, since the headers is also empty and all fields of
>> response are null).
>> 
>> Making a browser test with the url value which fails:
>> "http://localhost:8080/chemistry-opencmis-server-fileshare-1.0.0-SNAPSHOT/atom11/test/path?path=%2Fcontent-1670202666&filter=&includeAllowableActions=true&includeACL=false&includePolicyIds=false&includeRelationships=none&renditionFilter=cmis%3Anone"
>> brings a looking code xml with code 200.
>> 
>> This seems to happen with chemistry client 0.12.0 on both
>> FileShare-0.12.0 and Modeshape-4.
>> 
>> Please advise,
>> Nicu

RE: response code -1 (request not sent?)

Posted by Nicolae Marasoiu <Ni...@computas.com>.
Hi,

I reproduced it in a different scenario. Right now, it is checking a folder existence:

Here is the exception trace:
..Cased by: (so the below is the root cause, no more Caused by. Also debugging, I saw code=-1, so my feeling is that it is not the result of a server response. Pls check debug I made, below)
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:495) [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:634) [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:857) [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObjectByPath(ObjectServiceImpl.java:634) [chemistry-opencmis-client-bindings-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:556) [chemistry-opencmis-client-impl-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:534) [chemistry-opencmis-client-impl-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source) [:1.7.0_51]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]
        at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
        at org.jboss.weld.proxies.Serializable$Session$2053138592$Proxy$_$$_WeldClientProxy.getObjectByPath(Unknown Source) [weld-core-impl-2.1.2.Final.jar:]
        at org.apache.chemistry.opencmis.client.util.FileUtils.getObject(FileUtils.java:77) [chemistry-opencmis-client-impl-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at com.computas.contentrepo.impl.basic.cmis.CmisBasicContentRepo.getObject(CmisBasicContentRepo.java:153) [:]
        at com.computas.contentrepo.impl.basic.cmis.CmisBasicContentRepo.exists(CmisBasicContentRepo.java:110) [:]

Reproduces with both 1.0.0-SNAPSHOT pulled today, as well as the stable 0.12:

AbstractAtomPubService.java (1.0.0-SNAPSHOT)
protected Response post(UrlBuilder url, String contentType, Output writer) {
        // make the call
        // Log.d("URL", url.toString());
        Response resp = getHttpInvoker().invokePOST(url, contentType, writer, session);

        // check response code
        if (resp.getResponseCode() != 201) {
            throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp.getErrorContent(), null);
        }

        return resp;
    }

The resp looks like an empty one, certainly not one coming from the server, here is why:
- header only has one entry: {content-type=[unknown/unknown]}
- responseCode = -1
- all the other response fields are null
- hasResponseStream = false!

Thanks,
Nicu


Nicu Marasoiu 
Enterprise Java Architect
nmarasoiu@computas.com
+ 40 724746655


-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org] 
Sent: Thursday, October 09, 2014 6:25 PM
To: dev@chemistry.apache.org
Cc: Nicolae Marasoiu
Subject: RE: response code -1 (request not sent?)

Hi Nicu,

Could you please provide a stack trace?
A CmisRuntimeException can be anything. The context and the error message are important.


- Florian



> Hi,
> 
> In fact, calling directly works ok. But calling after some other calls
> have been made (getting objects, creating directories), it fails like
> this.
> Also, creating a new session and doing
> getObjectByPath("/content-1670202666") gives the same result after
> those operations (after creating a folder tree).
> 
> Please advise,
> Nicu Marasoiu
> 
> 
> 
> -----Original Message-----
> From: Nicolae Marasoiu [mailto:Nicolae.Marasoiu@computas.com]
> Sent: Thursday, October 09, 2014 12:34 PM
> To: dev@chemistry.apache.org
> Subject: response code -1 (request not sent?)
> 
> Hi,
> 
> session.getObjectByPath("/content-1670202666") throws a
> CmisRuntimeException, wrapping a response code -1 (which is a strange
> one, and I think that actually this is not due to a response coming
> from the server, since the headers is also empty and all fields of
> response are null).
> 
> Making a browser test with the url value which fails:
> "http://localhost:8080/chemistry-opencmis-server-fileshare-1.0.0-SNAPSHOT/atom11/test/path?path=%2Fcontent-1670202666&filter=&includeAllowableActions=true&includeACL=false&includePolicyIds=false&includeRelationships=none&renditionFilter=cmis%3Anone"
> brings a looking code xml with code 200.
> 
> This seems to happen with chemistry client 0.12.0 on both
> FileShare-0.12.0 and Modeshape-4.
> 
> Please advise,
> Nicu

RE: response code -1 (request not sent?)

Posted by Florian Müller <fm...@apache.org>.
Hi Nicu,

Could you please provide a stack trace?
A CmisRuntimeException can be anything. The context and the error 
message are important.


- Florian



> Hi,
> 
> In fact, calling directly works ok. But calling after some other calls
> have been made (getting objects, creating directories), it fails like
> this.
> Also, creating a new session and doing
> getObjectByPath("/content-1670202666") gives the same result after
> those operations (after creating a folder tree).
> 
> Please advise,
> Nicu Marasoiu
> 
> 
> 
> -----Original Message-----
> From: Nicolae Marasoiu [mailto:Nicolae.Marasoiu@computas.com]
> Sent: Thursday, October 09, 2014 12:34 PM
> To: dev@chemistry.apache.org
> Subject: response code -1 (request not sent?)
> 
> Hi,
> 
> session.getObjectByPath("/content-1670202666") throws a
> CmisRuntimeException, wrapping a response code -1 (which is a strange
> one, and I think that actually this is not due to a response coming
> from the server, since the headers is also empty and all fields of
> response are null).
> 
> Making a browser test with the url value which fails:
> "http://localhost:8080/chemistry-opencmis-server-fileshare-1.0.0-SNAPSHOT/atom11/test/path?path=%2Fcontent-1670202666&filter=&includeAllowableActions=true&includeACL=false&includePolicyIds=false&includeRelationships=none&renditionFilter=cmis%3Anone"
> brings a looking code xml with code 200.
> 
> This seems to happen with chemistry client 0.12.0 on both
> FileShare-0.12.0 and Modeshape-4.
> 
> Please advise,
> Nicu

RE: response code -1 (request not sent?)

Posted by Nicolae Marasoiu <Ni...@computas.com>.
Hi,

In fact, calling directly works ok. But calling after some other calls have been made (getting objects, creating directories), it fails like this.
Also, creating a new session and doing  getObjectByPath("/content-1670202666") gives the same result after those operations (after creating a folder tree).

Please advise,
Nicu Marasoiu 



-----Original Message-----
From: Nicolae Marasoiu [mailto:Nicolae.Marasoiu@computas.com] 
Sent: Thursday, October 09, 2014 12:34 PM
To: dev@chemistry.apache.org
Subject: response code -1 (request not sent?)

Hi,

session.getObjectByPath("/content-1670202666") throws a CmisRuntimeException, wrapping a response code -1 (which is a strange one, and I think that actually this is not due to a response coming from the server, since the headers is also empty and all fields of response are null).

Making a browser test with the url value which fails: "http://localhost:8080/chemistry-opencmis-server-fileshare-1.0.0-SNAPSHOT/atom11/test/path?path=%2Fcontent-1670202666&filter=&includeAllowableActions=true&includeACL=false&includePolicyIds=false&includeRelationships=none&renditionFilter=cmis%3Anone" brings a looking code xml with code 200.

This seems to happen with chemistry client 0.12.0 on both FileShare-0.12.0 and Modeshape-4.

Please advise,
Nicu