Bug 395141 - Annotated web components are not found if they are not in WEB-INF/classes or WEB-INF/lib, but in the bundle class path
Summary: Annotated web components are not found if they are not in WEB-INF/classes or ...
Status: NEW
Alias: None
Product: Gemini.Web
Classification: RT
Component: unknown (show other bugs)
Version: 2.1.0.RELEASE   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-11-27 05:07 EST by Violeta Georgieva CLA
Modified: 2013-03-25 08:41 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Violeta Georgieva CLA 2012-11-27 05:07:44 EST
Gemini Web cannot discover an annotated web component if it is outside of the WEB-INF/classes or WEB-INF/lib, but it is in the bundle class path (i.e. Bundle-Classpath: .,WEB-INF/classes).
Comment 1 Violeta Georgieva CLA 2012-11-27 05:08:36 EST
If the web component is described in web.xml then it is working as expected.
Comment 2 Nobody - feel free to take it CLA 2013-01-21 06:00:19 EST
It would be helpful to have some clarifications as we are seeing similar problems with Spring MVC apps.

Is this a WAB in which you specify Bundle-Classpath or is it a WAR in which the Bundle-Classpath has been generated during deployment?

Which annotations are causing the problem?

Thanks.
Comment 3 Violeta Georgieva CLA 2013-01-21 12:46:09 EST
(In reply to comment #2)
> Is this a WAB in which you specify Bundle-Classpath 

Yes

> or is it a WAR in which
> the Bundle-Classpath has been generated during deployment?

No, because Servlet Spec declares only WEB-INF/classes and WEB-INF/lib/*.jar for inclusion in the class loader. Gemini Web does not add '.' to the generated Bundle-Classpath. So in this case everything is working.

> Which annotations are causing the problem?

Those specified in Servlet Spec i.e. @WebServlet etc.


I checked Tomcat implementation and it is not trivial to add the additional class path to the processing (see org.apache.catalina.startup.ContextConfig.webConfig() -> // Step 4. Process /WEB-INF/classes for annotations). I will need more time to find a way to process this. I do not want to override webConfig() because we will need to copy almost the whole method.