cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration Issue While Setting up Datahub in Hybris 6.0

0 Kudos

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>
former_member224482
Active Contributor
0 Kudos

Be aware that the IDOC above is not valid.

All IDOCs (Sent by ERP within scope of SAP integration) are XML and must start with :

 <?xml version="1.0" encoding="UTF-8"?>

Followed by the IDOC container type and IDOC must have BEGIN="1" as tag attribute.

 <DEBMAS05>
   <IDOC BEGIN="1">

All of this is defined in the XSD that ERP can provide.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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,

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ravi,

You should also rename your datahub war file as datahub-webap only and then deploy it.