microsoft / microsoft/vscode-java-test

failed to launch debuggee VM. Filename or Extension is too long. args too long?

Offen
#1,717 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

ai-triaged bug help wanted investigating maven test-debugging testng
Vorherrschende Sprache
TypeScript
Sterne
340
Forks
173
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
18

Beschreibung

Hi, I am trying to get our maven multi project to run in VSCode.
One Package fails and throws this error:

Juli 30, 2024 6:01:44 PM org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
Juli 30, 2024 6:01:44 PM org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
Juli 30, 2024 6:03:01 PM com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin start
INFORMATION: Starting com.microsoft.java.debug.plugin
Juli 30, 2024 6:03:01 PM com.microsoft.java.debug.plugin.internal.LogUtils configLogLevel
INFORMATION: Set log level to : FINE
Juli 30, 2024 6:03:40 PM com.microsoft.java.debug.plugin.internal.Compile compile
INFORMATION: Time cost for ECJ: 39098ms
Juli 30, 2024 6:03:40 PM com.microsoft.java.debug.core.UsageDataSession recordInfo
INFORMATION: launch debug info
Juli 30, 2024 6:03:40 PM com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler launch
INFORMATION: Trying to launch Java Program with options:
main-class: com.microsoft.java.test.runner.Launcher
args: 53015 testng (Alot of method names that I can't share. Editor says 175735 characters)
module-path: 
class-path: 
vmArgs:  "@C:\Users\simonow\AppData\Local\Temp\cp_7m7fi6jj88wslefmewdwqipfm.argfile"
[Error - 6:03:40 PM] 30.07.2024, 18:03:40 [error response][launch]: Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program "C:\Program Files\Eclipse Adoptium\jdk-11.0.24.8-hotspot\bin\java.exe" (in directory "C:\Dev\Projekte\Repos\project-name\project-name-web\project-name-web-ui"): CreateProcess error=206, Der Dateiname oder die Erweiterung ist zu lang
Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program "C:\Program Files\Eclipse Adoptium\jdk-11.0.24.8-hotspot\bin\java.exe" (in directory "C:\Dev\Projekte\Repos\project-name\project-name-web\project-name-web-ui"): CreateProcess error=206, Der Dateiname oder die Erweiterung ist zu lang
com.microsoft.java.debug.core.DebugException: Failed to launch debuggee VM. Reason: java.io.IOException: Cannot run program "C:\Program Files\Eclipse Adoptium\jdk-11.0.24.8-hotspot\bin\java.exe" (in directory "C:\Dev\Projekte\Repos\project-name\project-name-web\project-name-web-ui"): CreateProcess error=206, Der Dateiname oder die Erweiterung ist zu lang

the generated argfile has about 15k characters and starts with -ea -Dfile.encoding=UTF-8 -cp "..."

Sorry for the german in there. "Der Dateiname oder die Erweiterung ist zu lang" is basically "Filename or Extension is too long"

I tried all of the launch.json Settings for shortenCommandLine, this itteration tries it with the argfile.

I also attempted to relocate the jdk and had it at one point at C:\jdk and it didn't matter either.
I know these Tests work, since they do work in Eclipse and Intellij I am just trying to make it work in vscode.

I am assuming the extremely long args is causing the issue, since that specific project has probably most of our tests and the others seem to work.
Now how would I resolve that since it does work in other IDEs?
Also I don't think our project is that unique in the amount of tests we have, we are still a rather young project in terms of javaee development.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Windows-Startfehler mit dem im Bericht beschriebenen Maven-Multiprojekt, den TestNG-Argumenten und der generierten argfile zu reproduzieren. Lies den Startpfad rund um LaunchRequestHandler und die shortenCommandLine-Einstellungen und vergleiche dann, wie der Java-Debuggee gestartet wird, wenn die Argumentliste sehr lang ist. Erledigt ist die Aufgabe, wenn die betroffenen Tests in VS Code ohne den Windows-Längenfehler erfolgreich gestartet und debuggt werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, vscode
Bereich
testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.