Closed GoogleCodeExporter closed 8 years ago
The script id is
"/Users/andy/calipso/node_modules/winston/lib/winston/config.js". I don't see
how it could make a problem.
Unfortunately in line ResourceManager.java:92 cause exception is lost.
Correct source line should be
"throw new RuntimeException("Failed to add script " + id, e);"
Do you think you could recompile with this fix? Or simply see what happens in
debugger?
(See http://code.google.com/p/chromedevtools/wiki/HowToDebug )
Or I could prepare a quick patch for you that does it. Which one should be
better for you?
Original comment by peter.ry...@gmail.com
on 12 Mar 2012 at 12:09
I don't currently have my eclipse debugger setup to debug the plugins but if it
would help I can do that. Currently I am spending time on the project which is
causing this error but would like to help with the debug stubs as well. However
how does the RuntimeException change fix the problem? I don't quite understand
because winston/config.js is just a normal javascript file.
Original comment by richt...@gmail.com
on 12 Mar 2012 at 1:00
RuntimeException won't fix the problem, but we will know what the problem is.
This in turn should help us fix it :)
Let me prepare a test patch for you.
Original comment by peter.ry...@gmail.com
on 12 Mar 2012 at 1:15
This is patch. You should try to run Eclipse from the command line with the
additional parameter, like this:
<eclipse-dir>/Eclipse.app/Contents/MacOs/eclipse -dev <full_path_to_patch_jar>
This executable name is specific for Mac. Please not that jar must be specified
by a full path, even if it's in the current directory.
The patch does nothing but adds a missing cause exception. I cannot guess what
it could be. It can be easily an NPE for a one. Please reproduce the problem
and send me a new stacktrace with the cause.
I hope the patch works.
Original comment by peter.ry...@gmail.com
on 12 Mar 2012 at 1:23
Attachments:
What's weird is that the 'scripts that can't be added' are in fact in
certain stack traces when you step through the code. There are several
files which error out this way but they did not have any similarities
to make this obvious.
The runtime error does have the file in question.
Andy
Original comment by richt...@gmail.com
on 12 Mar 2012 at 1:25
Cool, i will test tomorrow
Andy
Original comment by richt...@gmail.com
on 12 Mar 2012 at 1:26
Here is the underlying error:
org.eclipse.core.internal.resources.ResourceException: A resource exists with a
different case: '/New_configuration/Config.js.chromium'.
There are different cased resources in my project. They should show up as
"config.js" and "Config.js (1)" as they do for same cased resources. I
downloaded the PDE and I am debugging the problem. I'll let you know.
Original comment by richt...@gmail.com
on 12 Mar 2012 at 7:32
The problem seems to be that the Container (i.e.
org.eclipse.core.internal.resources.Container).getFile function will return a
file to be nonexistent if the case is different yet prevent adding another file
with different case. In my mind this is an eclipse problem. The only thing I
could image is to catch the error and treat it by appending some string to make
the filename unique. A quick fix would be to do the following:
UniqueKeyGenerator.Factory<IFile> factory =
new UniqueKeyGenerator.Factory<IFile>() {
public IFile tryCreate(String uniqueName) {
String filePathname = uniqueName + CHROMIUM_EXTENSION_SUFFIX;
IFile file = handler.getFile(container, filePathname);
if (file.exists()) {
return null;
}
try {
file.create(new ByteArrayInputStream("".getBytes()), false, null); //$NON-NLS-1$
} catch (CoreException e) {
if (e.getMessage().contains("different case"))
return null;
throw new RuntimeException(e);
}
return file;
}
};
This seems to work with my preliminary testing.
Andy
Original comment by richt...@gmail.com
on 12 Mar 2012 at 7:55
Here is the plugin with the fix.
Original comment by richt...@gmail.com
on 12 Mar 2012 at 8:40
Attachments:
Andy, thank you very much for reporting and investigating this bug. The fix
should be ready soon. I guess you don't need a patch, since your fix should be
fine. Let me know if you still need a patch though.
Original comment by peter.ry...@gmail.com
on 13 Mar 2012 at 12:24
Fixed in HEAD
Original comment by peter.ry...@gmail.com
on 14 Mar 2012 at 5:56
Fixed in 0.3.6
Original comment by peter.ry...@gmail.com
on 2 Jul 2012 at 6:21
Original issue reported on code.google.com by
richt...@gmail.com
on 11 Mar 2012 at 5:36