Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371028 - ServletBridge vs Servlet 3.0: FrameworkLauncher does not export javax.servlet.annotation, javax.servlet.descriptor
Summary: ServletBridge vs Servlet 3.0: FrameworkLauncher does not export javax.servlet...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Server-Side (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: Juno M6   Edit
Assignee: equinox.server-side-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 19:31 EST by Philipp Nanz CLA
Modified: 2012-02-16 15:01 EST (History)
3 users (show)

See Also:


Attachments
Proposed patch (Git format) (335.40 KB, patch)
2012-02-08 19:41 EST, Philipp Nanz CLA
no flags Details | Diff
The patched FrameworkLauncher.java (37.65 KB, patch)
2012-02-09 09:01 EST, Philipp Nanz CLA
no flags Details | Diff
patch #2 (#1 was missing javax.servlet.resources in servlet 3.0 case) (37.73 KB, patch)
2012-02-09 09:09 EST, Philipp Nanz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Nanz CLA 2012-02-08 19:31:21 EST
Build Identifier: Juno M5

Servlet 3.0 adds some new packages, namely javax.servlet.annotation and javax.servlet.descriptor and removes javax.servlet.resources.

As of this time the ServletBridge FrameworkLauncher doesn't add these packages to the extensions bundles export header. This causes all sorts of problems:

- the new org.apache.jasper.glassfish 2.2.2 bundle will not resolve, as it needs javax.servlet.descriptor.
- you can work around this by including javax.servlet_3.0.0 bundle in plugins directory, but this will give you other problems later on (mixing servlet classes from the outside classloader and the javax.servlet bundle doesn't seem to be such a great idea).
- I ran into this issue while trying to get Infocenter running on Tomcat 7/JBoss 7. It seems to me that this is the root cause for many of these issues.


The FrameworkLauncher should check the servlet version of the container and add these packages if applicable.

Reproducible: Always
Comment 1 Philipp Nanz CLA 2012-02-08 19:41:56 EST
Created attachment 210768 [details]
Proposed patch (Git format)

attached proposed patch. Pretty straight forward.
Comment 2 Simon Kaegi CLA 2012-02-08 23:21:34 EST
Thanks Phillip,

I agree it makes sense to change the generated package exports based on javax.servlet version.
Comment 3 Philipp Nanz CLA 2012-02-09 04:23:43 EST
Hi Simon, If you are looking for a test scenario, please see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=363009. That's what brought me here in the first place...
Comment 4 Thomas Watson CLA 2012-02-09 08:36:43 EST
(In reply to comment #1)
> Created attachment 210768 [details]
> Proposed patch (Git format)
> 
> attached proposed patch. Pretty straight forward.

The attachment appears to be some binary file.  Can you double check it?

I also think we need to be aware of the package version we export from the extension bundle for Servlet spec 3.0.  I think it should use the package version of 2.6 (see bug 360245).
Comment 5 Philipp Nanz CLA 2012-02-09 09:01:03 EST
Created attachment 210797 [details]
The patched FrameworkLauncher.java

It was a zipped up patch in git format, but somehow it seems to be broken. Anyhow, here is simply the modified Java class.
Comment 6 Philipp Nanz CLA 2012-02-09 09:09:24 EST
Created attachment 210800 [details]
patch #2 (#1 was missing javax.servlet.resources in servlet 3.0 case)
Comment 7 Thomas Watson CLA 2012-02-09 15:19:38 EST
(In reply to comment #6)
> Created attachment 210800 [details]
> patch #2 (#1 was missing javax.servlet.resources in servlet 3.0 case)

I released this patch in commit:

http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=246fe89571124060a02b2249cd52342b34472501

Thanks Philipp!

I also released a follow on fix to correct the package versions when running on servlet spec version 3.0.  The package versions should be 2.6 in this case:

http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=74409a62535822fdb24a34e12ddb59913343f23b

Philip and Simon please review the commits above.
Comment 8 Philipp Nanz CLA 2012-02-10 14:07:09 EST
Looking good, I also tested the new JAR with my test project from bug #363009 and it's working as expected :-) Thanks!