Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 399524

Summary: Basic Java EE 7 support
Product: [WebTools] WTP Java EE Tools Reporter: Chuck Bridgham <cbridgha>
Component: jst.j2eeAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: enhancement    
Priority: P3 CC: cameron.bateman, ccc, gregory.amerson, konstantin, nsand.dev, shr31223, wayne.beaton
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: All   
OS: All   
Whiteboard: JavaEE7
Bug Depends on:    
Bug Blocks: 400481, 400487, 400488, 422195    
Attachments:
Description Flags
SourceEditing Tools Patch v1 (b72)
none
Schemas (b72)
none
Java EE Tools Patch v1
none
EJB Tools Patch v1
none
SourceEditing Tools Patch v2 (b72)
none
SourceEditing Tools Patch v3 (b72)
none
SourceEditing Tools Patch v4 (based on 2013-02-15 draft)
none
SourceEditing Tools Patch v5 (based on 2013-02-15 draft)
none
Schemas (based on 2013-02-15 draft)
none
Java EE Tools Patch v2
none
EJB Tools Patch v2
none
EJB Tools Patch r1 v2
ccc: iplog+
Schemas (2013-02-15)
none
SourceEditing Tools Patch r1 v6
nsand.dev: iplog+
SourceEditing Tools Patch r2 v1
none
SourceEditing Tools Patch r2 v2
nsand.dev: iplog+
SourceEditing Tools Patch r2 v2 (plugin.xml)
nsand.dev: iplog+
EJB Tools Patch r2 v1 ccc: iplog+

Description Chuck Bridgham CLA 2013-01-30 13:06:08 EST
This will track the work for providing Java EE 7 spec version upgrades for the facet versions, for all the core module types currently supported.

This will follow the same types of changes defined here: (https://bugs.eclipse.org/bugs/show_bug.cgi?id=252613)
Comment 1 Konstantin Komissarchik CLA 2013-01-31 14:02:56 EST
I will volunteer to take this on.
Comment 2 Konstantin Komissarchik CLA 2013-02-01 16:14:11 EST
Created attachment 226470 [details]
SourceEditing Tools Patch v1 (b72)

This patch includes Java EE schemas of interest to core Java EE support. The schemas are from b72 GlassFish 4.0 build.

application_7.xsd
application-client_7.xsd
ejb-jar_3_2.xsd
javaee_7.xsd
jsp_2_3.xsd
web-app_3_1.xsd
web-common_3_1.xsd

The following schemas have not revved for Java EE 7.

connector_1_6.xsd
javaee_web_services_1_3.xsd
javaee_web_services_client_1_3.xsd
web-fragment_3_0.xsd

I am in the process of ascertaining the completion status on these schemas. Will update this bug with info that I find out. One big change that's still outstanding is the namespace change. It is likely that java.sun.com will not be used for Java EE 7. I don't have any further technical or timing details on this.
Comment 3 Konstantin Komissarchik CLA 2013-02-01 16:30:58 EST
Schemas CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=7046
Comment 4 Konstantin Komissarchik CLA 2013-02-01 16:31:19 EST
Created attachment 226472 [details]
Schemas (b72)
Comment 5 Konstantin Komissarchik CLA 2013-02-01 17:18:26 EST
Created attachment 226473 [details]
Java EE Tools Patch v1
Comment 6 Konstantin Komissarchik CLA 2013-02-01 17:18:42 EST
Created attachment 226474 [details]
EJB Tools Patch v1
Comment 7 Konstantin Komissarchik CLA 2013-02-01 17:24:40 EST
I've attached my current work-in-progress. I believe that I made all the necessary changes to make core facets aware of new Java EE 7 versions.

EAR 7
App Client 7
Servlet 3.1
EJB 3.2

Note that connector doesn't appear to be revving for Java EE 7.

Right now, the obstacle is updating EMF models for these descriptors. Creating a web project with Servlet 3.1 fails like so:

Caused by: java.lang.IllegalArgumentException: The value '3.1' is not a valid enumerator of 'WebAppVersionType'
	at org.eclipse.jst.javaee.web.internal.impl.WebFactoryImpl.createWebAppVersionTypeFromString(WebFactoryImpl.java:598)
	at org.eclipse.jst.javaee.web.internal.impl.WebFactoryImpl.createFromString(WebFactoryImpl.java:128)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createFromString(XMLHelperImpl.java:1615)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1156)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2660)
	... 64 more

Could someone more familiar with WTP's usage of EMF for deployment descriptors take on the task of updating the models? The necessary schema files are attached. If someone attaches a patch with model changes, I can complete the verification.
Comment 8 Konstantin Komissarchik CLA 2013-02-01 17:26:25 EST
Please ignore the JDT pref changes in the attached patches. These changes will not be included in the next revision. I made these changes locally since the current Kepler JDT doesn't seem happy with prefs in some of our projects.
Comment 9 Konstantin Komissarchik CLA 2013-02-04 17:45:43 EST
Created attachment 226543 [details]
SourceEditing Tools Patch v2 (b72)

The v2 of this patch fixes incorrect registration of jsp schema.
Comment 10 Konstantin Komissarchik CLA 2013-02-04 17:49:56 EST
Created attachment 226544 [details]
SourceEditing Tools Patch v3 (b72)

v2 includes an unrelated incorrect change
Comment 11 Konstantin Komissarchik CLA 2013-02-07 12:39:12 EST
Carl, Chuck, et. al., would one of you be able to give me a hand with the EMF model portion of this task next week? I'd like to move forward with testing this functionality so that everything is solid well in time for EclipseCon.

> Could someone more familiar with WTP's usage of EMF for deployment descriptors 
> take on the task of updating the models? The necessary schema files are 
> attached. If someone attaches a patch with model changes, I can complete the 
> verification.
Comment 12 Konstantin Komissarchik CLA 2013-02-11 15:34:48 EST
Would it be possible to keep this work concentrated in this bug and as few patches as possible? We (Oracle) will need to create a patch for Juno SR2 based on this effort. This would be easier if the changes aren't spread out. Thanks.
Comment 13 Chuck Bridgham CLA 2013-02-11 15:52:05 EST
Hi,

We can add links to all the work to this bug(use as parent).. Carl and I are making sure we describe all the work involved here.   Especially for models / content types etc...   We are resource constrained at the moment, so planning as much as we can to see what we can contain in the short term.
Comment 14 Konstantin Komissarchik CLA 2013-02-11 15:59:20 EST
The main obstacle right now is regenerating the EMF models (Bug 400481). If you guys can take care of that one, I can take care of the rest of basic enablement under this bug. That will keep the changes concentrated and be easier on everyone.
Comment 15 Konstantin Komissarchik CLA 2013-02-20 12:42:01 EST
Any update on regenerating the EMF models? I'd like to proceed with finishing this feature.
Comment 16 Chuck Bridgham CLA 2013-02-21 12:45:39 EST
This is in plan, and Carl has started looking at models.. I expect some movement next week on this.
Comment 17 Konstantin Komissarchik CLA 2013-02-28 15:14:26 EST
Note that I am about to attach the refreshed schemas. The most significant change is the new namespace, which is now approved/final.
Comment 18 Konstantin Komissarchik CLA 2013-02-28 16:16:57 EST
Created attachment 227758 [details]
SourceEditing Tools Patch v4 (based on 2013-02-15 draft)

New patch for the common schemas plugin based on the 2013-02-15 spec draft. The most significant change is the new namespace. Note that this is missing the beans_1_1.xsd schema that is supposed to be part of the spec. I am working on locating it. This should not impact the tooling work that needs to happen.
Comment 19 Konstantin Komissarchik CLA 2013-02-28 16:29:20 EST
Created attachment 227759 [details]
SourceEditing Tools Patch v5 (based on 2013-02-15 draft)

Same as v4, but rebased to head.
Comment 20 Konstantin Komissarchik CLA 2013-02-28 16:33:20 EST
Created attachment 227761 [details]
Schemas (based on 2013-02-15 draft)

All schemas changes as of 2013-02-15 draft, minus the missing beans_1_1.xsd schema.

Note that there are more schemas in this draft than in the last draft due to the namespace change.
Comment 21 Konstantin Komissarchik CLA 2013-02-28 17:07:49 EST
Created attachment 227762 [details]
Java EE Tools Patch v2

Changes for the new namespace.
Comment 22 Konstantin Komissarchik CLA 2013-02-28 17:09:38 EST
Created attachment 227763 [details]
EJB Tools Patch v2

Changes for the new namespace.
Comment 23 Konstantin Komissarchik CLA 2013-02-28 17:11:27 EST
Created attachment 227764 [details]
EJB Tools Patch r1 v2

Excluded unnecessary preference changes.
Comment 24 Konstantin Komissarchik CLA 2013-03-01 00:54:57 EST
Created attachment 227770 [details]
Schemas (2013-02-15)

Found the missing beans_1_1.xsd schema. The latest draft comes from here:

https://github.com/jboss/cdi/blob/master/api/src/main/resources/beans_1_1.xsd
Comment 25 Konstantin Komissarchik CLA 2013-03-01 00:57:51 EST
Created attachment 227772 [details]
SourceEditing Tools Patch r1 v6

Now with beans.
Comment 26 Konstantin Komissarchik CLA 2013-03-04 13:31:23 EST
Nick,

Could you or another committer on the source editing project release the attached patch to the common schemas plugin that includes the most recent draft of all Java EE 7 schemas? The two CQs covering these schemas have been given preliminary approval under the parallel IP process.
Comment 27 Nick Sandonato CLA 2013-03-05 14:05:29 EST
Hi Konstantin,

I've pushed and released the changes.
http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=851f28e8cd21b19788b3097c59436b5662c78ce6
Comment 28 Carl Anderson CLA 2013-03-06 13:53:26 EST
Konstantin,

One thing I learned recently is that any schemas added to org.eclipse.jst.standard.schemas needs to be listed in the about.html file, just as the current ones are listed.  Nick has already committed the SourceEditing Tools patch v6, so can you provide a separate patch with the about.html updates?
Comment 29 Konstantin Komissarchik CLA 2013-03-06 13:54:52 EST
> can you provide a separate patch with the about.html updates

Will do. Thanks for pointing this out.
Comment 30 Konstantin Komissarchik CLA 2013-03-06 18:01:14 EST
Created attachment 228033 [details]
SourceEditing Tools Patch r2 v1

Second round of changes for the common schemas bundle. Includes the following changes:

1. About.html references the added schemas. In fact, I re-wrote the file to better organize the listings. Now, all files are presented in a simple list organized by license and revision. All listings are linked to source.

2. Re-organized the catalog registrations in plugin.xml to group all by schema revisions and list schemas alphabetically. This makes verification of completeness and updating easier.

3. Fixed several typos that resulted in incorrect schema registrations.

4. Added secondary listings for all previous schema revisions pointing to "http://xmlns.jcp.org". While we will obviously continue to see "http://java.sun.com", I would be surprised if we don't see new pre-JavaEE7 applications referencing the new URLs.

Nick, could you do the honors again and release this patch? Thanks.
Comment 31 Carl Anderson CLA 2013-03-12 13:11:11 EDT
Konstantin, there is no jst.connector 1.7 facet defined in all of this.  We'll need new facets for all of the versions that are now in the xsds.  (And the 1.7 connector facet is listed in IJ2EEFacetConstants- that causes an initialization error).
Comment 32 Carl Anderson CLA 2013-03-12 13:22:01 EDT
It looks like adding in jst.connector 1.7 and jst.webfragment 3.1 were enough to get the JUnits running, but we should have facets defined for all of the Java EE 7 that we are supporting.  (And there were a lot of new versions added in the latest XSDs.)
Comment 33 Konstantin Komissarchik CLA 2013-03-12 13:25:26 EDT
The other versions should already be there. The webfragment was an oversight in the initial patch. The connector was missed in the last update. Initially, connector schema didn't rev.

There could be other gotchas, since I wasn't able to actually run and test any of these changes without the model changes. If model changes are ready, could you attach a patch and I will help with testing.
Comment 34 Nick Sandonato CLA 2013-03-13 15:35:54 EDT
(In reply to comment #30)
> Created attachment 228033 [details]
> SourceEditing Tools Patch r2 v1
> 
> ...

Hey Konstantin,

Sorry for the delay. I wasn't able to apply this patch cleanly. The patch to plugin.xml has some conflicts that caused problems. I can go ahead and update the about.html for now, and we can work on cleaning up the plugin.xml in another patch, if you'd like.
Comment 35 Konstantin Komissarchik CLA 2013-03-13 15:43:59 EDT
Created attachment 228379 [details]
SourceEditing Tools Patch r2 v2

Try this one. I didn't see any merge conflicts in the file, but I fetched, rebased and generated a new patch.
Comment 36 Nick Sandonato CLA 2013-03-13 16:05:51 EDT
(In reply to comment #35)
> Created attachment 228379 [details]
> SourceEditing Tools Patch r2 v2
> 
> Try this one. I didn't see any merge conflicts in the file, but I fetched,
> rebased and generated a new patch.

Weird, it still doesn't apply cleanly either through command-line or the eGit UI. I'm not sure if there's something else we can try. Maybe create a patch through git format-patch?

I pushed the changes for the about.html http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=f2a3503e375c46ec3171304dfd00ab405ecdb27b
Comment 37 Konstantin Komissarchik CLA 2013-03-13 16:08:56 EDT
Created attachment 228382 [details]
SourceEditing Tools Patch r2 v2 (plugin.xml)

How about I just attach the file I have.
Comment 38 Nick Sandonato CLA 2013-03-13 17:31:35 EDT
(In reply to comment #37)
> Created attachment 228382 [details]
> SourceEditing Tools Patch r2 v2 (plugin.xml)
> 
> How about I just attach the file I have.

That works for me. Thanks!

http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=fccc47df725ab9ee2a44a52cad93dbd61c9f72f2
Comment 39 Carl Anderson CLA 2013-03-14 13:48:40 EDT
Committed to master for WTP 3.5.0 M6

Note that there were additional changes made to jst.connector and jst.webfragment above and beyond the contents of Java EE Tools Patch v2
Comment 40 Konstantin Komissarchik CLA 2013-03-15 01:06:18 EDT
Created attachment 228456 [details]
EJB Tools Patch r2 v1

A few facet fixes on top of the first round of changes to EJB Tools.
Comment 41 Konstantin Komissarchik CLA 2013-03-15 01:06:59 EDT
Re-opening to track applying the remaining patch.
Comment 42 Carl Anderson CLA 2013-03-15 10:52:01 EDT
Committed EJB Tools Patch r1 v1 (which really was part of the fix for bug 400488 )
Comment 43 Konstantin Komissarchik CLA 2013-04-09 17:10:37 EDT
http://git.eclipse.org/c/jeetools/webtools.javaee.git/commit/?id=bf11650f409a4e21e763e31f32aecda1fe43b1bd

The moduleFactories were not updated, so "Run on Server" and related actions aren't available on Java EE 7 projects.

Could someone tag and release these changes into the build? I am not quite sure how that is supposed to work with Git these days.
Comment 44 Roberto Sanchez Herrera CLA 2014-12-19 13:20:42 EST
*** Bug 400487 has been marked as a duplicate of this bug. ***