Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332796 - Annotations inheritance does not work with jetty7 embedded
Summary: Annotations inheritance does not work with jetty7 embedded
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.1.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 16:11 EST by Filipe Sousa CLA
Modified: 2010-12-17 06:51 EST (History)
2 users (show)

See Also:


Attachments
MyServlet (257 bytes, text/x-java)
2010-12-16 16:12 EST, Filipe Sousa CLA
no flags Details
HelloServlet (1006 bytes, text/x-java)
2010-12-16 16:14 EST, Filipe Sousa CLA
no flags Details
Embedded server (1.97 KB, text/x-java)
2010-12-16 16:14 EST, Filipe Sousa CLA
no flags Details
jetty-web (510 bytes, text/xml)
2010-12-16 16:15 EST, Filipe Sousa CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Filipe Sousa CLA 2010-12-16 16:11:16 EST
Build Identifier: M20101201-0800

I have a class HelloServlet that does extends MyServlet class. I have a DataSource injeced into MyServet that is accessed by HelloServley. The problem is that the value is always null.
I don't have this problem with jetty6

Reproducible: Always
Comment 1 Filipe Sousa CLA 2010-12-16 16:12:54 EST
Created attachment 185370 [details]
MyServlet
Comment 2 Filipe Sousa CLA 2010-12-16 16:14:16 EST
Created attachment 185371 [details]
HelloServlet
Comment 3 Filipe Sousa CLA 2010-12-16 16:14:40 EST
Created attachment 185372 [details]
Embedded server
Comment 4 Filipe Sousa CLA 2010-12-16 16:15:33 EST
Created attachment 185373 [details]
jetty-web
Comment 5 Filipe Sousa CLA 2010-12-16 16:33:37 EST
Eclipse project with all needed jars
http://dl.dropbox.com/u/5176435/bugs/annotations7.tar.bz2
Comment 6 Jan Bartel CLA 2010-12-16 16:53:00 EST
JNDI objects need to be registered in a jetty-env.xml file, not a jetty-web.xml
file. As you can see from the list of Configurations that you have set up in
your Embedded server class, the handler for jetty-web.xml runs AFTER the one
for jetty-env and the plus/annotations ones. BTW this was the case for jetty-6
too.

regards
Jan
Comment 7 Filipe Sousa CLA 2010-12-16 17:05:22 EST
Hi,

I just did what you told me and still does not work. The result is the same.
Note that the injection works in the subclass, but not the superclass.

ds1=null
ds2=oracle.jdbc.pool.OracleConnectionPoolDataSource@3d3c33b7
ds3=oracle.jdbc.pool.OracleConnectionPoolDataSource@21453d72
Comment 8 Jan Bartel CLA 2010-12-17 05:52:29 EST
reopening for investigation
Comment 9 Jan Bartel CLA 2010-12-17 06:51:59 EST
Oh darn! Silly error when iterating over the parent class hierarchy. Fixed in trunk svn rev 2612.

Thanks for persisting with the bug report.

Jan