cancel
Showing results for 
Search instead for 
Did you mean: 

XSA Java Odata v4 not working

former_member233511
Participant

Hello, I continue to setup different parts of XSA.
Today i struggle with setting up Odata v4 Java module.

Every module builds and run successfully.

My cds top part:

namespace demo_project.db.cds;

@OData.publish : true
context MY_CONTEXT {
	entity EXPAMPLE {

Browser url that i'm using to access OData:

https://my_host_here:51036/java/odata/v4/demo_project.db.cds._.MY_CONTEXT/$metadata

Result "Not Found" page

There is Java errors during start module process, but it still running:

11/12/18 12:57:40.881 PM [APP/2-0] ERR    #2.0#2018 11 12 12:57:40.880#+03:00#ERROR#com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer#
11/12/18 12:57:40.882 PM [APP/2-0] ERR    ###E08F80A9855E4B0EB24A843AAFA1830F###com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer########localhost-startStop-1#PLAIN##
11/12/18 12:57:40.882 PM [APP/2-0] ERR    while trying to invoke the method java.net.URL.getPath() of a null object returned from java.lang.ClassLoader.getResource(java.lang.String)#
11/12/18 12:57:40.882 PM [APP/2-0] ERR    
11/12/18 12:57:40.882 PM [APP/2-0] ERR    java.lang.NullPointerException: while trying to invoke the method java.net.URL.getPath() of a null object returned from java.lang.ClassLoader.getResource(java.lang.String)
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer.readEDMXUsingClassPath(ODataApplicationInitializer.java:134) ~[odata4.web-1.17.1.jar:na]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer.loadMetadataFromResourceUsingSrvCtxt(ODataApplicationInitializer.java:118) ~[odata4.web-1.17.1.jar:na]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer.loadMetadata(ODataApplicationInitializer.java:107) ~[odata4.web-1.17.1.jar:na]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer.contextInitialized(ODataApplicationInitializer.java:53) ~[odata4.web-1.17.1.jar:na]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) [catalina.jar:8.5.32]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) [catalina.jar:8.5.32]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.32]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) [catalina.jar:8.5.32]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) [catalina.jar:8.5.32]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_181]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181]
11/12/18 12:57:40.882 PM [APP/2-0] ERR    	at java.lang.Thread.run(Thread.java:836) [na:1.8.0_181]

What i'm doing wrong?

0 Kudos

Hello, Efim.

Have you resolved the issue?

pangxixin
Discoverer
0 Kudos

HI, Efim.

Have you resolved the issue?

uneu
Discoverer
0 Kudos

Hello xefimx , pangxixin , sergeyivanovich.pochuhaylov ,

I have the same issue with the Odata 4.0 tutorial. Did someone resolved the issue?

Regards,
Udo

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

When you create Java app based on the template "ODATA v4 service"m you got the error

You need to create a Java app based on the template "Web application with ODATA v4 support".

uneu
Discoverer
0 Kudos

Hi Sergey,

But in HANA2.0SP5 this template is not available. Therefore I used the "Odata V4 Service" and get the same error as described.

Regards,

Udo