[OTDev] OpenAM performance

Vedrin Jeliazkov vedrin.jeliazkov at gmail.com
Thu Jul 7 13:00:17 CEST 2011


Hi Andreas,

On 7 July 2011 12:21, Andreas Maunz <andreas at maunz.de> wrote:
> Hi Vedrin,
>
> On Thu, 7 Jul 2011 12:00:00 +0300, Vedrin Jeliazkov
> <vedrin.jeliazkov at gmail.com> wrote:
>> After successful deletion of about 2500 policies, the Policy server
>> has started returning systematically the following NPE:
>>
>> - - - - - - - - 8< - - - - - - - -
>> 25373568 ["http-bio-8080"-exec-1067] ERROR
>> org.apache.wink.server.internal.RequestProcessor -
>> WebApplicationException (500 - Internal Server Error) occured during
>> the handlers chain invocation
>> javax.ws.rs.WebApplicationException
>>       at org.opentox.pol.PolServiceImpl.getPolID(PolServiceImpl.java:432)
>
> If line numbers still match with mine, the code fragment would be:
>
>      try {
>        output =
> output.substring(output.indexOf("<Policies>"),output.length()); //
> incorporated XML formatting
>      } catch (StringIndexOutOfBoundsException e) {
>        throw new
> WebApplicationException(Response.status(500).entity("XML serialization
> failed.\n\n" + output + "\n\n").type("text/plain").build());
>      }
>
> So, can you find a StringIndexOutOfBoundsException in the logs? That
> would mean the corresponding policy has no such substring "Policies".
> It is unfortunately rather easy to feed OpenAM syntactically invalid
> policies, perhaps this has happened in your case, too.

This particular NPE happens to be triggered by a policy deletion
request that refers to an invalid (e.g. expired) token and can be
easilly reproduced by submitting such token when trying to delete
arbitrary policy. The policy deletion script that I launched this
morning was not smart enough to check the token validity before
attempting policy deletion. However it would be really better to avoid
throwing a NPE in such circumstances...I think we had identified this
issue in the past, but it is not corrected yet.

Kind regards,
Vedrin



More information about the Development mailing list