DO NOT REPLY [Bug 45285] New: RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

View: New views
6 Messages — Rating Filter:   Alert me  

DO NOT REPLY [Bug 45285] New: RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=45285

           Summary: RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@...
        ReportedBy: divanov@...


According to the section EE.5.2.3 of the Java EE specification:
------------------------
Resource annotations may appear on any of the classes listed above, or on any
superclass of any class listed above. A resource annotation on any class in the
inheritance hierarchy defines a resource needed by the application component.
------------------------

I use JSF managed beans with @EJB annotated members.
If a resource is annotated in a super class of a class it's not injected.

Example:

public class Base{
@EJB
private SomeService service;
....
}

public class Child implements Base{
....
}

Base class used as managed bean has 'service' injected.
Child class used as managed bean does NOT have 'service' injected.

If I dare suggest the problem source ...

As I can see org.apache.catalina.util.DefaultAnnotationProcessor is used. It
has the following lines in its  'public void processAnnotations(Object
instance)' method:
....
Field[] fields = instance.getClass().getDeclaredFields();
....
Method[] methods = instance.getClass().getDeclaredMethods();
....


Class.getDeclaredFields method returns 'public, protected, default (package)
access, and private fields, but excludes inherited fields'.

The same thing is with Class.getDeclaredMethods.


--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 45285] RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=45285





--- Comment #1 from Mark Thomas <markt@...>  2008-07-09 14:07:06 PST ---
A fix has been committed to trunk and proposed for 6.0.x


--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 45285] RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=45285


Mark Thomas <markt@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Mark Thomas <markt@...>  2008-07-13 11:20:51 PST ---
This has been fixed in 6.0.x and will be included in 6.0.18 onwards.


--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 45285] RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=45285


Mark Thomas <markt@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |removeps-code@...




--- Comment #3 from Mark Thomas <markt@...>  2008-09-24 05:18:40 PST ---
*** Bug 45869 has been marked as a duplicate of this bug. ***


--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 45285] RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=45285


Firstname Lastname <removeps-code@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #4 from Firstname Lastname <removeps-code@...>  2008-09-26 08:55:24 PST ---
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.


--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 45285] RESOURCES DECLARED IN PARENT CLASSES ARE NOT INJECTED

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=45285





--- Comment #5 from Mark Thomas <markt@...>  2008-09-26 11:06:26 PST ---
Sorry - my bad. The fixed missed the preDestroy and postContruct methods. I'll
get that fixed.


--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

LightInTheBox - Buy quality products at wholesale price