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

Bug 332526

Summary: ZipException occurs if I remove any JAR from WEB-INF/lib when the target server is running.
Product: [WebTools] WTP Java EE Tools Reporter: Rob Stryker <stryker>
Component: jst.j2eeAssignee: Rob Stryker <stryker>
Status: NEW --- QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Rob Stryker CLA 2010-12-14 09:55:22 EST
1. Create a dynamic web project, make sure some libs live inside WEB-INF/lib, physically inside the folder. 
2. Deploy the project to a JBoss AS, even using a generic server
3. Start the server
4. Remove any JAR from WEB-INF/lib folder
5. I get a lot of IOExceptions and the project is not built anymore
6. Stopping server/re-building project doesn't help. Lots of JDT code fails with errors
7. Only restarting Eclipse can help.

I suspect this may be because of the murky relationship between things that live inside web-inf/lib, and the classpath containers that manage them and look for them on occasion. 

Here are the exceptions (a lot of them):

org.eclipse.core.runtime.CoreException: I/O exception
    at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2524)
    at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:152)
    at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren(JarPackageFragmentRoot.java:78)
    at org.eclipse.jdt.internal.core.JavaProjectElementInfo.initializePackageNames(JavaProjectElementInfo.java:252)
    at org.eclipse.jdt.internal.core.JavaProjectElementInfo.getProjectCache(JavaProjectElementInfo.java:225)
    at org.eclipse.jdt.internal.core.JavaProjectElementInfo.newNameLookup(JavaProjectElementInfo.java:290)
    at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2282)
    at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:57)
    at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:64)
    at org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>(CancelableNameEnvironment.java:26)
    at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:162)
    at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:255)
    at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:190)
    at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
    at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
    at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244)
    at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
    at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
    at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
    at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:178)
    at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
    at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:133)
    at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:105)
    at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:398)
    at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:173)
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:114)
    at java.util.zip.ZipFile.<init>(ZipFile.java:131)
    at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2518)
    ... 27 more 

Link: https://issues.jboss.org/browse/JBIDE-7472
Comment 1 Carl Anderson CLA 2011-05-24 00:34:18 EDT
Rob, everything here looks like just JDT code.  I am assigning this to you for further investigation... unless you find otherwise, you probably want to send this down to the JDT team for their investigation.