Skip to Content
Former Member
Jun 30, 2014 at 07:18 AM

Odata JDBC Service: getting NullPointerException: while trying to invoke the method



I am testing OData, for that I followed the steps given in this tutorial:

It wasn't working as it should, so to understand it better, I created a new project with Stock table only.

Manually entered all it's properties and then deploy it.

Issue1: when I create a JDBC connection to connect with derby database, The driver field has maximum limit and whole driver string is not copied. Attached is the screen shot.

Where as I need to enter: org.apache.derby.jdbc.ClientDriver.

Issue 2: I can't test the connection from here, weather it's working fine or not ?

Issue 3:

When I deploy the project and test the result, I get the Stock Service, But when I try to run this, I get nullpointer exception.

URL: http://localhost:8080/gateway/odata/sap/WSTest1;v=1


<?xml version="1.0" encoding="utf-8"?>
<service xml:base="http://localhost:8080/gateway/odata/sap/WSTest1;v=1/" xmlns="" xmlns:atom="">
   <collection href="StockSet">

Now I need to run StockSet, so next url to access the stock list,

to get stocks:


Now I get the following response:

<?xml version="1.0" ?>

<error xmlns="">



<message xml:lang="en">java.lang.NullPointerException: while trying to invoke the method java.lang.Object.hashCode() of a null object loaded from local variable 'k'</message>


I am not able to figure out, why I am getting this error and how to fix it.

All I want is to create a ODAta on ESPM_STOCK sample table given in example.

Looking forward to hear from you.