1

I am using Eclipse CDT, with MinGW and under Windows XP, to developp a little C program exporting itself as a JNI-compliant DLL.

Debugging the program from the Java calls is not easy, and thus I added a "Debug" configuration to my project and a main method that tests some functions.

When I launch the debug, i get this weird Java error :

An internal error occurred during: "Launching NuanceWrapper.exe".
java.lang.IllegalArgumentException

It seems very much like it is an internal Eclipse problem. I got the stacktrace of the exception in the .log file of the .metadata folder :

!ENTRY org.eclipse.core.jobs 4 2 2011-02-04 14:08:31.531
!MESSAGE An internal error occurred during: "Launching Wrapper.exe".
!STACK 0
java.lang.IllegalArgumentException
    at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.getBundles(PackageAdminImpl.java:571)
    at org.eclipse.core.internal.runtime.InternalPlatform.getBundle(InternalPlatform.java:181)
    at org.eclipse.core.runtime.Platform.getBundle(Platform.java:1416)
    at org.springframework.ide.eclipse.core.BundleStateLocationVariableResolver.resolveValue(BundleStateLocationVariableResolver.java:32)
    at org.eclipse.core.internal.variables.DynamicVariable.getValue(DynamicVariable.java:54)
    at org.eclipse.cdt.internal.core.cdtvariables.EclipseVariablesVariableSupplier$EclipseVarMacro.loadValue(EclipseVariablesVariableSupplier.java:103)
    at org.eclipse.cdt.internal.core.cdtvariables.EclipseVariablesVariableSupplier$EclipseVarMacro.getStringValue(EclipseVariablesVariableSupplier.java:90)
    at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getLaunchEnvironment(LaunchUtils.java:385)
    at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getGDBVersion(LaunchUtils.java:281)
    at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.getGDBVersion(GdbLaunchDelegate.java:243)
    at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:129)
    at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:83)
    at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:72)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Any idea what could be the problem ? I really need this debug functionality in order to understand what is wrong in my code.

Thank you for your answers.

Dunaril
  • 2,757
  • 5
  • 31
  • 53

2 Answers2

1

I looked at the source code of the different files of your stack trace, and it seems to be a problem with your CDT project's configuration. You should check the settings here and try to change them.

One of the CDT build variables seems to be wrong. In LaunchUtils.java, line 390, var.getStringValue() is causing the issue because in this variable (var), which contains a name and an associated value, the value is null.

Hope this helps.

Dalmas
  • 26,409
  • 9
  • 67
  • 80
  • I am afraid the problem is not bound to a specific project. I tried creating a basic "Hello World" project and the same error was thrown when I launched the debug. – Dunaril Feb 08 '11 at 13:18
  • Did you try to uninstall/reinstall eclipse CDT? It's not necessarily a problem with a project variable, but any eclipse variable... What version of eclipse CDT and MinGW are you using? – Dalmas Feb 08 '11 at 14:31
  • The problem is related to an eclipse "dynamic variable", whose content is computed at runtime. In this case it throws an Exception when trying to compute it because its value is null. And this variable is related to OSGi Bundles (~= eclipse plugin)... which can be a problem with your installation. Of course an eclipse internal problem is a possibility, too. – Dalmas Feb 08 '11 at 15:13
  • I installed a fresh version of Eclipse and this version is now working. So you think it would be a compatibility problem between gdb and an Eclipse plugin ? – Dunaril Feb 08 '11 at 15:55
  • 1
    It's possible, when you download eclipse CDT the plugins folder already contains lots of stuff. It can also be a problem during an eclipse initialization or during your download, or during file extraction, causing one of the plugins to be corrupted. This is rare but your problem was unique, that's why I thought something weird happened and suggested you to reinstall... – Dalmas Feb 08 '11 at 19:35
  • Thank you very much :) Maybe the bounty was a bit excessive for such a problem but anyway - there you are ! – Dunaril Feb 09 '11 at 09:44
1

Had the same problem. the next string from the exception stack trace:

at org.springframework.ide.eclipse.core.BundleStateLocationVariableResolver.resolveValue(BundleStateLocationVariableResolver.java:32)

led me to the idea that SpringSource ToolSuite (or Spring IDE) could cause the issue. After uninstalling it and all its components the problem was gone.

Hope this helps.