Hybris Upgrade Preview – From 6.0.x.x To 6.1.x.x

This article is briefly listing some obstacles observed while attempting to upgrade the hybris version codebase, from 6.0 to 6.1. This is not an exhaustive list of deprecated extensions, methods or classes, but rather an idea of what sort of things might occur.

LDAP services and some related extensions have moved, no more get of vouvhers applied from the session cart, a few modifications occured in the StorefrontAuthenticationSuccessHandler.

1/ Moved – LDAP services have been moved

Example of error at build time:

   [yjavac]     import de.hybris.platform.ldap.connection.LDAPGenericObject;
   [yjavac]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   [yjavac] The import de.hybris.platform.ldap.connection.LDAPGenericObject cannot be resolved


LDAP services are now encapsulated in a separate extension. This means the required extension need to be added in the relevant custom extensions that use the ldap types such as LDAPGenericObject, ConnectionData, etc…
<requires-extension name=”ldap”/>


2/ Moved – No more oauthauthorizationserver
There is no more oauthauthorizationserver extension in the hybris\bin\ext-platform-optional\oauthauthorizationserver .Let us remind, that extension is often required for other extensions in order to use LDAP for example, thus causing errors at building. It is replaced by oauth2 in hybris\bin\platform\ext .

<requires-extension name=”commercefacades”/>
<requires-extension name=”commerceservices”/>
<requires-extension name=”commercewebservicescommons”/>
<requires-extension name=”webservicescommons”/>
<requires-extension name=”oauthauthorizationserver”/>
     <requires-extension name=”oauth2″/>


3/ Removed – get method for vouchers from the session cart
Example of error:
ERROR in …/ws/core/v2/controller/CartsController.java (at line 1241)
   [yjavac]     dataList.setVouchers(getSessionCart().getAppliedVouchers());
   [yjavac]              ^^^^^^^^^^^
   [yjavac] The method setVouchers(List<VoucherData>) in the type VoucherDataList is not applicable for the arguments (List<String>)


Need to change the getSessionCart().getAppliedVouchers() to voucherFacade.getVouchersForCart() with
    private VoucherFacade voucherFacade
        final VoucherDataList dataList = new VoucherDataList();
        return getDataMapper().map(dataList, VoucherListWsDTO.class, fields);


4/ Modified – StorefrontAuthenticationSuccessHandler is partially refactored
  • StorefrontAuthenticationSuccessHandler doesn’t have direct methods for restoring the cart anymore – it does so via a cartRestorationStrategy bean – to be used in the custom extensions as well. Note that for restoring and merging existing entries in the cart, another strategy shall be used, namely mergingCartRestorationStrategy. Merging is not recommended by default for performance improvement.
  • StorefrontAuthenticationSuccessHandler doesn’t have the sessionService injected anymore (could be injected directly in the custom storefront auth success handler, or in super classes from acceleratorcommons, but I prefer to keep the OOTB clean for future upgrades).
local_offerevent_note November 3, 2016

account_box Mickael