Stephen Cherian created OLINGO-102:
--------------------------------------
Summary: Deep insert throws NPE
Key: OLINGO-102
URL: https://issues.apache.org/jira/browse/OLINGO-102
Project: Olingo
Issue Type: Bug
Components: odata2-jpa
Affects Versions: V2 1.0.0
Reporter: Stephen Cherian
Priority: Critical
I was migrating my project based on SAP OData to Olingo. When i try to do a
deep insert i get a HTTP 400 and response message value as ""An exception of
type 'NullPointerException' occurred.". This was working fine with SAP OData
libraries v 0.7.0. Find the XML Header below
<?xml version='1.0' encoding='utf-8'?><entry
xmlns="http://www.w3.org/2005/Atom"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xml:base="http://localhost:8080/espm-model-web/espm.svc/"><link rel=
"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Customers"
type="application/atom+xml;type=entry" title="Customer"
href="Customers('100000008')" /><category
term="com.sap.espm.modelModel.SalesOrderHeader"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesOrderItems"
type="application/atom+xml;type=feed" title="SalesOrderItems"
href="SalesOrderHeaders('800000')/SalesOrderItems"><m:inline><feed><entry><link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
type="application/atom+xml;type=entry" title="Product"
href="Products('HT-1002')"/><category term="com.sap.espm.model.SalesOrderItem"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><content
type="application/atom+xml"><m:properties><d:ItemNumber>10</d:ItemNumber><d:CurrencyCode>EUR</d:CurrencyCode><d:QuantityUnit>PC</d:QuantityUnit><d:Quantity
m:type="Edm.Decimal">1</d:Quantity><d:DeliveryDate
m:type="Edm.DateTime">2012-11-27T18:31:59</d:DeliveryDate><d:ProductId>HT-1002</d:ProductId></m:properties></content></entry></feed></m:inline></link><content
type="application/atom+xml"><m:properties><d:CustomerId>100000028</d:CustomerId><d:CurrencyCode>EUR</d:CurrencyCode></m:properties></content></entry>
The exception is thrown from the the class
org.apache.olingo.odata2.core.ep.consumer.XmlEntityConsumer method- readLinks.
The actual error thrown is
"org.apache.olingo.odata2.api.ep.EntityProviderException:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]"
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)