javasap-commerce-cloud

Hybris fails when is the code is auto generating - ant all


I am working with the 5.7 version of Hybris platform and JAVA 1.8.0.77, when I am doing the ant all with the customer data, it fails everytime:

[ycodegenerator] 11:14:23,475 [main] INFO  DtoClassGenerator -    Generating resources ..
[ycodegenerator] 11:14:28,785 [main] INFO  CodeGenerator - Code generation done in 25957 ms. 
     [echo]       building models from C:\Hybris2\hybris\bin\platform/bootstrap/gensrc to C:\Hybris2\hybris\bin\platform/bootstrap/bin/models.jar 
    [mkdir] Created dir: C:\Hybris2\hybris\bin\platform\bootstrap\modelclasses 
   [yjavac] Compiling 1563 source files to C:\Hybris2\hybris\bin\platform\bootstrap\modelclasses 
   [yjavac] ----------
   [yjavac] 1. ERROR in C:\Hybris2\hybris\bin\platform\bootstrap\gensrc\br\com\carrefour\facades\payment\GiftCardPaymentInfoData.java <at line 22>
   [yjavac]     import de.klatform.commercefacades.order.data.AbstractPaymentInfoData;
   [yjavac]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   [yjavac] The import de.hybris.platform.commercefacades.order.data.AbstractPaymentInfoData cannot be resolved 

Console Log

I can't see what I am missing.

here is the LocalExtensions.xml

    <?xml version="1.0" encoding="UTF-8"?>
<hybrisconfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="resources/schemas/extensions.xsd">
    <extensions>
        <!-- 
                All extensions located in ${HYBRIS_BIN_DIR}/platform/ext are automatically loaded. 
                More information about how to configure available extensions can be found here : https://wiki.hybris.com/x/nZVzC
        -->
                
        <path dir="${HYBRIS_BIN_DIR}" />
        
        <path dir="${HYBRIS_BIN_DIR}/ext-commerce"/>
        
        
<!--        <extension dir="${HYBRIS_BIN_DIR}/ext-addon/addonsupport"/> -->
            
            
        <extension name="addonsupport"/>
        <extension name="mediaconversion"/>
    
        <extension name="carrefourcockpits" />
        <extension name="carrefourcore" />
        <extension name="carrefourfacades" />

        <extension name="carrefouroms" />
        <extension name="carrefourinitialdata" />
        <extension name="carrefourstorefront" />
        <extension name="carrefourintegrationws" /> 
        <extension name="carrefourinterfacews"/>
        
<!--        <extension name="carrefourtest" /> -->
        <extension name='carrefourhmc' />
        <extension name="carrefourcheckoutaddon"/>
        <extension name='carrefourcmscomponentsaddon' />
        
        <extension name="braspagintegration" />
        <extension name="clearsaleintegration" />
        
        <extension name="krsfacades" />
        <extension name="krsservices" />
        <extension name="krsasm"/>
        <extension name="krsasmstorefront"/>
        
        <extension name="backoffice" />
        <extension name="commercesearch" />
        <extension name="commercesearchbackoffice" />
        <extension name="commercesearchhmc" />

        <extension name="zipzonedeliverycore" />
        <extension name="zipzonedeliveryhmc" />
        <extension name="zipzonedeliveryfacades" />
        
        <extension name="voucher" />
        <extension name="voucherbackoffice" />
        
        <extension name="vouchers" />
        
        <extension name="solrfacetsearch" />
        <extension name="solrserver" />
        
        <!--  SAC extensions -->
        <extension name="carrefoursacstorefront" />
        <extension name="carrefoursaccore" />
        <extension name="carrefoursacfacades" />
        
        <!-- ASM -->
        <extension name="assistedservicestorefront"/>
        <extension name="acceleratorstorefrontcommons" />
        <extension name="assistedservicefacades"/>
        
        <!-- SSO -->
<!--        <extension name="samlsinglesignon"/> -->
<!--        <extension name="krssso"/> -->
        
        <!-- OMS -->
        <extension name="warehousing"/>
        <extension name="warehousingbackoffice"/>
        <extension name="ordermanagementbackoffice"/>
        <extension name="platformwebservices"/>
        
        <!-- data hub -->
        <extension name='datahubadapter' />
        <extension name='datahubbackoffice' />
        
        <!-- analytics and business events for hybris marketing integration -->
         <extension dir='${HYBRIS_BIN_DIR}/custom/hybrisanalyticsaddon'/>
        
        <extension name='eventtrackingservices' />
        <extension name='eventtrackingmodel' />
        <extension name='eventtrackingpublisher' />
        <extension name='eventtrackingwsaddon' />
        
        <!-- yMkt integration -->
        <extension dir="${HYBRIS_BIN_DIR}/custom/ypshybrismarketing/ymkt-hybris/cpoexport"/>

        <extension name='yc4ccarrefour' />
        <extension name='krsorderstatus' />
        
        <extension name="wishlist"/>
    </extensions>
</hybrisconfig>

carrefoursacfacades

resources CarrefourFacades

GiftCardPayment Definition

package br.com.carrefour.core.jalo;

import de.hybris.platform.jalo.Item;
import de.hybris.platform.jalo.JaloBusinessException;
import de.hybris.platform.jalo.SessionContext;
import de.hybris.platform.jalo.type.ComposedType;
import org.apache.log4j.Logger;

public class GiftCardPayment extends GeneratedGiftCardPayment
{
    @SuppressWarnings("unused")
    private final static Logger LOG = Logger.getLogger( GiftCardPayment.class.getName() );
    
    @Override
    protected Item createItem(final SessionContext ctx, final ComposedType type, final ItemAttributeMap allAttributes) throws JaloBusinessException
    {
        // business code placed here will be executed before the item is created
        // then create the item
        final Item item = super.createItem( ctx, type, allAttributes );
        // business code placed here will be executed after the item was created
        // and return the item
        return item;
    }
    
}

Item Creation

    <itemtype code="GiftCardPayment" extends="PaymentMode">
        <attributes>
            <attribute qualifier="maximumGiftCardAmount" autocreate="true"
                type="java.lang.Integer">
                <modifiers read="true" write="true" search="true" />
                <persistence type="property" />
            </attribute>
            <attribute qualifier="valueGiftCard" autocreate="true"
                type="java.lang.Double">
                <modifiers read="true" write="true" search="true" />
                <persistence type="property" />
            </attribute>
        </attributes>
    </itemtype>
    <itemtype code="BoletoPayment" extends="paymentmode">
        <description>Boleto Payment</description>
    </itemtype>

Solution

  • It looks like you don't have commercefacades in your localextensions.xml which is where AbstractPaymentInfoData is declared. Either you add it explictly to your localextensions.xml or you declare it as dependency in your carrefourcore (or whereever your failing GiftCardPaymentInfoData is defined) `extensioninfo.xml' file by adding a line like:

    <requires-extension name="commercefacades"/>
    

    If that doesn't help, please post the part of the console log when the ant task lists the complete hybris extension dependency list, like this. (commercefacades should show up there somewhere)

     [echo] ---------------------------------------------------------------
     [echo] --- Extensions in dependency order ( options: 
     [echo] ---  @deprecated: is deprecated, p: platform extension,*: auto-required 
     [echo] ---  ?: lazy-loaded, i: got items.xml, b: got beans.xml, c: got core module 
     [echo] ---  w: got web module, h: got HMC module ) 
     [echo] ---------------------------------------------------------------
     [echo] core 6.0.0.0-SNAPSHOT [p*cib]
     [echo] testweb 6.0.0.0-SNAPSHOT [p*w]
     [echo] scripting 6.0.0.0-SNAPSHOT [p*ci]
     [echo] paymentstandard 6.0.0.0-SNAPSHOT [p*ci]
     [echo] mediaweb 6.0.0.0-SNAPSHOT [p*cw]
     [echo] maintenanceweb 6.0.0.0-SNAPSHOT [p*w]
     [echo] deliveryzone 6.0.0.0-SNAPSHOT [p*ci]
     [echo] commons 6.0.0.0-SNAPSHOT [p*ci]
     [...]
     [echo] mcc->(impex,processing,cockpit) 6.0.0.0-SNAPSHOT [ciw] path:/Users/sebastianschaer/dev/bitwisers/code/ruleenginesuite/hybris/bin/ext-cockpit/mcc
     [echo] ---------------------------------------------------------------
     [echo]  
    

    Alternative: If this error isn't due to a missing extension (I don't have AbstractPaymentInfoData declared in commercefacades, but I'm working on a newer version rightn ow) it might be that your bean definition for GiftCardPaymentInfoData extends a wrong type, i.e. a non-existing one. Are you migrating from an older hybris version to 5.7?

    If so, maybe you need to change your bean definition for the GiftCardPaymentInfoData (declared in one of your extensions in the EXTENSION_NAME-beans.xml file) and change it to extend maybe de.hybris.platform.commercefacades.order.data.CCPaymentInfoData or de.hybris.platform.acceleratorservices.payment.data.PaymentInfoData or another already existing DTO.. If you are migrating you should look up the migration docs on the hybris wiki to see what changes were made regarding this.

    Hope this helps,

    Sebastian