Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

When creating data using OrganizationServiceStub class getting null point exception

Posted on by Microsoft Employee

I am getting below error when creating records.  Can you please some tell what is the issue here.

Error Msg:

<30 Aug, 2017 1:49:14 PM IST> <Error> <HTTP> <BEA-101017> <[ServletContext@173662444[app:_auto_generated_ear_ module:SampleUnswCrm path:null spec-version:3.0], request: weblogic.servlet.internal.ServletRequestImpl@6586fb59[
GET /SampleUnswCrm/push/enquiries/to-client-crm.html HTTP/1.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://localhost:7001/SampleUnswCrm/index.jsp
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.8

]] Root cause of ServletException.
java.lang.NullPointerException
at com.feed.layer.controller.PushEnquiryFeedsToClientCrm.formData(PushEnquiryFeedsToClientCrm.java:65)
at com.feed.layer.controller.PushEnquiryFeedsToClientCrm.pushEnquiryFeedsToClientCrm(PushEnquiryFeedsToClientCrm.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Truncated. see log file for complete stacktrace

public void formData() {
Create create = new Create();
Entity entity = new Entity();
AttributeCollection collection = new AttributeCollection();
addAttribute(collection, "kpmgc_email", "sdada@asfsakjh.kjdf");
addAttribute(collection, "kpmgc_firstname", "Test");
addAttribute(collection, "kpmgc_lastname", "Test");
entity.setAttributes(collection);
create.setEntity(entity);
try {

My code:
CreateResponse createResponse = new CreateResponse();
createResponse = _service.create(create);   -- getting error here
} catch (RemoteException e) {
e.printStackTrace();
} catch (IOrganizationService_Create_OrganizationServiceFaultFault_FaultMessage e) {
e.printStackTrace();
}
}

private void addAttribute(AttributeCollection collection, String key, Object value) {
KeyValuePairOfstringanyType values = new KeyValuePairOfstringanyType();
values.setKey(key);
values.setValue(value);
collection.addKeyValuePairOfstringanyType(values);
}

Thanks in advance.

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans