2

我们正在尝试按照说明书开发自定义 Intershop 托管服务:https: //support.intershop.com/kb/index.php/Display/2329T4 但是当尝试在我们组织的运营中启用服务时,它没有在那里和那里列出是一条警告日志消息:

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'. 

这是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>

所有必需的类(AdapterInterface、Adapter、ExecutorService、ServiceDefinition - 扩展 AbstractServiceDefinition)均已成功实现和编译。有人知道为什么 Intershop 无法加载实现吗?

此外,在组件编辑器的 Intershop Studio 中,打开 services.component 时会显示以下错误:

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

但是当在“ESBServiceDefinitionImpl”实现上单击 CTRL+鼠标左键时,发现并

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

突出显示。

4

4 回答 4

2

当然这是错字:) 我用 service.component 命名文件夹“组件”,而不是“组件”。谢谢大家的帮助!

于 2018-06-14T08:47:14.767 回答
0

您可以尝试以下组件设置:

<?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>
于 2018-06-12T12:19:47.500 回答
0

这是一个长镜头,但您是否尝试在创建自定义托管服务后重新部署服务器?

  1. 停止服务器。
  2. gradlew deployServer
  3. 启动服务器
于 2018-06-13T06:59:59.303 回答
0

也许 ServiceDefinitionID 不匹配:

esbService 与 ESBServiceDefinition

于 2018-06-12T10:56:23.730 回答