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

5

20

I have a project that I have just imported from CVS. It is working in several dozen other developers IDE, but in my case, it is reporting a problem:

CHKJ3000E: WAR Validation Failed: com.ibm.etools.j2ee.commonarchivecore.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml

Googling for this suggests its an issue with the way Eclipse loads the context. For some users, cleaning the project works. It didn't for me.

Any ideas on what I could attempt next to resolve it?

Muro answered 30/10, 2012 at 16:54 Comment(0)
F
7

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.

Filing answered 30/10, 2012 at 17:21 Comment(1)
how do I clean eclipse cache? the link you provided does not work anymore...Scissile
S
64

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/

Swaddle answered 22/4, 2014 at 18:53 Comment(5)
and then refresh the project! (F5 in eclipse)Vibration
Loooooooooooooool. Seriously this is the most simple solution and worked so well. I've searched through all sources, with complicated solutions, nothing works, except this. This is why I hate eclipse. Working with it bring us too many bloatware and components.Boston
Worked like a charm. Thanks!Crepitate
This seems to works, but the next build makes it come back! For example when I call >Gradle >Refresh Gradle Project...Eradis
aha... nice. but any reason why it happens ?Dempster
F
7

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.

Filing answered 30/10, 2012 at 17:21 Comment(1)
how do I clean eclipse cache? the link you provided does not work anymore...Scissile
E
3

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.

Eradis answered 2/12, 2017 at 18:38 Comment(0)
S
2

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.

Suk answered 3/3, 2020 at 11:15 Comment(0)
E
0

check this below image enter image description here

changing 1.8 to 11 works for me

Entrain answered 16/6 at 13:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.