on ‎2023 Aug 11 1:07 PM
Hello dear community,
Since our setup of our Java CAP application, we have ben able to remotely connect to our deployed application on the provider account following this and similar guides, like debugging instructions for SapMachine. 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.
This is our current manifest.yml (commented out are other attempts that did not resolve the issue):

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:
cf ssh javacap -c "export JAVA_PID=`ps -C java -o pid=` && app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd $JAVA_PID VM.start_java_debugging"
-> /bin/bash: line 0: export: `2064': not a valid identifier
This is what our mta.yaml for the application we deploy looks like:

The observed behaviour is the following:
-> SSH is enabled
-> Connection through commandline is successful and behaves like we are used to:

> When we try to start the debugger and connect to the application through VS-Code the connection is being refused and the connection breaks:

additional info: here is our launch config to attach to the running ssh-connection:

This exact setup worked with our Java11 application and then somehow stopped working.
If there is any other information I can supply, please inform me.
Thank you in advance,
Pascal.
Request clarification before answering.
Hello, I am coming back to add our solution, sorry for being late.
The comments helped a lot, we had to find out the process ID and then it actually works:
pid=$(cf ssh appName -c "ps -C java -o pid=") && cf ssh appName -c "~/app/META-INF/.sap_java_buildpack/sap_machine_jdk/bin/jcmd $pid VM.start_java_debugging" && cf ssh appName -N -T -L 8000:127.0.0.1:8000Thank you for all of your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.