Postby dsailer » Fri Sep 21, 2012 4:00 pm
After upgrading from 2.0.0-RC1-1 to 2.0.0-GA-SNAPSHOT the provide rest api services are no longer being exposed. I have updated the web.xml in the site project
<servlet>
<servlet-name>JerseyServlet</servlet-name>
<servlet-class>
com.sun.jersey.spi.spring.container.servlet.SpringServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JerseyServlet</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
Added this to applicationContext-servlet in the site project
<context:component-scan base-package="org.broadleafcommerce.core.web.api"/>
And I have added these to applicationContext in the site project to expose our own customer service.
<bean id="com.hibu.broadleaf.extensions.OfferItemCriteriaWrapper" class="com.hibu.broadleaf.extensions.OfferItemCriteriaWrapper" scope="prototype"/>
<bean id="com.hibu.broadleaf.extensions.OfferWrapper" class="com.hibu.broadleaf.extensions.OfferWrapper" scope="prototype"/>
<bean id="com.hibu.broadleaf.extensions.OffersWrapper" class="com.hibu.broadleaf.extensions.OffersWrapper" scope="prototype"/>
<bean id="hibuOfferEndpointService" class="com.hibu.broadleaf.extensions.OfferEndpointService"/>
The odd thing here is our custom service is getting served just fine. For example this url serves up the available offers:
api/hibu/offer/offers
However none of the provided services such as this are found.
api/catalog/products
We can see in the server log that Jersey only finds our custom api.
15:38:13,554 ERROR [STDERR] Sep 21, 2012 3:38:13 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet getContext
INFO: Using default applicationContext
15:38:13,567 ERROR [STDERR] Sep 21, 2012 3:38:13 PM com.sun.jersey.spi.spring.container.SpringComponentProviderFactory registerSpringBeans
INFO: Registering Spring bean, hibuOfferEndpointService, of type com.hibu.broadleaf.extensions.OfferEndpointService as a root resource class
15:38:13,578 ERROR [STDERR] Sep 21, 2012 3:38:13 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.11 12/09/2011 10:27 AM'