| Summary: | "Generate Deployment Descriptor Stub" generates incorrect web.xml for web 3.1 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Java EE Tools | Reporter: | Fred Bricon <fbricon> | ||||||||
| Component: | jst.j2ee | Assignee: | Carl Anderson <ccc> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Chuck Bridgham <cbridgha> | ||||||||
| Severity: | blocker | ||||||||||
| Priority: | P3 | CC: | alkazako, ccc, dgolovin, manderse, mistria, raghunathan.srinivasan, raj.alagumalai, shr31223, stryker | ||||||||
| Version: | 3.5 | ||||||||||
| Target Milestone: | 3.5 M7 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | JavaEE7 | ||||||||||
| Bug Depends on: | 400486 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Fred Bricon
Carl - can you take a look? BTW I can't see any 3.1 icon in the project explorer view (whether web.xml exists or not). Is this a bug (all versions < 3.1 have it) or a feature (icons are sooo 2012)? Actually whatever version is selected from Dynamic web module version combo web-app node always generated with xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" they added after WebFacetInstallDelegate.populateDefaultContent() is called in createWeb31DeploymentDescriptor createWeb30DeploymentDescriptor createWeb25DeploymentDescriptor I would consider this a blocker since this will fail more than a few servers and plugins out there that expect WTP to create files based on what facet version is chosen. (In reply to comment #2) > BTW I can't see any 3.1 icon in the project explorer view (whether web.xml > exists or not). Is this a bug (all versions < 3.1 have it) or a feature > (icons are sooo 2012)? It is bug 400489 . None of the Java EE 7 projects have their new icons yet. The main problem here is that bug 400486 was incomplete. The populateRoot() method of the various model providers was not updated to handle Java EE 7. Created attachment 230350 [details]
Update the Java EE model providers
The default for an unknown version is the Java EE 7 ones.
Created attachment 230351 [details]
Update the EJB model provider
Created attachment 230362 [details]
Update the Java EE model providers
Committed: http://git.eclipse.org/c/jeetools/webtools.javaee.git/commit/?id=50cf07a157a273afddccc9847f6f286cc8d594ff http://git.eclipse.org/c/ejb/webtools.ejb.git/commit/?id=f1f635d31ec4fcbb330f4853b764830fd6c2a9b6 And released using tag v201305012100 for WTP 3.5 could someone please confirm if this fix made it into the M7 build at http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplerm7 I am able to reproduce this issue on the Java EE M7 build available at http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplerm7 Version: Kepler Release Build id: 20130509-1105 steps to repro create a new dynamic web project pick 2.5 for jst.web facet click finish facet.core.xml contents <?xml version="1.0" encoding="UTF-8"?> <faceted-project> <fixed facet="wst.jsdt.web"/> <fixed facet="java"/> <fixed facet="jst.web"/> <installed facet="java" version="1.5"/> <installed facet="jst.web" version="2.5"/> <installed facet="wst.jsdt.web" version="1.0"/> </faceted-project> web.xml contents <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>web_25</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> >> I am able to reproduce this issue on the Java EE M7 build I can confirm that this bug still presents in M7. This is a blocker since web.xml is generated broken for any dynamic web facet which version less then 3.1 It still has xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" whatever facet version you selected. The bug is still present in the JavaEE RC1 (30130523-2011) distro : <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> I have a stack trace for when the file gets updated to the incorrect data. Web25ModelProvider(JEE5ModelProvider).modify(Runnable, IPath) line: 261 Web25MergedModelProvider.modify(Runnable, IPath) line: 92 WebFacetInstallDelegate.populateDefaultContent(IProject, IProjectFacetVersion) line: 311 WebFacetInstallDelegate.createWeb25DeploymentDescriptor(IProject, IProjectFacetVersion, IFolder, IProgressMonitor) line: 274 WebFacetInstallDelegate.execute(IProject, IProjectFacetVersion, Object, IProgressMonitor) line: 128 FacetedProject.callDelegate(IProjectFacetVersion, IDelegate, Object, Object, IProgressMonitor) line: 1477 FacetedProject.modifyInternal(Set<Action>, IProgressMonitor) line: 441 FacetedProject.mergeChangesInternal(IFacetedProjectWorkingCopy, IProgressMonitor) line: 1181 FacetedProject.access$2(FacetedProject, IFacetedProjectWorkingCopy, IProgressMonitor) line: 1117 FacetedProject$5.run(IProgressMonitor) line: 1099 Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 2345 FacetedProject.mergeChanges(IFacetedProjectWorkingCopy, IProgressMonitor) line: 1109 FacetedProjectWorkingCopy.commitChanges(IProgressMonitor) line: 2020 WebProjectWizard(ModifyFacetedProjectWizard).performFinish(IProgressMonitor) line: 400 WebProjectWizard(NewProjectDataModelFacetWizard).performFinish(IProgressMonitor) line: 282 ModifyFacetedProjectWizard$3.run(IProgressMonitor) line: 331 Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 2345 ModifyFacetedProjectWizard$4.run(IProgressMonitor) line: 345 ModalContext$ModalContextThread.run() line: 121 Before the update, web.xml looks like this: <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> After this call, web.xml looks like this: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>D328</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> I set breakpoints at all code that Roberto added in his commit, and none were hit. My workflow was a simple new Dynamic Web Project with 2.5 facet. It would appear something has been missed. verified that the issue has been addressed in RC3 Eclipse Platform Version: 4.3.0 Build id: I20130530-1430 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>dwp25</display-name> </web-app> <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>web30</display-name> </web-app> <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>web31</display-name> </web-app> I am going to close this down again as resolved. The fix here did fix the original issue as it stood, but further fixes have fixed the other code path as well. |