cancel
Showing results for 
Search instead for 
Did you mean: 

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

christoffer_fuss
Participant

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

former_member241648
Participant
0 Kudos

Hi Christoffer, maybe you can also adapt the subject of the question to state that this is specifically addressing SCP Neo?

christoffer_fuss
Participant
0 Kudos

Hi Georg, I would lke to update the subject but I don't know how I can do this?

gregorw
Active Contributor
0 Kudos

Try Action -> Edit.

christoffer_fuss
Participant
0 Kudos

I don't have this option. The only option available is to close the topic.

gregorw
Active Contributor
0 Kudos

Did it for you.

christoffer_fuss
Participant
0 Kudos

Thank you 🙂 I guess this action can only be done by moderators.

View Entire Topic
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