<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Java Cap remote debugging not working with Java 17 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807118#M4809158</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;since it seems the output of ps on your system causes the problem, you should split up the command. First call&lt;/P&gt;&lt;P&gt;cf ssh javacap -c "ps -C java -o pid="&lt;/P&gt;&lt;P&gt;to get the pid of the java process and then&lt;/P&gt;&lt;P&gt;cf ssh javacap -c "app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd &amp;lt;pid&amp;gt; VM.start_java_debugging"&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;with &amp;lt;pid&amp;gt; being the pid of the java process. This should work.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ralf&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 06:19:21 GMT</pubDate>
    <dc:creator>former_member1243987</dc:creator>
    <dc:date>2023-08-28T06:19:21Z</dc:date>
    <item>
      <title>Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaq-p/12807113</link>
      <description>&lt;P&gt;Hello dear community,&lt;/P&gt;
  &lt;P&gt;Since our setup of our Java CAP application, we have ben able to remotely connect to our deployed application on the provider account following &lt;A href="https://blogs.sap.com/2019/05/13/maxs-adventure-in-sap-cloud-platform-debug-your-java-application-in-cloud-foundry/"&gt;this&lt;/A&gt; and similar guides, like debugging instructions for &lt;A href="https://help.sap.com/docs/btp/sap-business-technology-platform/debug-java-web-application-running-on-sapmachine"&gt;SapMachine&lt;/A&gt;. Since we upgraded our Java version to Java 17, we have not been able to connect to our deployed application even with different variants in our manifest.yml.&lt;/P&gt;
  &lt;P&gt;This is our current manifest.yml (commented out are other attempts that did not resolve the issue):&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2200527-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Following the instructions in the SapMachine guide, in Step 2 we also had an error which we could not really identify and thus had to stop the process:&lt;BR /&gt;cf ssh javacap -c "export JAVA_PID=`ps -C java -o pid=` &amp;amp;&amp;amp; app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd $JAVA_PID VM.start_java_debugging"&lt;/P&gt;
  &lt;P&gt; -&amp;gt; /bin/bash: line 0: export: `2064': not a valid identifier&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;This is what our mta.yaml for the application we deploy looks like:&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2200532-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;The observed behaviour is the following:&lt;/P&gt;
  &lt;P&gt;-&amp;gt; SSH is enabled&lt;/P&gt;
  &lt;P&gt;-&amp;gt; Connection through commandline is successful and behaves like we are used to: &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2200533-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&amp;gt; When we try to start the debugger and connect to the application through VS-Code the connection is being refused and the connection breaks:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2200530-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;additional info: here is our launch config to attach to the running ssh-connection:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2200531-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;This exact setup worked with our Java11 application and then somehow stopped working.&lt;/P&gt;
  &lt;P&gt;If there is any other information I can supply, please inform me.&lt;/P&gt;
  &lt;P&gt;Thank you in advance,&lt;/P&gt;
  &lt;P&gt;Pascal.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 12:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaq-p/12807113</guid>
      <dc:creator>nuramon9999</dc:creator>
      <dc:date>2023-08-11T12:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807114#M4809154</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;there should be no change regarding debugging in SapMachine 17. From what I see the problem stems from the "export JAVA_PID=`ps -C java -o pid=`" command. Can you check if just&lt;/P&gt;&lt;P&gt;cf ssh javacap -c "ps -C java -o pid="&lt;/P&gt;&lt;P&gt;returns more than one entry?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ralf&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 09:27:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807114#M4809154</guid>
      <dc:creator>former_member1243987</dc:creator>
      <dc:date>2023-08-14T09:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807115#M4809155</link>
      <description>&lt;P&gt;Hello Ralf,&lt;/P&gt;&lt;P&gt;When I run the command 'cf ssh javacap -c "ps -C java -o pid="', the response is ' 8 ' including a big spacing offset in front of the 8. &lt;BR /&gt;Thank you for your answer,&lt;/P&gt;&lt;P&gt;Pascal.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 10:09:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807115#M4809155</guid>
      <dc:creator>nuramon9999</dc:creator>
      <dc:date>2023-08-14T10:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807116#M4809156</link>
      <description>&lt;P&gt;Hello Ralf, &lt;/P&gt;&lt;P&gt;We still have not found a solution for the issue, is there any more feedback you can provide?&lt;BR /&gt;&lt;BR /&gt;Best of wishes,&lt;/P&gt;&lt;P&gt;Pascal Ehrlich&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 13:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807116#M4809156</guid>
      <dc:creator>nuramon9999</dc:creator>
      <dc:date>2023-08-25T13:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807117#M4809157</link>
      <description>&lt;P&gt;Hi Pascal,&lt;/P&gt;&lt;P&gt;we have no problems with remote debugging with SapMachine 17. This is our config&lt;BR /&gt;mta.yaml&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2202572-image.png" /&gt;&lt;/P&gt;&lt;P&gt; launch.json&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2202573-image.png" /&gt;&lt;BR /&gt;Then I use those 2 commands:&lt;BR /&gt;&lt;BR /&gt;cf ssh datatraincap-srv -c "export JAVA_PID=`ps -C java -o pid=` &amp;amp;&amp;amp; app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd $JAVA_PID VM.start_java_debugging"&lt;BR /&gt;&lt;BR /&gt;and then:&lt;BR /&gt;cf ssh datatraincap-srv -N -T -L 8000:localhost:8000&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you are working on windows you have to use a normal terminal and no powershell.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This worked on java 11, 14 und 17.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Chris&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 14:45:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807117#M4809157</guid>
      <dc:creator>christoffer_fuss</dc:creator>
      <dc:date>2023-08-25T14:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807118#M4809158</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;since it seems the output of ps on your system causes the problem, you should split up the command. First call&lt;/P&gt;&lt;P&gt;cf ssh javacap -c "ps -C java -o pid="&lt;/P&gt;&lt;P&gt;to get the pid of the java process and then&lt;/P&gt;&lt;P&gt;cf ssh javacap -c "app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd &amp;lt;pid&amp;gt; VM.start_java_debugging"&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;with &amp;lt;pid&amp;gt; being the pid of the java process. This should work.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ralf&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 06:19:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/12807118#M4809158</guid>
      <dc:creator>former_member1243987</dc:creator>
      <dc:date>2023-08-28T06:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/13797198#M4841882</link>
      <description>&lt;P&gt;Hello, I am coming back to add our solution, sorry for being late.&lt;BR /&gt;&lt;BR /&gt;The comments helped a lot, we had to find out the process ID and then it actually works:&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;pid=$(cf ssh appName -c "ps -C java -o pid=") &amp;amp;&amp;amp; cf ssh appName -c "~/app/META-INF/.sap_java_buildpack/sap_machine_jdk/bin/jcmd $pid VM.start_java_debugging" &amp;amp;&amp;amp; cf ssh appName -N -T -L 8000:127.0.0.1:8000&lt;/LI-CODE&gt;&lt;P&gt;Thank you for all of your help.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 09:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/13797198#M4841882</guid>
      <dc:creator>nuramon9999</dc:creator>
      <dc:date>2024-08-16T09:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/14017322#M4903497</link>
      <description>Hello, i was able to start remote debug, however when disconnecting from vsCode the remote debug connection remain active. VM.stop_java_debugging does not seem to be a valid command. How can the debug be stopped without restarting the application? Kind regards, Stephan</description>
      <pubDate>Fri, 14 Feb 2025 15:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/14017322#M4903497</guid>
      <dc:creator>enryuu</dc:creator>
      <dc:date>2025-02-14T15:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Java Cap remote debugging not working with Java 17</title>
      <link>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/14021275#M4904132</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Maybe it is an issue with the commandline-configuration you are using - I use VsCode integrated terminal too and the connection closes, when I Crtl-C or close the terminal instance.&lt;BR /&gt;If your issue is security you could turn off ssh of your application and then restart it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Pascal.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 10:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-cap-remote-debugging-not-working-with-java-17/qaa-p/14021275#M4904132</guid>
      <dc:creator>nuramon9999</dc:creator>
      <dc:date>2025-02-19T10:19:30Z</dc:date>
    </item>
  </channel>
</rss>

