Search code examples
servicemanagedintershop

Defining custom managed service fails


We are trying to develop custom Intershop Managed Service following cookbook: https://support.intershop.com/kb/index.php/Display/2329T4 But when trying to enable service in Operations for our Organization, it is not listed there and there is a warning log message:

WARN  localhost ES1 appserver0 [Test-Site]  com.intershop.component.service.internal.service.ORMServiceConfigurationBORepositoryImpl [] [Storefront] [8ocH1vmRUp4E1qKOZQQC5FFRtQai9r4QV6dAV1yx] [oBlLAFsfl5kFMqjA-0-00] "oBlLAFsfl5kFMqjA-0-00" Can't load implementation for service definition: cartridge='service_esb', service definition id='ESBServiceDefinition'. 

Here is services.compoment:

<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010">
  <!-- Adapter interface -->
  <contract name="ESBService" class="com.test.service.capi.ESBService" />

  <!-- ServiceDefintion implementation -->
  <implementation name="ESBServiceDefinitionImpl" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />

  <!-- ServiceDefintion instance that has already one adapter added -->
  <instance name="ESBServiceDefinition" with="ESBServiceDefinitionImpl" />

  <!-- Registering the ServiceDefintion instance to the (global) ServiceDefinitionRegistry -->
  <fulfill requirement="serviceDefinition" of="serviceDefinitionRegistry">
    <instance with="ServiceDefinitionRegistry.Entry">
      <fulfill requirement="cartridgeID" value="service_esb" />
      <fulfill requirement="groupID" value="service.group.name.test" />
      <fulfill requirement="parameterGroupID" value="ESBParameters" />
      <fulfill requirement="serviceDefinitionID" value="esbService" />
      <fulfill requirement="localizationKeyForName" value="service.definition.name.esbService" />
      <fulfill requirement="serviceDefinition" with="ESBServiceDefinition" />
      <fulfill requirement="ChainElementID" value="LogHandler" />
      <fulfill requirement="ChainElementID" value="MonitorHandler" />
    </instance>
  </fulfill>
</components>

All required classes (AdapterInterface, Adapter, ExecutorService, ServiceDefinition - extending AbstractServiceDefinition) are implemented and compiled successfully. Does anybody knows why Intershop can't load implementation?

Also, in Intershop Studio in component editor following error is displayed when services.component is opened:

With 'Implementation - ESBServiceDefinitionImpl (unresolved)' cannot be resolved

But when clicking CTRL+left mouse button on "ESBServiceDefinitionImpl" implementation is found and

<implementation name="ESBServiceDefinitionImpl" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />

is highlighted.


Solution

  • Of course it was typo :) I named folder with service.component "component", and not "components". Thank you all for your help!