Community
Participate
Working Groups
Build Identifier: I20110524-2200 I'm getting 4 exceptions during the File->New Java Project and only after pressing the first Next button. These are seen only in Error Log (view). They are all titles the same: `Error while decoding JRE entry` Eclipse SDK Version: 4.1.0 Build id: I20110524-2200 eclipse.buildId=I20110524-2200 java.version=1.6.0_25 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86_64 here are the exceptions in the order of occurrence: ============= java.lang.NumberFormatException: For input string: "container" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:449) at java.lang.Integer.parseInt(Integer.java:499) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.decodeJRELibraryClasspathEntries(NewJavaProjectPreferencePage.java:145) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.getDefaultJRELibrary(NewJavaProjectPreferencePage.java:102) at org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(PreferenceConstants.java:4004) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageOne.getDefaultClasspathEntries(NewJavaProjectWizardPageOne.java:1289) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.initializeBuildPath(NewJavaProjectWizardPageTwo.java:304) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.updateProject(NewJavaProjectWizardPageTwo.java:252) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.access$2(NewJavaProjectWizardPageTwo.java:200) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo$1UpdateRunnable.run(NewJavaProjectWizardPageTwo.java:161) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) ---------------- java.lang.NumberFormatException: For input string: "org.eclipse.jdt.launching.JRE_CONTAINER" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:449) at java.lang.Integer.parseInt(Integer.java:499) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.decodeJRELibraryClasspathEntries(NewJavaProjectPreferencePage.java:145) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.getDefaultJRELibrary(NewJavaProjectPreferencePage.java:102) at org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(PreferenceConstants.java:4004) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageOne.getDefaultClasspathEntries(NewJavaProjectWizardPageOne.java:1289) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.initializeBuildPath(NewJavaProjectWizardPageTwo.java:304) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.updateProject(NewJavaProjectWizardPageTwo.java:252) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.access$2(NewJavaProjectWizardPageTwo.java:200) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo$1UpdateRunnable.run(NewJavaProjectWizardPageTwo.java:161) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) ---------------------------- java.lang.NumberFormatException: For input string: "#" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:449) at java.lang.Integer.parseInt(Integer.java:499) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.decodeJRELibraryClasspathEntries(NewJavaProjectPreferencePage.java:145) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.getDefaultJRELibrary(NewJavaProjectPreferencePage.java:102) at org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(PreferenceConstants.java:4004) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageOne.getDefaultClasspathEntries(NewJavaProjectWizardPageOne.java:1289) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.initializeBuildPath(NewJavaProjectWizardPageTwo.java:304) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.updateProject(NewJavaProjectWizardPageTwo.java:252) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.access$2(NewJavaProjectWizardPageTwo.java:200) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo$1UpdateRunnable.run(NewJavaProjectWizardPageTwo.java:161) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) ------------------- and the last one: java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:332) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.decodeJRELibraryClasspathEntries(NewJavaProjectPreferencePage.java:145) at org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.getDefaultJRELibrary(NewJavaProjectPreferencePage.java:102) at org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(PreferenceConstants.java:4004) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageOne.getDefaultClasspathEntries(NewJavaProjectWizardPageOne.java:1289) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.initializeBuildPath(NewJavaProjectWizardPageTwo.java:304) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.updateProject(NewJavaProjectWizardPageTwo.java:252) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo.access$2(NewJavaProjectWizardPageTwo.java:200) at org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageTwo$1UpdateRunnable.run(NewJavaProjectWizardPageTwo.java:161) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) ================== Let me know what else (info) you need so I can provide, thanks! Reproducible: Always Steps to Reproduce: 1. Window->Show View->Error Log 2. File->New->Java Project 3. press Next once there should now be 4 errors titles the same: Error while decoding JRE entry
Works fine fore me. Can you provide steps starting with a new workspace? Or can you attach your workspace here?
Created attachment 196657 [details] org.eclipse.jdt.launching.prefs this file: org.eclipse.jdt.launching.prefs located in: workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings
Sorry but this doesn't help. We either need steps to reproduce the problem or a workspace where we can investigate the issue.
ok, I will see what I can do about packing up the workspace ... :)
Alrightie then, here's steps to reproduce: 0. Window->Show View->Error Log 1. switch to a new never-before-created workspace, do not copy settings from current one (obviously xD) 2. File->New->Java Project give project a name ie. "x" 3. JRE: select `Use default JRE (currently 'jdk1.6.0_25') 4. press Next at this point there should be 4 errors in Error Log (as described above) (no need to press Finish to create the project) let me know if this isn't enough, I also include the new (since it's different) org.eclipse.jdt.launching.prefs as attachment I don't think you'd need the workspace to reproduce this, but you'd probably(?) need at least(and maybe only) jdk6u25
Created attachment 196660 [details] org.eclipse.jdt.launching.prefs workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings
Thanks! I can reproduce now.
feel free to ignore this comment, it's mostly for stating the obvious --- also note, if you miss step 3, thus you'll be using the defaults: JRE: `Use and execution environment JRE: JavaSE-1.6` then the bug/error will not appear, and apparently the last selected option remains set for all future `new java project` wizards, thus I failed to specify the defaults(that were on my computer, considering it remembers the last selected ones) which I will do so now: Project name: can be anything (checked) Use default location: JRE: (selected) Use default JRE (currently 'jdk1.6.0_25') Project layout: (selected) Create separate folders for sources and class files Working sets: (unchecked) Add project to working sets
Caused by fix for bug 338673.
Created attachment 196665 [details] Fix
Created attachment 196750 [details] Fix 2 (revert bug 338673) (In reply to comment #10) > Created attachment 196665 [details] [diff] > Fix The fix is problematic, since it still doesn't restore the symmetry between the encode and decode operations. E.g. when the UI string contains a + or something like %x, then the decoding with the URLEncoder can return wrong results or even fail with an IAE. Discussed this with Dani, and we think the safest fix at this point is to revert bug 338673 completely. That scenario is unlikely to happen in the real world. Users who work in a localized version of Eclipse that uses multi-byte characters typically also have a platform encoding that supports multi-byte characters (and then bug 338673 doesn't appear at all).
I'll reopen bug 338673. Dani & Deepak, can you please review Fix 2 (which just reverts to NewJavaProjectPreferencePage.java 1.33)?
I think that's the safest fix at this point. +1 for RC4.
+1. Though you could leave in the changes to the comments.
> +1. Though you could leave in the changes to the comments. Yeah, but we're already in RC4, so reverting the whole file seems safer.
RISK: Very low. We revert the code to the pre-3.7M7 state. This brings back bug 338673, but that's a minor problem that we don't think will show up in practice (see bug 338673 comment 6). Mike, can you please give the last +1?
+1 looks good. I did notice the addition of '//AW' at the top of the patch, not sure if that is intentional or not.
Committed to HEAD.
Verified in I20110602-1051.