Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26446

    Hi

    We have an architecture with apache tomcat and tomcat have to pass through a proxy.

    In developpement environnement with only tomcat everythning works fine. In validation environement with Apache and proxy it doesn’t work.

    When we use P4ML.render with a array of url, we have noting displayed in the pdf.

    When we use HttpClient (code below), the html works but we don’t have the images.

    HttpState initialState = new HttpState();

    // Initial set of cookies can be retrieved from persistent
    // storage
    // and re-created, using a persistence mechanism of choice,
    Cookie mycookie = new Cookie(u.getHost(), “JSESSIONID”, sessionId, “/”, null, false);

    // and then added to your HTTP state instance
    initialState.addCookie(mycookie);

    // Get HTTP client instance
    HttpClient httpclient = new HttpClient();
    //httpclient.getHostConfiguration().setProxyHost(new ProxyHost(“dmz-proxy”,8888));
    httpclient.getHttpConnectionManager().getParams().setConnectionTimeout(300);
    httpclient.setState(initialState);

    // RFC 2101 cookie management spec is used per default
    // to parse, validate, format & match cookies
    httpclient.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);

    // Get HTTP GET method
    GetMethod httpget = new GetMethod(strURL);
    httpget.setFollowRedirects(true);

    // Execute HTTP GET
    int result = httpclient.executeMethod(httpget);

    charset =httpget.getResponseCharSet();
    string.append(new String(httpget.getResponseBody(), charset));

    Can you correct the problem and use httpclient for your connections ?

    Regards

    Kefah & Jean-Paul

    #28191

    Try to propagate session ID with PD4ML requests. There is an API call intended for that:

    pd4ml.setCookie( “JSESSIONID”, cookieValue );

    where cookieValue is something like that: “9034657927465;path=/”

    #28190

    Hi,

    Thanks for your response.
    But it is not a cookie problem, we have no problem with the session. The problem is for pd4ml to go through our proxy.

    best regards,

    #28192

    You may specify proxy server address an port with the standard way for Java applications – usin http.proxyServer and http.proxyPort environment variables.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.