Bug 222665 - Error opening workbench
Summary: Error opening workbench
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 16:43 EDT by Cristián Yáñez CLA
Modified: 2008-08-28 12:17 EDT (History)
2 users (show)

See Also:


Attachments
Test Project (14.15 KB, application/zip)
2008-04-14 16:54 EDT, Cristián Yáñez CLA
no flags Details
Proposed fix and regression test (3.10 KB, patch)
2008-05-19 06:44 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cristián Yáñez CLA 2008-03-13 16:43:46 EDT
-- Error Log --
Date: Thu Mar 13 16:40:46 CLT 2008
Message: Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui".
Severity: Error
Plugin ID: org.eclipse.jdt.ui
Stack Trace:
java.lang.ClassCastException: org.eclipse.jdt.internal.core.JarEntryFile
	at org.eclipse.jdt.internal.core.JarPackageFragment.computeNonJavaResources(JarPackageFragment.java:117)
	at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren(JarPackageFragmentRoot.java:105)
	at org.eclipse.jdt.internal.core.JavaProjectElementInfo.initializePackageNames(JavaProjectElementInfo.java:248)
	at org.eclipse.jdt.internal.core.JavaProjectElementInfo.getProjectCache(JavaProjectElementInfo.java:221)
	at org.eclipse.jdt.internal.core.JavaProjectElementInfo.newNameLookup(JavaProjectElementInfo.java:285)
	at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2201)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:53)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:67)
	at org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>(CancelableNameEnvironment.java:26)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:505)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:867)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:651)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:609)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:602)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:514)
	at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:155)
	at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:140)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Olivier Thomann CLA 2008-03-14 08:20:15 EDT
It would be interesting to get:
- build id
- steps to reproduce (setup of your project)
Comment 2 Cristián Yáñez CLA 2008-03-14 09:20:06 EDT
*** Platform Details:

*** System properties:
awt.toolkit=sun.awt.windows.WToolkit
eclipse.buildId=M20080221-1800
eclipse.commands=-os
win32
-ws
win32
-arch
x86
-showsplash
C:\cyanez\eclipse\\plugins\org.eclipse.platform_3.3.3.r33x_r20080129\splash.bmp
-launcher
C:\cyanez\eclipse\eclipse.exe
-name
Eclipse
--launcher.library
C:\cyanez\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.3.R33x_v20080118\eclipse_1023.dll
-startup
C:\cyanez\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-vm
C:\cyanez\jdk1.5.0_15\jre\bin\server\jvm.dll
eclipse.ee.install.verify=false
eclipse.product=org.eclipse.platform.ide
eclipse.startTime=1205500438765
eclipse.vm=C:\cyanez\jdk1.5.0_15\jre\bin\server\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
-Xms90m
-Xmx512m
-XX:MaxPermSize=256M
-Djava.class.path=C:\cyanez\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
eof=eof
...
Comment 3 Cristián Yáñez CLA 2008-03-14 09:48:07 EDT
Here are the steps:

 - Unzip eclipse-jee-europa-winter-win32.zip.
 - Configure vm arguments (this step is optional, using default arguments has the same result)
 - Open eclipse and create a new workspace
 - Configure Maven repository's variable (or install m2 plugin 0.0.12.20071107-2300 using update manager)
 * (The critical step) Import my proyect into workspace (selecting copy option) from a previos eclipse (version: 3.2.2 build id: M20070212-1330)
 - After importing was finish and my project started to build ("build automatically" option is selected) the ClassCastException was thrown.

Now if I open the workbench or simple roll the cursor over any method of my java classes, I get the same exception over and over.

My original proyect is configured with maven2, subversion, spring and xfire and it still working on the "old" eclipse 3.2

   Cristián.
Comment 4 Jerome Lanneluc CLA 2008-04-08 10:46:50 EDT
Unfortunately we don't have your project (critical steps), so it is impossible for  us to reproduce the problem. Looking at the code, I don't see how this can happen. Ideally we would need a small project that reproduce the problem and that you would attach to this bug report. Without more information, there is not much we can do.
Comment 5 Cristián Yáñez CLA 2008-04-14 16:54:59 EDT
Created attachment 95999 [details]
Test Project

Hi again.

   Finally I created a little project to reproduce the bug. I guess the problematic file is a custom jar named security-1.1.jar, so I added to the zip file (with its source code) and referenced into the project.

   I hope this help.

      Cristián
Comment 6 Jerome Lanneluc CLA 2008-04-14 17:54:07 EDT
Thanks for the test case. I was able to reproduce the ClassCastException by expanding security-1.1.jar in the Package Explorer.

It looks like this jar contains an entry named 'META-INF' that claims to be a file (and not a directory as one could expect).

I will investigate a workaround for this kind of unconventional jar.
Comment 7 Jerome Lanneluc CLA 2008-05-19 06:44:19 EDT
Created attachment 100884 [details]
Proposed fix and regression test
Comment 8 Jerome Lanneluc CLA 2008-05-20 06:19:10 EDT
Since this is not a regression comparing to 3.3.2, will target 3.5
Comment 9 Jerome Lanneluc CLA 2008-06-23 09:15:22 EDT
Fix and test released for 3.5M1.

Will backport to 3.4.1 since this is an exception and there is no workaround.
Comment 10 Jerome Lanneluc CLA 2008-06-24 10:08:06 EDT
Fix and test released for 3.4.1
Comment 11 Olivier Thomann CLA 2008-08-06 12:29:11 EDT
Verified for 3.5M1 using I20080805-1307
Comment 12 Olivier Thomann CLA 2008-08-06 13:29:58 EDT
Reopen to close as RESOLVED/FIXED. Will be closed as VERIFIED during 3.4.1
verification pass.
Comment 13 Olivier Thomann CLA 2008-08-06 13:30:25 EDT
Fixed.
Comment 14 Frederic Fusier CLA 2008-08-28 12:17:20 EDT
Verified for 3.4.1 using build M20080827-2000.