Summary: | RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | divanov |
Component: | Servlet & JSP API | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | removeps-code, Richard.Cheney |
Priority: | P3 | ||
Version: | unspecified | ||
Target Milestone: | default | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
postConstruct/preDestroy in super classes
Updated patch for fields/methods binary of the patch |
Description
divanov
2008-06-25 23:58:28 UTC
A fix has been committed to trunk and proposed for 6.0.x This has been fixed in 6.0.x and will be included in 6.0.18 onwards. *** Bug 45869 has been marked as a duplicate of this bug. *** I downloaded Tomcat 6.0.18 yesterday and tried again. With the workaround mentioned in the JSF bug, which is to add the context-param for injectionProvider, the problem is still there <context-param> <param-name>com.sun.faces.injectionProvider</param-name> <param-value>com.sun.faces.vendor.WebContainerInjectionProvider</param-value> </context-param> Your comments indicated that this bug is fixed in 6.0.18. Sorry - my bad. The fixed missed the preDestroy and postContruct methods. I'll get that fixed. Created attachment 22728 [details]
postConstruct/preDestroy in super classes
Here is a patch that is fixing this issue for postConstruct/preDestroy methods in super classes (private)
Thanks for the patch. I don't have the compile environment, so will just close verify the bug in the next build. Created attachment 22738 [details]
Updated patch for fields/methods
I notice that the fix that was done by Mark wasn't right also for attributes/methods.
Because even if we go in the upper classes with a loop, when checking the field/methods we were using instance.getClass() and not the clazz object so fields/methods of superclasses were never obtained.
Also the default name for ENC field/methods should contain the super class name and not the instance name, so I added the clazz parameter to the lookup methods.
Created attachment 22739 [details]
binary of the patch
For people without compiling env, here is the class
Thanks for the review and the new patch. I didn't apply the new patch directly as there were a number of white space changes that made it harder to read. The proposed patch is http://people.apache.org/~markt/patches/2008-10-20-bug45285-v2.patch This has been applied to 6.0.x and will be in 6.0.19 onwards. |