[ 
https://issues.apache.org/jira/browse/OLINGO-1044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Athish updated OLINGO-1044:
---------------------------
    Description: 
Service.java & System.java generated from olingo maven plugin from the CRM 2016 
$Metadata 

Trying to create ODataClient
Service<EdmEnabledODataClient> service = Service
                                .getV4("https://example.crm2016/api/data/v8.1";);

odata.test.pojo.microsoft.dynamics.crm.System container = 
service.getEntityContainer(odata.test.pojo.microsoft.dynamics.crm.System.class);

Trying to preform CRUD operation

1.Retrial from the Container is working fine
for (Contact c : container.getContacts())
                        System.out.printf("Firstname: %s - Fullname: %s%n",
                                        c.getFirstname(), c.getLastname());

2. When trying to Create by Adding and Flush getting Null Pointer Exception
final Contact order = container.newEntityInstance(Contact.class);
order.setFirstname("try with flush");
container.getContacts().add(order);
container.flush();

Exception in thread "main" java.lang.NullPointerException
        at 
org.apache.olingo.ext.proxy.utils.CoreUtils.getODataEntityProperty(CoreUtils.java:153)
        at 
org.apache.olingo.ext.proxy.utils.CoreUtils.addProperties(CoreUtils.java:294)
        at 
org.apache.olingo.ext.proxy.commons.AbstractPersistenceManager.processEntityContext(AbstractPersistenceManager.java:157)
        at 
org.apache.olingo.ext.proxy.commons.AbstractPersistenceManager.flush(AbstractPersistenceManager.java:99)
        at 
org.apache.olingo.ext.proxy.commons.TransactionalPersistenceManagerImpl.flush(TransactionalPersistenceManagerImpl.java:49)
        at 
org.apache.olingo.ext.proxy.commons.EntityContainerInvocationHandler.invoke(EntityContainerInvocationHandler.java:86)
        at com.sun.proxy.$Proxy3.flush(Unknown Source)
        at com.test.olingo.pojo.PojoExample.insert(PojoExample.java:72)
        at com.test.olingo.pojo.PojoExample.main(PojoExample.java:54)


client.getCachedEdm().getEntityType(entity) is returing null

  was:
Service.java & System.java generated from olingo maven plugin from the CRM 2016 
$Metadata 

Trying to create ODataClient
Service<EdmEnabledODataClient> service = Service
                                .getV4("https://example.crm2016/api/data/v8.1";);

odata.test.pojo.microsoft.dynamics.crm.System container = 
service.getEntityContainer(odata.test.pojo.microsoft.dynamics.crm.System.class);

Trying to preform CRUD operation

1.Retrial from the Container is working fine
for (Contact c : container.getContacts())
                        System.out.printf("Customer ID: %s - Company: %s%n",
                                        c.getFirstname(), c.getLastname());

2. When trying to Create by Adding and Flush getting Null Pointer Exception
final Contact order = container.newEntityInstance(Contact.class);
order.setFirstname("try with flush");
container.getContacts().add(order);
container.flush();

Exception in thread "main" java.lang.NullPointerException
        at 
org.apache.olingo.ext.proxy.utils.CoreUtils.getODataEntityProperty(CoreUtils.java:153)
        at 
org.apache.olingo.ext.proxy.utils.CoreUtils.addProperties(CoreUtils.java:294)
        at 
org.apache.olingo.ext.proxy.commons.AbstractPersistenceManager.processEntityContext(AbstractPersistenceManager.java:157)
        at 
org.apache.olingo.ext.proxy.commons.AbstractPersistenceManager.flush(AbstractPersistenceManager.java:99)
        at 
org.apache.olingo.ext.proxy.commons.TransactionalPersistenceManagerImpl.flush(TransactionalPersistenceManagerImpl.java:49)
        at 
org.apache.olingo.ext.proxy.commons.EntityContainerInvocationHandler.invoke(EntityContainerInvocationHandler.java:86)
        at com.sun.proxy.$Proxy3.flush(Unknown Source)
        at com.test.olingo.pojo.PojoExample.insert(PojoExample.java:72)
        at com.test.olingo.pojo.PojoExample.main(PojoExample.java:54)


client.getCachedEdm().getEntityType(entity) is returing null


> Trying to Add and Flush
> -----------------------
>
>                 Key: OLINGO-1044
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1044
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-client
>    Affects Versions: (Java) V4 4.3.0
>            Reporter: Athish
>
> Service.java & System.java generated from olingo maven plugin from the CRM 
> 2016 $Metadata 
> Trying to create ODataClient
> Service<EdmEnabledODataClient> service = Service
>                               .getV4("https://example.crm2016/api/data/v8.1";);
> odata.test.pojo.microsoft.dynamics.crm.System container = 
> service.getEntityContainer(odata.test.pojo.microsoft.dynamics.crm.System.class);
> Trying to preform CRUD operation
> 1.Retrial from the Container is working fine
> for (Contact c : container.getContacts())
>                       System.out.printf("Firstname: %s - Fullname: %s%n",
>                                       c.getFirstname(), c.getLastname());
> 2. When trying to Create by Adding and Flush getting Null Pointer Exception
> final Contact order = container.newEntityInstance(Contact.class);
> order.setFirstname("try with flush");
> container.getContacts().add(order);
> container.flush();
> Exception in thread "main" java.lang.NullPointerException
>       at 
> org.apache.olingo.ext.proxy.utils.CoreUtils.getODataEntityProperty(CoreUtils.java:153)
>       at 
> org.apache.olingo.ext.proxy.utils.CoreUtils.addProperties(CoreUtils.java:294)
>       at 
> org.apache.olingo.ext.proxy.commons.AbstractPersistenceManager.processEntityContext(AbstractPersistenceManager.java:157)
>       at 
> org.apache.olingo.ext.proxy.commons.AbstractPersistenceManager.flush(AbstractPersistenceManager.java:99)
>       at 
> org.apache.olingo.ext.proxy.commons.TransactionalPersistenceManagerImpl.flush(TransactionalPersistenceManagerImpl.java:49)
>       at 
> org.apache.olingo.ext.proxy.commons.EntityContainerInvocationHandler.invoke(EntityContainerInvocationHandler.java:86)
>       at com.sun.proxy.$Proxy3.flush(Unknown Source)
>       at com.test.olingo.pojo.PojoExample.insert(PojoExample.java:72)
>       at com.test.olingo.pojo.PojoExample.main(PojoExample.java:54)
> client.getCachedEdm().getEntityType(entity) is returing null



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to