2

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.

Goran Petanjek
  • 444
  • 2
  • 11

4 Answers4

2

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

Goran Petanjek
  • 444
  • 2
  • 11
0

Maybe the ServiceDefinitionID does not match:

esbService vs. ESBServiceDefinition

Nils Breitmann
  • 647
  • 1
  • 4
  • 16
  • Thanks, tried that. But as I understand from here: https://support.intershop.com/kb/index.php/Display/2329T4#Cookbook-ManagedServiceFramework-Recipe:CreateaServiceDefinitionHowtoCreateaServiceDefinition serviceDefinitionID is not the same as serviceDefinition: serviceDefinitionID - myService - A ServiceDefinition is uniquely defined by cartridgeID and serviceDefinitionID. serviceDefinition - MyDefinition - Refers to the MyDefinition instance previously defined in the component configuration file – Goran Petanjek Jun 12 '18 at 11:13
  • One question Nils, is service.compoment file (in custom service_esb cartridge) automatically scanned for available services by server startup? Or how discovery of available services works? – Goran Petanjek Jun 12 '18 at 17:45
0

Can you try the following component settings:

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

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

  <!-- 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">
        <instance with="com.test.service.internal.ESBServiceDefinition" />
      </fulfill>
      <fulfill requirement="ChainElementID" value="LogHandler" />
      <fulfill requirement="ChainElementID" value="MonitorHandler" />
    </instance>
  </fulfill>
</components>
Willem Evertse
  • 1,219
  • 7
  • 16
  • Unfortunately it still doesn't work. I'm adding service via DBInit: https://support.intershop.com/kb/index.php/Display/2329T4#Cookbook-ManagedServiceFramework-Recipe:AddanAdapterDuringDBInitHowtoAddanAdapterDuringDBInit – Goran Petanjek Jun 12 '18 at 15:59
  • Did u also try to add it manually? If u can add it manually first we can look at the dbinit preparer later. – Willem Evertse Jun 13 '18 at 07:44
  • I can't add it manually because there is no ESBService listed under services tab under Sales Organizations -> https://support.intershop.com/kb/index.php/Display/2329T4#Cookbook-ManagedServiceFramework-Recipe:EnabletheServiceEnabletheService – Goran Petanjek Jun 13 '18 at 08:03
  • try using one of a standard groupid. . Should then be listed under Order Export Services. There must be a configuration bug somewhere – Willem Evertse Jun 13 '18 at 09:16
  • No, when opening Order Export Services group only "Local XML File Order Export" is displayed :( – Goran Petanjek Jun 13 '18 at 14:49
  • Maybe component framework doesn't even load my services.componet? Is there any way I could check? – Goran Petanjek Jun 13 '18 at 14:58
  • When debugging GetServiceDefinitions, I can see that ServiceDefinitionRegistry don't have my service registered. This is probably the issue, but why is that? I can see that my cartridge 'service_esb' that has service.component under staticfiles/cartridge/component is loaded in SMC for intershop.SLDSystem application. – Goran Petanjek Jun 13 '18 at 15:16
  • yeah, your service is not loading and usually the log files at startup will give you some clue why it didn't load a component. I'm also quite puzzled. Did you look at the logs file under eserver/server/local/log/ and eserver/server/share/system/log. You can also enable the debug logging in smc to maybe give some clue. Also is it possible to publish the cartridge to github? So i can try it on my machine. – Willem Evertse Jun 13 '18 at 15:47
  • I'm currently trying to import https://support.intershop.com/kb/index.php/Deliver/DOC/2329T4/sample_service_cartridge_source.zip cartridge and see if that service is registered. Will update you with results. Thank you for your support! – Goran Petanjek Jun 13 '18 at 15:50
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/173112/discussion-between-willem-evertse-and-goran-petanjek). – Willem Evertse Jun 14 '18 at 06:35
0

This is a long shot but did you try to redeploy the server after creating the custom managed service?

  1. Stop the server.
  2. Run gradlew deployServer
  3. Start the server
Bas de Groot
  • 676
  • 3
  • 16