on 08-11-2023 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.
Hi,
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
cf ssh javacap -c "ps -C java -o pid="
returns more than one entry?
Best regards,
Ralf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pascal,
we have no problems with remote debugging with SapMachine 17. This is our config
mta.yaml
launch.json
Then I use those 2 commands:
cf ssh datatraincap-srv -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"
and then:
cf ssh datatraincap-srv -N -T -L 8000:localhost:8000
If you are working on windows you have to use a normal terminal and no powershell.
This worked on java 11, 14 und 17.
Hope this helps,
Best regards,
Chris
Hi,
since it seems the output of ps on your system causes the problem, you should split up the command. First call
cf ssh javacap -c "ps -C java -o pid="
to get the pid of the java process and then
cf ssh javacap -c "app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd <pid> VM.start_java_debugging"
with <pid> being the pid of the java process. This should work.
Best regards,
Ralf
User | Count |
---|---|
69 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.