on ‎2023 May 10 9:10 AM
Hi, everyone
Can you anyone why the following case of #1 is only successful?
They are cases when deploying Java application in BTP Neo.
==<Cases>==
#1 Datasource binding is not defined and Runtime is "Java EE 7 Web Profile TomEE 7".
-> We get the following error and deploying is failed
ERROR#com.sap.core.services.accessor.tomcat.support.DelegatingObjectFactory#BC-NEO-RT- JAV#anonymous#localhost-startStop-1#com.sap.core.services.accessor#abd30f7a7#benefits#web##na#na#na#na#Exception is thrown by facroty [com.sap.cloud.runtime.kotyo.persistence.client.PersistenceDataSourceFactory@4fd10c95] during retrieving object instance. Exception is: javax.naming.NamingException: No persistence configuration available for resource name [jdbc/defaultManagedDataSource], check datasource bindings for this application
#2 Datasource binding is not defined and Runtime is Java Web Tomcat 9".
-> We don't get the error and deploying is successful.
=====
The difference between #1 and #2 is only runtime version.
Application to deploy is completely same.
Java EE7 Web Profile TomEE7 only works something process to validate or check datasource binding during deploy ?

Request clarification before answering.
Hi takuya.endo,
This is not really a matter of which runtime you are using but it has to do with the way you define your persistence.
In Java EE there are two ways in which you define persistence:
1) Container-managed --> Web Profile
2) Application-managed --> Java Web (Tomcat)
Each will require you to develop the application in a different manner.
Please refer to the following documentation:
https://help.sap.com/docs/btp/sap-btp-neo-environment/programming-with-jpa?locale=en-US
Therefore, if you have developed the application with the Application-Managed approach, you may will face issues while deploying it against a runtime other than Java Web (Tomcat) and vice-versa.
Recommended way is to use EclipseLink for JPA projects and have both container/application managed settings on your app so you are able to deploy it against both runtimes:
Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 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.