This discussion is archived
5 Replies Latest reply: Jun 3, 2013 5:22 AM by arjun.sengupta RSS

Sun IDM 8.1.1P2: Export user records to xls file Functionality Issue

1009396 Newbie
Currently Being Moderated
Hi All,

This is my first post in this form, please guide me to right path.

We implemented custom functionality to search user records from AD and LDAP from IDM User console. After searching the records we provided a export functionality to export resultant user records to xls file.

The issue is the number of exported user records to xls file is not same as the number of user records while search.

This functionality is working good in our Development and VALenvironments but not with the Production environment.
I checked the custom jsp file and the calling Rule from all the three environments and they are same.

From VAL and PROD server.log I see the following.

PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: PWC3991: getOutputStream() has already been called for this response

But this error message didn't stop VAL to export same number of records to xls file.

# of records serached from PROD is 16809
# of records serached from VAL is 10312
They are constant all the time.

# of records exported to xls from PROD is 168 or 1274 (It is varying, each time I export it shows different number)
# of records exported to xls from VAL is 10312 (Always same as search)

We are on Glassfish V2.1.1P8.

I checked file sizes from VAL and PROD both are same.

It would be great if any one can point me to the right direction where else I have to check for possible cause.


Thanks,
Ravi Mangalagiri
  • 1. Re: Sun IDM 8.1.1P2: Export user records to xls file Functionality Issue
    arjun.sengupta Newbie
    Currently Being Moderated
    Hi,

    If possible, you can try to run the rule directly in production (instead of from the JSP) and see if it is returing the same value or different values.

    If the above is different, then there is some restriction in the AD account

    If the above is same, then check if the request is getting timed out somewhere

    Regards
    Arjun
  • 2. Re: Sun IDM 8.1.1P2: Export user records to xls file Functionality Issue
    1009396 Newbie
    Currently Being Moderated
    Hi Arjun,

    Thanks for responding to my post.

    The search is working as expected in all 3 environments DEV,VAL and PROD.
    The search and alignment performed by the Rule where as DB connection and Saving to XLS performed by the custom JSP file.

    Since search is working fine I don't think any permissions issue with AD or LDAP.

    Couple of things I noticed from server.log from all environments

    SEVERE|sun-appserver2.1.1|javax.enterprise.system.container.web|_
    ThreadID=297;_ThreadName=httpSSLWorkerThread-9084-102;_RequestID=5efa3ecb-0ec9-4695-ab51-8049257b
    9d57;|StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalStateException: PWC3991: getOutputStream() has already been called for this resp
    onse

    and

    WARNING|sun-appserver2.1.1|javax.enterprise.system.stream.err|_ThreadID=78;_ThreadName=Provisioner;_RequestID=531d32b0-6d9a-4
    3e-bd74-0bc9478ffdae;|org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

    This is logging when the custom jsp is executing.
    getOutputStream() has already been called for this response.

    I am not sure if this is the root cause, since it is logging in DEV and VAL also.

    Other things I noticed are.
    Yester day I conducted 10 tests and all are taking 6 min 18 sec or 6 min 19 sec or 6 min 22 sec.
    Also I noticed that the number of user records exported to xls depends on the transfer rate.

    For example,
    if the file download transfer rate is 1.50 KB then the user records are between 1200 to 1800 where as the search user records are 16590.
    if the file download transfer rate is 800 B then the user records are between 200 to 600 where as the search user records are 16590.

    Not sure where to check this time value(attribute) 6 min 18 sec..
    Please provide me some info where else I need to check.

    Thanks,
    Ravi.
  • 3. Re: Sun IDM 8.1.1P2: Export user records to xls file Functionality Issue
    arjun.sengupta Newbie
    Currently Being Moderated
    Hi,

    Please check the exceptions then, from where they are getting triggered and get the full trace. There may be some changes in the code required.

    To get a full trace of the exception, go to idm/debug/Show_WSProp.jsp -> set exception.trace to true.

    This will help you get the full exception trace in IDM and debug.

    Please check the below threads:

    java.lang.IllegalStateException: getOutputStream() has already been called

    http://stackoverflow.com/questions/13682692/java-lang-illegalstateexception-getoutputstream-has-already-been-called-for-t

    Hope it helps

    Regards
    Arjun
  • 4. Re: Sun IDM 8.1.1P2: Export user records to xls file Functionality Issue
    1009396 Newbie
    Currently Being Moderated
    Hi Arjun,

    Thanks for the info.

    I checked server.log and access log by the time test.

    I have a custom jsp file which is calling getOutputStream() but I am not sure if this file calling getOutputStream() more than once.

    I have a specufic question about getOutputStream()

    we have

    Outside try block -- ServletOutputStream ServletOS = null;
    Inside try block-- ServletOS = response.getOutputStream();

    ServletOutputStream ServletOS = null;
    try {
    ServletOS = response.getOutputStream();
    ServletOS.println("<html><body>");


    Inside try block and inside while loop-- ServletOS.flush();

    }

    ServletOS.println("</tr>");
    ServletOS.flush();
    }
    ServletOS.println("</table>");

    ServletOS.println("</body></html>");


    Is it right way to code ? after flush, still we are using ServletOS.println("</body></html>");


    And finally

    finally {
    if (ServletOS != null) {
    ServletOS.close();
    ServletOS = null;
    }


    Also I checked the functionality by roletype name wise.
    We have 12 roletypes and we can search by rolename and export it to xls file.
    I noticed that all searches by roletype worked good except 2 roletypes.
    The reason I noticed is the 2 roletypes returns more than 4000 records each.
    Where as other role types return between 30 to 2900 records.
    I suspect it is some timeout limit ?
    what might be the reason if the number of records are more then 4000 it is not able to export all records?
  • 5. Re: Sun IDM 8.1.1P2: Export user records to xls file Functionality Issue
    arjun.sengupta Newbie
    Currently Being Moderated
    HI,

    I am not sure on this one. Sorry.
    Only thing i can tell is as your jsp is getting called from the IDM application, it is already having the html tags, as there will be some included jsps present

    You can open a Service request for this to get more help

    Regards
    Arjun

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points