Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.8
-
Fix Version/s: 2.9
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Environment:Any
-
Patch Submitted:Yes
-
Number of attachments :
Description
When a container configured with a lifecycle reflection strategy is started and that a container component throws a InvocationTargetException during startup, the ReflectionLifecycleStrategy class can fails when trying to cast the InvocationTargetException cause to (Error). All the original stack trace is lost and make it impossible to know what has really happened and debug the real problem.
See patch for the most clearest explanation possible : the code
Issue Links
- is depended upon by
-
SONAR-1018 NoClassDefFoundError is not correctly handled by the Sonar Maven plugin
For instance, when a NoClassDefFoundError is encountered we get the following exception and there is no way to get the root message :
Caused by: java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot b e cast to java.lang.Exception at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod( ReflectionLifecycleStrategy.java:115) at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(Reflect ionLifecycleStrategy.java:89) at org.picocontainer.adapters.InstanceAdapter.start(InstanceAdapter.java :113) at org.picocontainer.adapters.InstanceAdapter.start(InstanceAdapter.java :91) at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoConta iner.java:882) at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.jav a:630)