[
https://issues.apache.org/jira/browse/FELIX-527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585757#action_12585757
]
fmeschbe edited comment on FELIX-527 at 4/4/08 1:50 PM:
-----------------------------------------------------------------
The problem probably is that the InvocationTargetException should be caught
somewhere near to the location where it is thrown. IIRC there are only a select
number of such locations: Calling the bind and unbind methods as well as
calling the activate and deactivate methods. And looking at the code, all 4 of
these catch InvocationTargetException and unwrap the exception to log it.
So if an InvocationTargetException reaches the ComponentActorThread.run method,
I am not sure, whether we should unpack because this method has no clue what is
going on and should just log. The LogService in turn should log the complete
stack trace and be prepared to Throwable.getMessage() returning null - for
example most JVM generated NullPointerExceptions are thrown without a message.
If you could name the stacktrace of the InvocationTargetException (and possibly
the AME), this could possibly help catching such exceptions more closely.
was (Author: fmeschbe):
The problem probably is that the InvocationTargetException should be caught
somewhere near to the location where it is thrown. IIRC there are only a select
number of such locations: Calling the bind and unbind methods as well as
calling the activate and deactivate methods. And looking at the code, all 4 of
these catch InvocationTargetException and unwrap the exception to log it.
So if an InvocationTargetException reaches the ComponentActorThread.run method,
I am not sure, whether we should unpack because this method has no clue what is
going on and should just log. The LogService in turn should log the complete
stack trace and be prepared to Throwable.getMessage() returning null - for
example most JVM generated NullPointerExceptions are thrown without a message.
> Improve Error Reporting during binding
> --------------------------------------
>
> Key: FELIX-527
> URL: https://issues.apache.org/jira/browse/FELIX-527
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services
> Affects Versions: felix-1.0.0
> Environment: org.apache.felix.scr-0.9.0-SNAPSHOT
> org.apache.felix.scr-1.0.0
> pax-logging-0.9.6
> Reporter: Patrick Forhan
>
> [cross-reported to pax-logging jira as
> http://issues.ops4j.org/jira/browse/PAXLOGGING-25 ]
> If a service throws an exception during binding, the following is the only
> stack trace reported. The original context is lost:
> Exception in thread "SCR Component Actor" java.lang.NullPointerException
> at java.util.Hashtable.put(Unknown Source)
> at
> org.ops4j.pax.logging.internal.PaxLoggingServiceImpl.createEvent(PaxLoggingServiceImpl.java:175)
> at
> org.ops4j.pax.logging.internal.PaxLoggingServiceImpl.log(PaxLoggingServiceImpl.java:140)
> at
> org.ops4j.pax.logging.internal.PaxLoggingServiceImpl.log(PaxLoggingServiceImpl.java:76)
> at
> org.ops4j.pax.logging.internal.PaxLoggingServiceImpl.log(PaxLoggingServiceImpl.java:66)
> at org.apache.felix.scr.Activator.log(Activator.java:455)
> at
> org.apache.felix.scr.ComponentActorThread.run(ComponentActorThread.java:89)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.