Eclipse (actually RAD) throwing WAR validation error (CHKJ3000E) on project

Like others have already mentioned, this error seems to be coming back in Gradle-projects using the WAR plugin over and over again when the project is refreshed by Gradle or even otherwise, simply because it has been changed outside of Eclipse. While validating the project in Eclipse works, this is only a temporary workaround until the next refresh of the project. I've already cleaned every caches I could find and stuff, so doubt this has anything to with those.

Looking at the view for errors in Eclipse, there's an additional stacktrace available making things a bit clearer:

org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
Stack trace of nested exception:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException: platform:/resource/de.am_soft.sm_mtg.frontend/WEB-INF/web.xml
    at org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getRoot(ArchiveUtil.java:442)
    at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.XmlBasedImportStrategyImpl.primLoadDeploymentDescriptor(XmlBasedImportStrategyImpl.java:42)
    at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.War22ImportStrategyImpl.loadDeploymentDescriptor(War22ImportStrategyImpl.java:90)
    at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.War22ImportStrategyImpl.importMetaData(War22ImportStrategyImpl.java:84)
    at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:146)
    at org.eclipse.jst.j2ee.model.internal.validation.WarValidator.validateInJob(WarValidator.java:334)
    at org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator.validateInJob(UIWarValidator.java:113)
    at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:78)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

platform:/resource is documented like the following by Eclipse:

It is used to identify a resource located in the workspace. The next path segment after "resource" should be the name of a project, which can be followed by the folder and/or file we want to locate.

So for some reason the validator expects WEB-INF/web.xml being available in the root of the Eclipse-project, which doesn't make much sense to me: It has never been there in the past and putting it there doesn't resolve the error as well. Instead, Eclipse logs 20 new errors without any additional messages or stacktraces and I can't get rid of those anymore even after deleting WEB-INF/web.xml, therefore restoring the former project state.

Similar errors have been reported for Eclipse projects in their bugtracker.

!ENTRY org.eclipse.wst.validation 4 0 2007-08-28 12:00:39.515
!MESSAGE 
*** ERROR ***: Tue Aug 28 12:00:39 EDT 2007    org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
    Stack trace of nested exception:
    org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException: platform:/resource/ARBankLogWeb/WebContent/WEB-INF/web.xml

My project was migrated from native Eclipse to Gradle with the WAR-plugin and the latter allows manually defining web.xml. So I tried that, but didn't change a thing as well:

war
{
    webXml = file('src/main/webapp/WEB-INF/web.xml')
}

So whatever the problem with the validator is for some project setups, the only workaround I could find reliably working currently is disabling it per project:

Disabled web-validator.

This makes Eclipse create a local settings file storing that setting within the project directory and that can be put under version control like other parts of the project. That way the setting will be available by all users of the project instantly. The following is an example of how things look like for me:

$PROJECT_NAME.settings\org.eclipse.wst.validation.prefs

DELEGATES_PREFERENCE=delegateValidatorList
USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.800.v201904082137

While additionally storing those settings in theory is against why one uses Gradle, because that should be able to generate those files when creating the project for Eclipse, it's the easiest way to make those settings available and their state documented using the SCM without implementing too much in build.gradle.

Might be a good idea to vote on the bug in the Eclipse-bugtracker as well.


This is a common problem and is because of cache maintained by eclipse.

Try clearing cache of plugins and doing a full clean ,you can also delete the existing server and create a new one.

Refer here for more details , see people gave faced similar issue and clean and removing cache and restarting stuff like this have solved it for them.


Eclipse > Project Explorer > Right click on the project with the error > Validate

enter image description here

That worked for me!

I had the same error message for a few projects and did the same procedure for each of them and now all of them are fixed.

Related link: http://viralpatel.net/blogs/eclipse-this-project-needs-to-migrate-wtp-metadata/


I have found that the >Validate option (see above) only works until the next build. It's very likely that validation as part of a build has issues (for Web projects), while validation on its own works OK.

In order to deal with this issue, this has worked for me in a consistent way:

Project >Properties >Validation: Web (xxx) Validator

Here, disable Build, but leave Manual enabled.

Now, when a new build is triggered (eg. when I call >Gradle >Refresh Gradle Project), the project doesn't get the validation error.