Gradle eclipse - CHKJ3008E: Missing or invalid WAR file


(Frank San Miguel) #1

Congratulations on releasing gradle 1.0!

I’m having a problem importing eclipse projects using the latest eclipse jee distribution (europa-winter). It works fine from SpringSource Tool Suite (STS). Has anyone seen this before?

Environment: * gradle 1.0 * latest eclipse JEE distribution (Version: 3.3.2, Build id: M20080221-1800) * Windows XP, SP2 * Sun JDK 6.0.31

Steps to reproduce: * create the simplest possible web project

src/main/java/SimpleServlet.java

src/main/webapp/WEB-INF/web.xml

build.gradle

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
  version = '1.0'
  repositories {
    'http://maven.springframework.org/release'
    mavenCentral()
}
  dependencies {
    providedCompile 'javax.servlet:servlet-api:2.5'
 }
  • do gradle eclipse * import the project into eclipse.

Actual results: * the project doesn’t build because I get an error “CHKJ3008E: Missing or invalid WAR file.” * Error log has 11 exceptions. The first one is:

java.lang.NullPointerException at org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator.validateVirtualComponentEntry(ClasspathDependencyValidator.java:264) at org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil.isValid(ClasspathDependencyUtil.java:122) at org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil.getComponentClasspathDependencies(ClasspathDependencyUtil.java:169) at org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil.getComponentClasspathDependencies(ClasspathDependencyUtil.java:144) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getJavaClasspathReferences(J2EEModuleVirtualComponent.java:179) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getNonManifestReferences(J2EEModuleVirtualComponent.java:116) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:83) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:79) at org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager.getDependencyReferences(DependencyGraphManager.java:200) at org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager.buildDependencyGraph(DependencyGraphManager.java:176) at org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager.constructIfNecessary(DependencyGraphManager.java:77) at org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager.getDependencyGraph(DependencyGraphManager.java:252) at org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent.getReferencingComponents(VirtualComponent.java:430) at org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata$RefererCachingVirtualComponent.(ProjectRefactorMetadata.java:354) at org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata.computeMetadata(ProjectRefactorMetadata.java:88) at org.eclipse.jst.j2ee.refactor.operations.ProjectRefactorMetadata.computeMetadata(ProjectRefactorMetadata.java:78) at org.eclipse.jst.j2ee.refactor.listeners.ProjectRefactoringListener.cacheDeletedProjectMetadata(ProjectRefactoringListener.java:100) at org.eclipse.jst.j2ee.refactor.listeners.ProjectRefactoringListener.resourceChanged(ProjectRefactoringListener.java:87) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276) at org.eclipse.core.internal.events.NotificationManager.handleEvent(NotificationManager.java:260) at org.eclipse.core.internal.resources.Workspace.broadcastEvent(Workspace.java:305) at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1662) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:700) at org.eclipse.core.internal.resources.Project.delete(Project.java:289) at org.eclipse.ui.ide.undo.WorkspaceUndoUtil.delete(WorkspaceUndoUtil.java:578) at org.eclipse.ui.ide.undo.WorkspaceUndoUtil.delete(WorkspaceUndoUtil.java:172) at org.eclipse.ui.ide.undo.AbstractResourcesOperation.delete(AbstractResourcesOperation.java:111) at org.eclipse.ui.ide.undo.DeleteResourcesOperation.doExecute(DeleteResourcesOperation.java:67) at org.eclipse.ui.ide.undo.AbstractWorkspaceOperation$1.run(AbstractWorkspaceOperation.java:206) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797) at org.eclipse.ui.ide.undo.AbstractWorkspaceOperation.execute(AbstractWorkspaceOperation.java:204) at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511) at org.eclipse.ui.actions.DeleteResourceAction$4.run(DeleteResourceAction.java:538) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

NOTES: * after googling this error, I found a few suggestions to remove war file validation. This allows the project to build, but when I try to run the project within eclipse using a tomcat 6.0 server (external install), it fails with a null pointer exception.

java.lang.NullPointerException at org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator.validateVirtualComponentEntry(ClasspathDependencyValidator.java:264) at org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil.isValid(ClasspathDependencyUtil.java:122) at org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil.getComponentClasspathDependencies(ClasspathDependencyUtil.java:169) at org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil.getComponentClasspathDependencies(ClasspathDependencyUtil.java:144) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getJavaClasspathReferences(J2EEModuleVirtualComponent.java:179) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getNonManifestReferences(J2EEModuleVirtualComponent.java:116) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:83) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:79) at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.addReferencedComponentClasspathDependencies(J2EEFlexProjDeployable.java:678) at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.members(J2EEFlexProjDeployable.java:186) at org.eclipse.wst.server.core.internal.ModulePublishInfo.getDelta(ModulePublishInfo.java:342) at org.eclipse.wst.server.core.internal.ServerPublishInfo.getDelta(ServerPublishInfo.java:360) at org

(Frank San Miguel) #2

FYI, I tried it with eclipse Juno (4.2) and it works fine so it seems to be an issue with eclipse europa-winter.