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

Bug 351360

Summary: java.lang.NoClassDefFoundError for IJ2EEFacetConstants
Product: [WebTools] Java Server Faces Reporter: Alex Blewitt <alex.blewitt>
Component: UIAssignee: Ian Trimble <ian.trimble>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: milesparker, raghunathan.srinivasan, thatnitind
Version: 3.3   
Target Milestone: 3.4.0 M6   
Hardware: PC   
OS: All   
Whiteboard:

Description Alex Blewitt CLA 2011-07-06 14:08:54 EDT
When I have a plain web project in an Eclipse runtime which has WST but not JST components defined, I get a build error with a class not found issue:

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants
	at org.eclipse.jst.j2ee.project.facet.EarFacetValidator.validate(EarFacetValidator.java:53)
	at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectValidationBuilder.build(FacetedProjectValidationBuilder.java:132)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

-- Configuration Details --
Product: Eclipse SDK 3.7.0
Installed Features:
wst.web_ui 3.3.0
wst.xml_ui 3.3.0
wst.server_ui 3.3.0
wst.server_3.2
Comment 1 Nitin Dahyabhai CLA 2011-07-06 19:01:44 EDT
Is there a "caused by" stack trace following that one, and are you sure that the org.eclipse.jst.web_core.feature isn't installed?
Comment 2 Alex Blewitt CLA 2011-07-07 05:58:43 EDT
No, the cause is the above. What's happening is that the 'build automatically' is set to true, which thus kicks off the buld manager which in turn invokes the FactedProjectValdiationBuilder.

This error can be prevented by going into the project and turning off the Faceted Project Validation Builder from the Builders of the project, though that probably has other effects.

org.eclipse.jst.web_core is not installed (I'm building up an RCP with a selection of features, and I want to have a JavaScript/HTML editor with no JSP support)
The org.eclipse.wst.web_ui.feature doesn't depend on the jst.web_core, just the wst.web_core:

http://dev.eclipse.org/viewcvs/viewvc.cgi/jeetools/features/org.eclipse.wst.web_ui.feature/feature.xml?view=markup&root=WebTools_Project

These are the features I'm installing into my RCP, based on the contents of the JavaScript editor EPP package:

      <import feature="org.eclipse.jst.webpageeditor.feature" /> 
      <import feature="org.eclipse.wst.jsdt.feature" /> 
      <import feature="org.eclipse.wst.server_adapters.feature" /> 
      <import feature="org.eclipse.wst.server_ui.feature" /> 
      <import feature="org.eclipse.wst.web_ui.feature" /> 
      <import feature="org.eclipse.wst.xml_ui.feature" /> 
      <import feature="org.eclipse.wst.xsl.feature" />
      <import feature="org.eclipse.wst.common.fproj"/>
Comment 3 Alex Blewitt CLA 2011-07-07 05:59:44 EDT
Installing JST web core drags in WST Web Services core, which I don't want either.
Comment 4 Alex Blewitt CLA 2011-07-07 10:14:41 EDT
If I remove the web page editor and the xsl feature, then I no longer get JDT installed. I then don't see this error message coming up again. I wonder if there's some part of the JST Web Page Editor that's throwing it off somehow ...

Anyway, since I am no longer including the web page editor I can't see the problem again. I'm happy for this to be closed WORKSFORME or similar, unless you want to find out why this combo of features is giving that error message.
Comment 5 Nitin Dahyabhai CLA 2011-07-11 11:55:40 EDT
(In reply to comment #2)
> org.eclipse.jst.web_core is not installed (I'm building up an RCP with a
> selection of features, and I want to have a JavaScript/HTML editor with no JSP
> support)
> 
> These are the features I'm installing into my RCP, based on the contents of the
> JavaScript editor EPP package:
> 
>       <import feature="org.eclipse.jst.webpageeditor.feature" /> 

The plug-ins from the org.eclipse.jst.webpageeditor.feature feature will pull in plug-ins from Java EE and JSP, but since the feature doesn't declare dependencies at all, your combination might be exposing issues like this.
Comment 6 Raghunathan Srinivasan CLA 2011-09-15 13:39:56 EDT
Plan to address this in Juno
Comment 7 Nitin Dahyabhai CLA 2011-09-30 14:20:27 EDT
*** Bug 359500 has been marked as a duplicate of this bug. ***
Comment 8 Ian Trimble CLA 2012-01-31 18:24:39 EST
The "org.eclipse.jst.webpageeditor.feature" feature continues to depend on WST and JST - it's just not designed to operate outside of this environment. That said, I don't see any WST or JST features declaring dependencies, so to make the web page editor feature do so would be incongruous.
Comment 9 Ian Trimble CLA 2012-02-01 13:14:41 EST
Re-open if there is disagreement.