You are viewing limited content. For full access, please sign in.

Question

Question

Communication between SDK & WebService

SDK
asked on December 27, 2016

Incident: 

Communication between SDK & WebService

 

Situation:

 

Testing Environment:

- We have developed a WebService thats functionality is to send documents to Laserfiche´s repository Avante 10.1 using an SDK.  

- Using this testing environment it´s functionality is appropriate.  

-This environment has the following properties: Server Web Tomcat with version 7.0.56 and JAR httpcore-4.1.3.

 

Ambiente Producción:

- En este ambiente se presenta un incidente al interactuar con el SDK de Laserfiche con la versión del JAR httpcore-4.0.1 que tiene el servidor, cuando se consume un método de la clase HttpResponse en el paquete com.laserfiche.protocol del SDK de Laserfiche en el cual al ejecutar cierta sentencia manda una excepción tipo java.lang.IllegalStateException: 

- In this environment you may experience and incident with Laserfiches SDK and JAR version httpcore-4-0-1 that resides in the server, when the service consume a  method HttpResponse in the package com.laserfiche.protocol from Laserfiche SDK, it shows an exception java.lang.IllegalStateException: 

 

java.lang.IllegalStateException: Content has been consumed
— at org.apache.http.entity.BasicHttpEntity.getContent(BasicHttpEntity.java:84)
— at com.laserfiche.protocol.HttpResponse.close(HttpResponse.java:128)

— at com.laserfiche.repositoryaccess.Session.doLogin(Session.java:822)

- Servidor Web WebSphere en su versión 8.5.5.2 y el JAR httpcore-4.0.1

-Server Web WebSphere en su version 8.5.5.2 and JAR httpcore-4.0.1

Petition

- We ask for your support to solve this issue, we strongly believe that adding a try-catch function in order to identify the exception and allow the program to run as designed.

 

1 0

Replies

replied on December 27, 2016 Show version history

Hi Guillermo,

I believe the issue is caused by httpcore-4-0-1.jar, which is not compatible with JRA. JRA requires httpcore-4.1.3. The difference is,

// httpcore 4.1 implementation
public InputStream getContent() throws IllegalStateException {
    if (this.content == null) {
        throw new IllegalStateException("Content has not been provided");
    }
    return this.content;
}

// httpcore 4.0.1 implementation
public InputStream getContent()
    throws IllegalStateException {
    if (this.content == null) {
        throw new IllegalStateException("Content has not been provided");
    }
    if (this.contentObtained) {
        throw new IllegalStateException("Content has been consumed");
    }
    this.contentObtained = true;
    return this.content;

} // getContent

I think you need figure out a way for multiple versions of JAR to resolve the issue. 

2 0
replied on December 27, 2016

It seems like the error is while authenticating to the Laserfiche server.  Since this is such basic functionality, I would proceed with the assumption that there is something unusual about your environment that is causing it not to work.  You could try running your code from a command line rather than hosting it in a service and see if that makes a difference.  For additional troubleshooting you'll probably want to capture network traces, which support can help you interpret.

It's possible there's a problem in your code, but without seeing it it's impossible to rule that out.

You are not allowed to follow up in this post.

Sign in to reply to this post.