You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/04/17 10:07:14 UTC
DO NOT REPLY [Bug 53090] New: Servlet superclass injection targets
are ignored
https://issues.apache.org/bugzilla/show_bug.cgi?id=53090
Bug #: 53090
Summary: Servlet superclass injection targets are ignored
Product: Tomcat 7
Version: 7.0.26
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: b.kapukaranov@gmail.com
Classification: Unclassified
Created attachment 28623
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28623
patch that shows the processing of the servlet's superclass injections
Hi folks,
I've been running Tomcat 7.0.26 in a JEE container against the EE6 Web Profile
CTS.
In many of the tests there is the following scenario: A servlet 'X' extends a
regular class 'Y'. An env-entry element for a field in 'Y' with
injection-target-class equal to 'Y' is defined in the app's web.xml. The
injection-target-name points to a field that is not annotated.
When the app boots and Tomcat handles the injections for the servlet it
processes only those that are defined explicitly for the 'X' servlet's class
name, ignoring its superclasses.
I'm attaching a patch I made on top of 7.0.x/trunk that fixed the issue. It's
quite small.
I believe Tomcat should respect the injections for the servlet's superclasses.
What do you think is the right behavior?
Thank you,
Bobby
--
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@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 53090] Servlet superclass injection targets are
ignored
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53090
Borislav Kapukaranov <b....@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #28623|0 |1
is patch| |
Attachment #28623|application/octet-stream |text/plain
mime type| |
--
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@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 53090] Servlet superclass injection targets are ignored
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53090
--- Comment #3 from Violeta Georgieva <vi...@apache.org> ---
Hi,
In the Java Platform EE 6 Spec, EE.5.2.5. Annotations and Injection, they
specify that resource annotations may appear on any superclass of the class.
Annotations and inheritance topic is described also on the wiki
http://java.net/projects/javaee-spec/pages/AnnotationRules
βIn general, annotations on interfaces are ignored.β
However there are specified also exceptions of the rule.
For our use case β resource annotations (@Resource, @EJB etc.) and injection
target classes β I think that we should ignore them.
Regards
Violeta
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 53090] Servlet superclass injection targets are ignored
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53090
--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> ---
Re r1343396 : I wonder whether interfaces should be scanned as well.
Can injection-target-class be an interface?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 53090] Servlet superclass injection targets are ignored
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53090
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the patch. It has been applied to trunk and 7.0.x and will be
included in 7.0.28 onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 53090] Servlet superclass injection targets are ignored
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53090
Violeta Georgieva <vi...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |violetagg@apache.org
--
You are receiving this mail because:
You are the assignee for the bug.