Unexpected error in LitiumConnectEventsListener

Hi,

This exceptions has started showing up in my logfile and I have no idea why this is happening.

Litium.Application.Runtime.ApplicationStartupEngine - Litium.Connect.Application.Erp.LitiumConnectEventsListener -> Unable to resolve service for type 'Litium.Sales.ShippingStateService' while attempting to activate 'Litium.Connect.Application.Erp.LitiumConnectEventsListener'. System.InvalidOperationException: Unable to resolve service for type 'Litium.Sales.ShippingStateService' while attempting to activate 'Litium.Connect.Application.Erp.LitiumConnectEventsListener'.

Is this configurable in some way? Or is there something else that I am missing?

Litium version: [7.6.1]

Are you using an upgraded solution from previous accelerator?

In the new accelerator code you have one new service defined as below, if you add that inside your project your startup-error should go away.

using Litium.Foundation.Modules.ECommerce.Carriers;
using Litium.Foundation.Modules.ECommerce.Deliveries;
using Litium.Foundation.Security;
using Litium.Sales;

namespace Litium.Accelerator.StateTransitions
{
    public class ShippingStateServiceImpl : ShippingStateService
    {
        public override short GetReturnedState()
        {
            return (short)DeliveryState.Returned;
        }

        public override bool IsDeliveredState(DeliveryCarrier delivery)
        {
            return delivery.DeliveryStatus == (short)DeliveryState.Delivered;
        }

        public override bool IsInitState(DeliveryCarrier delivery)
        {
            return delivery.DeliveryStatus == (short)DeliveryState.Init;
        }

        public override bool IsProcessingState(DeliveryCarrier delivery)
        {
            return delivery.DeliveryStatus == (short)DeliveryState.Processing;
        }

        public override bool IsReadyToShipState(DeliveryCarrier delivery)
        {
            return delivery.DeliveryStatus == (short)DeliveryState.ReadyToShip;
        }

        public override bool IsReturnedState(DeliveryCarrier delivery)
        {
            return delivery.DeliveryStatus == (short)DeliveryState.Returned;
        }

        public override void SetDelivered(Delivery delivery, SecurityToken token)
        {
            delivery.SetDeliveryStatus((short)DeliveryState.Delivered , token);
        }

        public override void SetProcessing(Delivery delivery, SecurityToken token)
        {
            delivery.SetDeliveryStatus((short)DeliveryState.Processing, token);
        }

        public override void SetReadyToShip(Delivery delivery, SecurityToken token)
        {
            delivery.SetDeliveryStatus((short)DeliveryState.ReadyToShip, token);
        }

        public override void SetReturned(Delivery delivery, SecurityToken token)
        {
            delivery.SetDeliveryStatus((short)DeliveryState.Returned, token);
        }
    }
}

You are indeed correct, we have an updated solution!

If I add the ShippingStateServiceImpl and the OrderStateServiceImpl from the accelerator the problems are gone. Would it be safe to add these classes “as is” to any solution or would it have impact on our current solution?

BR,
Mårten

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.