cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CP Neo - SAP Cloud SDK for JAVA: debug on localhost

christoffer_fuss
Participant
39,363

Hello guys,

I followed this tutorial and created a simple application which is connetecd to my custom OData Service and everything is working fine. I used this command to start the application local:

mvn scp:clean scp:push -pl application -Derp.url=https://URL

The local server works fine and I can also mock my destinations.

But how can I debug my application? How can I start this server in debug mode?

Best Regards,

Chris

Accepted Solutions (1)

Accepted Solutions (1)

former_member241648
Participant

Hi Christoffer,

I could debug a Neo app locally:

For this I followed these steps:

1. Download Eclipse - I used my Neon installation.

2. Add the SAP Cloud Platform tools for Java:

Do this by using the install new software dialog on Eclipse and use the SAP update site fitting your Eclipse version, e.g. https://tools.hana.ondemand.com/neon .

3. Create a Java EE 7 project with Maven archetype com.sap.cloud.sdk.archetypes:scp-neo-javaee7 and import it into Eclipse

4. Choose the application project (YOUR_NAME-application), and choose 'Debug As... -> Debug on Server...' from the Debug drop-down in Eclipse. Then choose to 'Manually define a new server' and choose 'Java EE 7 Web Profile TomEE 7 Server'. For the 'Server runtime environment' you have to download the corresponding 'Java EE 7 Web Profile TomEE 7' SAP Cloud Platform Neo Environment SDK and unzip it on your machine. Then provide the folder in the 'Server runtime environment' field:

5. Create a user on the server by opening the server with double-click in the 'Servers' view, and then opening the 'Users' tab. There you have to add a user to be able to get past the authentication dialog the web app pops up:

This is not required when running the app on the command line with 'mvn scp:push', as then a different configuration is taking effect - sorry for the inconvenience.

6. Restart the server on the 'Servers' view to have your user creation take effect. Then create a breakpoint in the HelloWorldServlet and go to localhost:8158/YOUR_APP_NAME-application/hello !

I didn't try to define and access destinations, but it seems most easily to be possible with the 'Connectivity' tab of the 'Server' view.

Good luck, let us know if this worked!

christoffer_fuss
Participant

Hi Georg,

thank you very much, it is working now for me as well 🙂 the sap erp backend can also be reached 🙂 Maybe you can add your answer to the tutorial as is it very helpful.

Best Regards,

Chris

Answers (1)

Answers (1)

matthiaskuhr
Product and Topic Expert
Product and Topic Expert
0 Kudos

I would recommend checking out these two sources:
https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/6ac5536ea4e143bd84e39b6fb8a...

and https://blogs.sap.com/2019/07/24/remote-debugging-on-cloud-foundry/

I hope this helps, otherwise I'll look deeper into how this works as I have also never done it before.

christoffer_fuss
Participant
0 Kudos

Thanks for helping 🙂 I already checked the links above and they are not helping. The first link was working for me in my previous app without the SAP Cloud SDK. Here I started a Java EE 7 Web Profile TomEE 7 Server in Eclipse, which coud be started in debug mode. This is not working for my Cloud SDK project. The console command above is starting a tomcat server, which Is not shown in my eclipse and therefore I cannot start this server in debug mode.

The second link works only on Cloud Foundry, I use the Neo enviorment.

Would be great, if you can check this.

Best Regards,

Chris