没有bean命名> ' mystoreBrandCategoryCodeValueProvider'可用(hybris)

时间:2018-05-22 14:21:40

标签: hybris

  

引起:java.util.concurrent.ExecutionException:   de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerRuntimeException:   de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException:   无法使用PK 8796431187969索引项目:没有名为bean的bean   ' mystoreBrandCategoryCodeValueProvider'可得到           在java.util.concurrent.FutureTask.report(FutureTask.java:122)〜[?:1.8.0_171]           在java.util.concurrent.FutureTask.get(FutureTask.java:192)〜[?:1.8.0_171]           at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.DefaultIndexerStrategy.runWorkers(DefaultIndexerStrategy.java:141)   〜[solrfacetsearchserver.jar:?]

当我尝试访问localhost for mystore时出现此错误。

我的步骤:

  • 我按照helphybris
  • 的说明从b2c创建了b2b
  • 它运作良好,因为我可以访问powertools网站
  • 我将所有来自powertools的impexes复制到mystoreinitialdata/import
  • 下的mystore
  • 然后我去了backoffice/wcms并将我的商店视为网址
  • 我也可以在catalogs标签上看到我的目录;产品,目录和分类。就像powertools一样。

我想要的是,将powertools impexes复制到mystore,我想在mystore下看到powertools项目。

但是它给出了我在开头发布的错误。

我只复制了impexes。

例如

mystore/solr.impex

;$solrIndexedType; color         ;string;;;Refine;Alpha; 4000;true;;mystoreVariantCategoryCodeValueProvider;categoryFacetDisplayNameProvider;defaultTopValuesProvider

我从powertools复制了。但是powertools已经

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context.xsd">

    <context:annotation-config/> 

    <alias alias="b2bAcceleratorCoreSystemSetup" name="powertoolsStoreSystemSetup" />
    <bean id="powertoolsStoreSystemSetup" class="de.hybris.platform.powertoolsstore.setup.PowertoolsStoreSystemSetup" parent="abstractCoreSystemSetup">
        <property name="powertoolsCoreDataImportService" ref="powertoolsCoreDataImportService"/>
        <property name="powertoolsSampleDataImportService" ref="powertoolsSampleDataImportService"/>
    </bean>

    <bean id="powertoolsSampleDataImportService" class="de.hybris.platform.powertoolsstore.services.dataimport.impl.PowertoolsSampleDataImportService" 
        parent="sampleDataImportService">
    </bean>
    <bean id="powertoolsCoreDataImportService" class="de.hybris.platform.powertoolsstore.services.dataimport.impl.PowertoolsCoreDataImportService"
          parent="coreDataImportService">
    </bean>

    <!-- Solr field value providers TEMPORARY FOR NOW SO DO NOT NEED TO DEPEND ON yb2bacceleratorcore -->

        <bean id="powertoolsCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
        <property name="categorySource" ref="powertoolsCategorySource"/>
    </bean>
    <bean id="powertoolsBrandCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
        <property name="categorySource" ref="powertoolsBrandCategorySource"/>
    </bean>
    <bean id="powertoolsVariantCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
        <property name="categorySource" ref="powertoolsVariantCategorySource"/>
    </bean>


    <bean id="powertoolsCategoryNameValueProvider" parent="abstractCategoryNameValueProvider">
        <property name="categorySource" ref="powertoolsCategorySource"/>
    </bean>

    <bean id="powertoolsBrandCategoryNameValueProvider" parent="abstractCategoryNameValueProvider">
        <property name="categorySource" ref="powertoolsBrandCategorySource"/>
    </bean>

        <bean id="powertoolsCategorySource" parent="variantCategorySource">
        <property name="rootCategory" value="1"/> <!-- '1' is the root icecat category -->
    </bean>
    <bean id="powertoolsVariantCategorySource" parent="variantCategorySource"/>

    <bean id="powertoolsBrandCategorySource" parent="defaultCategorySource">
        <property name="rootCategory" value="brands"/> <!-- 'brands' is the root of the brands hierarchy -->
    </bean>

    <!-- Solr field value providers TEMPORARY FOR NOW SO DO NOT NEED TO DEPEND ON yb2bacceleratorcore -->


</beans>

这在powertoolsspring-xml

mystorestore没有文件夹,因为该目录是

中的powertoolsstore
<bean id="powertoolsSampleDataImportService" class="de.hybris.platform.powertoolsstore.services.dataimport.impl.PowertoolsSampleDataImportService" 
        parent="sampleDataImportService">

 class="de.hybris.platform.powertoolsstore.setup.PowertoolsStoreSystemSetup" 

mystore只有

的MyStore / initialdata /安装/ InitialDataSystemSetup.java

    <bean id="powertoolsSampleDataImportService" class="de.hybris.platform.powertoolsstore.services.dataimport.impl.PowertoolsSampleDataImportService" 
    parent="sampleDataImportService">

mystore没有服务。

我该怎么办?我想看看localhost与项目。所以我认为最好的方法是从powertools复制?

3 个答案:

答案 0 :(得分:1)

你solr indexer cron job正在搜索bean&#39; mystoreBrandCategoryCodeValueProvider&#39;,所以这个bean应该在你的spring文件中定义,如果不使用就删除它。 可能的解决方案:

<强> 1。更新solr.impex:如果您不使用它,请删除此bean并通过hac导入impex或更新系统,并在系统更新时导入您的impex。 如果某个旧文件正在使用此bean,请检查您的solrIndexedType,将其删除(通过hmc)

2.如果您正在使用它,请将此bean添加到spring文件中。

答案 1 :(得分:1)

希望您已正确复制所有Impex

确保

  • 在右侧文件夹路径中正确复制impex /mystoreinitialdata/resources/mystoreinitialdata/import/sampledata/productCatalogs/mystoreProductCatalog/products-media.impex

  • 使用mystore

  • 更新powertool字参考
  • 将siteResource指向正确的路径 $siteResource=jar:com.mystore.initialdata.constants.MystoreInitialDataConstants&/mystoreinitialdata/import/sampledata/productCatalogs/$productCatalog
  • 更正InitialDataSystemSetup类

喜欢

public static final String MYSTORE = "mystore";

@SystemSetup(type = Type.PROJECT, process = Process.ALL)
    public void createProjectData(final SystemSetupContext context)
    {
        final List<ImportData> importData = new ArrayList<ImportData>();

        final ImportData mystoreImportData = new ImportData();
        mystoreImportData.setProductCatalogName(MYSTORE);
        mystoreImportData.setContentCatalogNames(Arrays.asList(MYSTORE));
        mystoreImportData.setStoreNames(Arrays.asList(MYSTORE));
        importData.add(mystoreImportData);

        /* uncomment below line to test mystoreinitialdata */
                getCoreDataImportService().execute(this, context, importData);
                getEventService().publishEvent(new CoreDataImportedEvent(context, importData));

                getSampleDataImportService().execute(this, context, importData);
                getEventService().publishEvent(new SampleDataImportedEvent(context, importData));
    }
  • 在您的impex中使用的* core-spring.xml中更正/添加bean。

<bean id="yAcceleratorInitialDataSystemSetup"
      class="com.wurthusa.initialdata.setup.InitialDataSystemSetup"
      parent="abstractCoreSystemSetup">
    <property name="coreDataImportService" ref="coreDataImportService"/>
    <property name="sampleDataImportService" ref="sampleDataImportService"/>
</bean>

<!-- Solr ValueProvider     -->

<bean id="mystoreCategorySource" parent="variantCategorySource">
    <property name="rootCategory" value="1" /> <!-- '1' is the root icecat category -->
</bean>

<bean id="mystoreVariantCategorySource" parent="variantCategorySource" />

<bean id="mystoreBrandCategorySource" parent="defaultCategorySource">
    <property name="rootCategory" value="brands" /> <!-- 'brands' is the root of the brands hierarchy -->
</bean>

<bean id="mystoreCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
    <property name="categorySource" ref="mystoreCategorySource" />
</bean>
<bean id="mystoreBrandCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
    <property name="categorySource" ref="mystoreBrandCategorySource" />
</bean>
<bean id="mystoreVariantCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
    <property name="categorySource" ref="mystoreVariantCategorySource" />
</bean>

<bean id="mystoreCategoryNameValueProvider" parent="abstractCategoryNameValueProvider">
    <property name="categorySource" ref="mystoreCategorySource" />
</bean>

<bean id="mystoreBrandCategoryNameValueProvider" parent="abstractCategoryNameValueProvider">
    <property name="categorySource" ref="mystoreBrandCategorySource" />
</bean>
  • 更新您的系统

答案 2 :(得分:0)

更新正在运行的系统! hac&gt;平台&gt;更新

enter image description here