> Any ideas why switching from JPA ticket registry to memcached ticket registry > would affect auditing? I upped inspektr logging to debug but don’t see any > addition log information.
The exception you cited below offers only a hint, but it's better than nothing.
> [#|2012-04-17T13:15:41.901-0600|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=30;_ThreadName=http-thread-pool-9022-(3);|StandardWrapperValve
> [cas]: PWC1406: Servlet.service() for servlet cas threw exception
> java.lang.NullPointerException
> at
> com.github.inspektr.audit.AuditTrailManagementAspect.executeAuditCode(AuditTrailManagementAspect.java:147)
> at
> com.github.inspektr.audit.AuditTrailManagementAspect.handleAuditTrail(AuditTrailManagementAspect.java:139)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
This can happen if both the try and catch blocks in handleAuditTrail both throw
exceptions, in which case the finally block that logs the audit entry has a
null resolver [1].
While the Inspektr docs say the resolver is supposed to handle all exceptions
internally, I've seen this error occur when I've got try {...} catch (Exception
e){...} in my resolvers. I haven't spent the time to track down specific
causes because it rarely happens, but your case fits the general outline.
A quick review of source for Inspektr 1.0.5.GA, which is the version that ships
with 3.4.11, indicates this could be the problem since the NPE is thrown when
an attempt is made to iterate over a collection that would be null in the
scenario I described. (I'm matching up line numbers from your stack trace.)
Unfortunately the only way for you to get more information is to add more
logging to Inspektr and recompile. I really think Inspektr should either
provide more protection or information for cases like these. I opened an issue
[2] along those lines long ago but never followed through on it. Maybe it's
time to pursue?
M
[1]
https://github.com/dima767/inspektr/blob/c1677b560687ff1954fe106c7a664780d86513eb/inspektr-audit/src/main/java/com/github/inspektr/audit/AuditTrailManagementAspect.java
[2] https://github.com/dima767/inspektr/issues/10
smime.p7s
Description: S/MIME cryptographic signature
