Page 1 of 1

Custom Persistence Handler not getting initialized

Posted: Wed Feb 19, 2014 5:53 am
by teja22060
Hi,

I followed the tutorial in

http://docs.broadleafcommerce.org/core/ ... e-handlers,

i created my own custompersistence handler extending from CustomPersistenceHandlerAdapter, and extended methods
canhandlefetch and fetch methods. And registered it as @Component.

But when i debug PersistenceManagerImpl i am not getting my handler listed in getCustomPersistenceHandlers() method.

I am using Broadleaf 3.0.8GA. Any thoughts will be greatly appreciated.

Thanks,
Raviteja

Re: Custom Persistence Handler not getting initialized

Posted: Wed Feb 19, 2014 11:08 am
by phillipuniverse
Did you include this part in an admin applicationContext?

Code: Select all

<bean id="blCustomPersistenceHandlers" class="org.springframework.beans.factory.config.ListFactoryBean" scope="prototype">
    <property name="sourceList">
        <list>
            <bean class="com.mycompany.admin.handler.ProductCustomPersistenceHandler" />
        </list>
    </property>
</bean>


If you've already registered it with @Component and it's getting component-scanned then you could use the bean ref instead:

Code: Select all

<bean id="blCustomPersistenceHandlers" class="org.springframework.beans.factory.config.ListFactoryBean" scope="prototype">
    <property name="sourceList">
        <list>
            <ref bean="persistenceHandlerId" />
        </list>
    </property>
</bean>

Re: Custom Persistence Handler not getting initialized

Posted: Thu Feb 20, 2014 6:13 am
by teja22060
This issue is resolved when i placed the bean as a reference.

Thanks,
Raviteja