01-19-2017 10:57 AM - edited 02-04-2024 3:02 AM
Hi Experts , I am getting below exception when trying to load SAP IDOC in Datahub.Below url I am hitting: http://localhost:8081/datahub-webapp-6.1.0.0-RC3/v1/idoc/receiver Below error is coming:
java.lang.NullPointerException: null at com.hybris.datahub.sapidocintegration.spring.HttpInboundService.receiveIdoc(HttpInboundService.java:132) ~[sapidocintegration-6.1.0.0-RC4.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
Looking at source code it seems that MessageChannel is coming as null in receiveIDoc method at line idocXmlInboundChannel.send(new GenericMessage<>(idoc, headers)); in sapidocintegration.jar:
public Response receiveIdoc(@Tainted final String idoc) { if (idoc == null || idoc.isEmpty()) { LOGGER.error("Bad request, IDOC is empty"); return Response.status(Status.BAD_REQUEST).build(); } try { final long start = System.currentTimeMillis(); final String xmlType = getXMLType(idoc); final String idocType = getIdocType(idoc); final Map headers = Collections.singletonMap("IDOCTYP", idocType); idocXmlInboundChannel.send(new GenericMessage<>(idoc, headers)); final long end = System.currentTimeMillis(); LOGGER.info("The processing of the {}({}) tag took {} milliseconds.", xmlType, idocType, end - start);
HttpInboundService.incrementIDOCCount(xmlType);
}
catch (final Exception ex)
{
LOGGER.error("Exception occurred during processing of tag : {}", idoc, ex);
throw ex;
}
return Response.ok().build();
}
Below is IDOC:
<IDOC>
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<DIRECT>1</DIRECT>
<IDOCTYP>DEBMAS05</IDOCTYP>
<SNDPOR>SAPR2Q</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>R2QCLNT100</SNDPRN>
<RCVPOR>X6TCLNT010</RCVPOR>
<RCVPRN>X6TCLNT010</RCVPRN>
</EDI_DC40>
<E1KNA1M SEGMENT="1">
<KUNNR>0099100295</KUNNR>
<KTOKD>DEBI</KTOKD>
<NAME1>DAILY FRESH</NAME1>
<SPRAS>E</SPRAS>
<SPRAS_ISO>EN</SPRAS_ISO>
<E1KNVVM SEGMENT="1">
<VKORG>3100</VKORG>
<VTWEG>29</VTWEG>
<SPART>10</SPART>
<KONDA>01</KONDA>
<E1KNVPM SEGMENT="1">
<MSGFN>005</MSGFN>
<PARVW>AG</PARVW>
<KUNN2>0099100295</KUNN2>
<PARZA>000</PARZA>
</E1KNVPM>
<E1KNVPM SEGMENT="1">
<MSGFN>005</MSGFN>
<PARVW>RE</PARVW>
<KUNN2>0064000191</KUNN2>
<PARZA>000</PARZA>
</E1KNVPM>
<E1KNVPM SEGMENT="1">
<MSGFN>005</MSGFN>
<PARVW>RG</PARVW>
<KUNN2>0064000191</KUNN2>
<PARZA>000</PARZA>
</E1KNVPM>
<E1KNVPM SEGMENT="1">
<MSGFN>005</MSGFN>
<PARVW>WE</PARVW>
<KUNN2>0099100295</KUNN2>
<PARZA>000</PARZA>
</E1KNVPM>
</E1KNVVM>
</E1KNA1M>
</IDOC>
Hi,
It looks that sapidocintegration extension wasn't loaded properly and the bean wasn't created. Please find in the logs what is the reason (sapidocintegration requires sapcoreconfiguration).
Best Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
You should also rename your datahub war file as datahub-webap only and then deploy it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.