blCustomerService is declared via annotations in the class CustomerServiceImpl in the broadleaf-profile.jar. If you're getting null for this service in your spring managed bean, then I suspect one of two things. Either you don't have the broadleaf-profile.jar on the classpath (but I imagine you do or otherwise you would get a compilation error for your class that references CustomerService), or you have not engaged the Spring scanning mechanism. For Spring to autowire these annotated services, you have to include some key items in your application context xml file to get it started. In the broadleaf application context, we accomplish this via the following:
Code: Select all
<context:component-scan base-package="org.broadleafcommerce" />
Refer to the Spring documentation around the topic of autowiring for more information.