| Summary: | Jetty server WebAppContext missing from Eclipse 4.2 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP ServerTools | Reporter: | Elson Yuen <eyuen7> | ||||||||
| Component: | wst.server | Assignee: | Steven Hung <sghung> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Elson Yuen <eyuen7> | ||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | cbridgha, david_williams, kirbyzhou, raghunathan.srinivasan, thatnitind, zach | ||||||||
| Version: | unspecified | Flags: | eyuen7:
pmc_approved?
(david_williams) raghunathan.srinivasan: pmc_approved+ eyuen7: pmc_approved? (naci.dai) eyuen7: pmc_approved? (neil.hauge) eyuen7: pmc_approved? (kaloyan) cbridgha: pmc_approved+ |
||||||||
| Target Milestone: | 3.4.2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| See Also: |
https://git.eclipse.org/r/109151 https://git.eclipse.org/r/109150 |
||||||||||
| Whiteboard: | PMC_approved | ||||||||||
| Bug Depends on: | 379180 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Elson Yuen
This is a duplicate of Bug 379180. org.eclipse.jetty.webapp is currently not in Juno and that is where WebAppContext is now located at. *** This bug has been marked as a duplicate of bug 379180 *** I am re-opening this bug, to track the changes on the server tools side, once the missing plug-ins have been added from Bug 379180. Jan B had written in Bug 379180: If you were using a WebAppContext with jetty-6, then you should continue to use one for jetty-7/8, as this is the correct way to set up a web app in jetty. The ContextHandler is intended for lighter-weight setups without the full support for webapps (ie sessions, servlets, WEB-INF/web.xml etc etc). Therefore, we cannot use ContextHandler, we need to use WebAppContext. I have tested and it is true, servlets will not work when using ContextHandler. After a good deal of searching and debugging, I just came across this bug. The issue I've been having is that under Juno is that any of my servlet projects are broken in the J2EE Preview server, even though the same projects and configuration worked fine in Indigo. The root cause appears to be the same issue discussed in this bug. It appears to be a pretty critical issue, as it basically breaks the J2EE Preview server in Juno for many types of deployments. I just hacked around a bit and cobbled together a patch (attached) that moves the preview server back to using WebAppContext and takes care of the dependencies accordingly. This resolves the issue for me. I'm completely ignorant when it comes to Eclipse internals, so there may well be other packaging or dependency issues that I haven't considered, but this was enough to get things working again on Juno for me. Created attachment 219992 [details]
Use WebAppContext v1
*** Bug 387368 has been marked as a duplicate of this bug. *** Raising to major because of the impact of this defect. Zach, thanks or submitting the patch. The main problem is Eclipse has stopped shipping those plugins starting from Juno. That's why the plugins org.eclipse.jetty.xml and org.eclipse.jetty.webapp are missing from the WTP package. WTP picked up those plugins from base eclipse in the past (see bug 379180) for details. We are trying to figure out to see if we can package those classes as part of WTP before we can make those code changes to fix the problem. Created attachment 225714 [details] Patch v1.0 Plug-in and Feature changes The patch code changes are based on Zach's code changes. My change is to get the Jetty plug-ins added into Eclipse as part of the server tools WTP installation. To get the missing Jetty plug-ins, an approach is used similar to what Dali does in their feature file and map file in order to pull in additional plug-ins. I use: plugin@org.eclipse.jetty.webapp,8.1.3=p2IU,id=org.eclipse.jetty.webapp,version=8.1.3.v20120522,repository=http://download.eclipse.org/jetty/updates/jetty-bundles-8.x/8.1.3.v20120522 plugin@org.eclipse.jetty.xml,8.1.3=p2IU,id=org.eclipse.jetty.xml,version=8.1.3.v20120522,repository=http://download.eclipse.org/jetty/updates/jetty-bundles-8.x/8.1.3.v20120522 In the map file and use the specific repository to match the Jetty plug-ins with what WTP 3.4.2 uses. In the org.eclipse.wst.server.preview's feature.xml, I add references to org.eclipse.jetty.webapp and org.eclipse.jetty.xml. Note: The JSPs are still broken by Bug 377886 Tests run with J2EE preview server: 1. DWP 2.5, successfully able to run servlet 2. DWP 3.0, was not able to run servlet. More investigation is required Created attachment 225715 [details]
Patch v1.0 for releng changes
The patch for releng changes, that could not be added to the previous patch. This patch does not include the tag updates that will be applied when committing the changes.
Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. The J2EE preview server is broken on Juno. In particular, the servlets cannot be run due to Jetty changes in Juno. Is there a work-around? If so, why do you believe the work-around is insufficient? No, there is no workaround. The problem is caused by missing plug-ins. How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? The fix has been tested through manual tests. Servlets and HTML files were tested on Dynamic Web Projects 2.5 to ensure they run properly. JSPs still fail due to the error from Bug 377886, which needs to be investigated further. No new JUnit tests were added. Give a brief technical overview. Who has reviewed this fix? In order to use WebAppContext (which will allow servlets to work), the plug-ins org.eclipse.jetty.webapp and org.eclipse.jetty.xml need to be added as dependencies. These plug-ins are not part of the WTP by default, so the feature and releng files need to be updated to pull in these plug-ins. The code changes were reviewed by Elson Yuen. The feature and releng file changes to pull in the Jetty plug-ins were based on recommendations from David Williams and looking at what Dali does. What is the risk associated with this fix? Medium, the feature and releng changes needs to be tested through a build to ensure there is no build breakages caused by pulling in the additional Jetty plug-ins. The code change itself is low, since it just affects the J2EE preview server. Comment on attachment 219992 [details]
Use WebAppContext v1
I am marking this patch as obsolete because my new changes are based on these changes. The only change I made to this patch is related to the copyright header.
My other two patches deal with the feature and releng changes required to pull in the missing Jetty plug-ins.
approved - we def want this working again. Released to 3.4.2 I verified with wtp4x-R3.4.2-M/20130117161135 that the J2EE preview server works with a dynamic web project (version 2.5). I also verified that org.eclipse.jetty.webapp and org.eclipse.jetty.xml are installed as part of WTP 3.4.2 Code released to HEAD. I also changed 3.4.2 map file to point to the tags with changes done on the master branch, since the 3.4.2 maintenance and master branch currently use the same code New Gerrit change created: https://git.eclipse.org/r/109151 New Gerrit change created: https://git.eclipse.org/r/109150 |