找不到具有extensionID

时间:2018-06-29 15:20:05

标签: intershop

我正在Intershop 7中处理业务对象层,并尝试创建具有相关业务存储库(扩展名)的自定义业务对象 A1PromotionBO 。

我已经完成了持久对象层(A1PromotionPO,Mgrs,EDL模型,自动生成的类,数据库..)。

通过遵循本食谱-商业对象(https://support.intershop.com/kb/index.php/Display/27K270),我已经

创建的软件包* .a1promotion.capi包含:

 - interface A1PromotionBO extends BusinessObject
 - interface A1PromotionBORepository extends BusinessObjectRepository
 - interface A1PromotionBORepositoryExtension extends BusinessObjectExtension<RepositoryBO>, A1PromotionBORepository

创建的包* .a1promotion.internal包含:

 - class ORMA1PromotionBOImpl extends AbstractExtensibleObjectBO<A1PromotionPO> implements A1PromotionBO
 - class ORMA1PromotionBORepositoryImpl extends AbstractDomainRepositoryBOExtension implements A1PromotionBORepository, ObjectMapper<Object, A1PromotionBO>
 - class A1PromotionBORepositoryExtensionFactory extends AbstractDomainRepositoryBOExtensionFactory

EXTENSION_ID =在接口A1PromotionBORepositoryExtension和类A1PromotionBORepositoryExtensionFactory中都定义了“ A1PromotionBORepository”。


现在,在创建A1PromotionBORepository PromotionBORepository时,返回A1PromotionBO集合的管道失败了:

public class GetPromotions extends Pipelet {
    @Inject
    private CurrentApplicationBOProvider applicationBOProvider;

    /** The domain mgr. */
    @Inject
    private DomainMgr domainMgr;

    @Override
    public int execute(PipelineDictionary dict) throws PipeletExecutionException {
        final ApplicationBO applicationBO = applicationBOProvider.get();
        final A1PromotionBORepository promotionBORepository = applicationBO.getRepository(A1PromotionBORepositoryExtensionFactory.EXTENSION_ID);

        final String promotionDomainName = dict.get("PromotionDomain");
        final Domain promotionDomain = domainMgr.getDomainByName(promotionDomainName);
        if (null == promotionDomain) {
            throw new PipeletExecutionException("Mandatory input parameter 'ProductsDomain' not available in pipeline dictionary.");
        }

        final Collection<A1PromotionBO> promotions = (Collection<A1PromotionBO>)promotionBORepository.getAllPromotions();
        dict.put("Promotions", promotions);

        return PIPELET_NEXT;
    }
}

完整的堆栈异常跟踪:

Caused by: com.intershop.component.application.capi.ApplicationBOException: Can not find business object factory with extensionID A1PromotionBORepository in application ApplicationBO(Shop@A1-Site (app=a1Shop.Backoffice))
    at com.intershop.component.application.internal.ApplicationBORepositoriesExtensionImpl.getRepository(ApplicationBORepositoriesExtensionImpl.java:49)
    at com.intershop.component.application.internal.ApplicationBOImpl.getRepository(ApplicationBOImpl.java:222)
    at hr.a1.bo.promotion.pipelet.GetPromotions.execute(GetPromotions.java:44)
    at com.intershop.beehive.core.internal.pipeline.PipeletNode.executeNode(PipeletNode.java:346)
    ... 42 more

0 个答案:

没有答案