Visitar URL original
vmArgs in launch.json does not accept an array of strings · Issue #778 · microsoft/vscode-java-debug · GitHub
Skip to content

vmArgs in launch.json does not accept an array of strings #778

Description

When configuring a java debugger target, in launch.json, it seems that vmArgs does not accept an array of strings. Note that I've configured vmArgs in the linux section as well.

Environment
  • Operating System: Linux
  • JDK version: 13
  • Visual Studio Code version: latest as of 2020-03-16
  • Java extension version: I've installed the java pack.
Backtrace:
java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.vmArgs
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.vmArgs
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224)
	at com.google.gson.Gson.fromJson(Gson.java:888)
	at com.google.gson.Gson.fromJson(Gson.java:953)
	at com.google.gson.Gson.fromJson(Gson.java:926)
	at com.microsoft.java.debug.core.protocol.JsonUtils.fromJson(JsonUtils.java:34)
	at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:76)
	at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:118)
	at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.lambda$new$0(AbstractProtocolServer.java:78)
	at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:60)
	at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200)
	at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.vmArgs
	at com.google.gson.internal.bind.JsonTreeReader.nextString(JsonTreeReader.java:180)
	at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:401)
	at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:389)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
	... 17 more

Activity

  1. testforstephen commented on Mar 17, 2020

    @testforstephen
    Contributor

    please share your launch.json and the version of Debugger for Java extension.

  2. abique commented on Mar 17, 2020

    @abique
    Author
    {
       // Use IntelliSense to learn about possible attributes.
       // Hover to view descriptions of existing attributes.
       // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
       "version": "0.2.0",
       "configurations": [
          {
             "type": "java",
             "name": "BitwigStudio - Debug",
             "request": "launch",
             "mainClass": "com.bitwig.flt.app.BitwigStudioMain",
             "projectName": "float-main-app",
             "cwd": "${workspaceFolder}/float/app/gui/main-app",
             "vmArgs": [
                "-ea",
                "-Xmx1024m", "-Xms256m", "-Xss24m", "-XX:MaxPermSize=256m", "-XX:-UseLoopPredicate",
             ],
             "linux": {
                "vmArgs": [
                   "-XX:ErrorFile=${HOME}/.BitwigStudio/bitwig-studio-jvm-crash.log",
                   "-DvampExecutable=${workspaceFolder}/cmake-builds/debug-64/bin/BitwigVampHost",
                   "-DvampPath=${workspaceFolder}/cmake-builds/debug-64/vamp-plugins",
                   "-DengineExecutable=${workspaceFolder}/cmake-builds/debug-64/bin/BitwigAudioEngine",
                   "-DpluginHostExecutable32=${workspaceFolder}/cmake-builds/debug-32/bin/BitwigPluginHost",
                   "-DpluginHostExecutable64=${workspaceFolder}/cmake-builds/debug-64/bin/BitwigPluginHost",
                   "-DwindowingSystems=com.bitwig.x11_windowing_system.X11WindowingSystem",
                   "-Dshow-file-dialog-command=${workspaceFolder}/float/installer/src/main/distribution-linux/bin/show-file-dialog-gtk3"
                ]
             },
          },
          {
             "type": "lldb",
             "request": "launch",
             "name": "AudioEngine",
             "program": "cmake-builds/code/bin/BitwigAudioEngine",
             "cwd": "${workspaceRoot}"
          }
       ]
    }
    
  3. abique commented on Mar 17, 2020

    @abique
    Author

    I have Debugger for Java version 0.25.1

  4. testforstephen commented on Mar 18, 2020

    @testforstephen
    Contributor

    thanks for the info. i can reproduce the issue. The reason is the debugger doesn't well handle the OS specific attribute (e.g. "linux": { "vmArgs": [] } ) in launch.json. Currently, the workaround is to remove the linux specific vmArgs first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions