By the way, you might want to add @XmlRootElement to the Item class
declaration - I'm not sure the explicit collection (List<Item>) will be
properly serialized otherwise, alternatively you may just want to set a
'marshalAsJaxbElement' on a jaxb provider - if you'd like to avoid setting
@XmlRootElement
cheers, Sergey
Sergey Beryozkin wrote:
>
> Hi
>
> Everything seems to be ok.
> It appears the problem is to do with a missing import :
>
> <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"
> />
>
> can you add it please to your beans.xml ?
>
> For some reasons Catalog class is not introspected. Perhaps due to the
> fact the above import is missing and thus no jaxrs-aware spring factory is
> invoked
>
> cheers, Sergey
>
>
> KARR, DAVID (ATTCINW) wrote:
>>
>> I'm trying to set up a simple REST prototype running alongside some
>> other existing code.
>>
>> When I deploy, I appear to fall into the following "if" block in
>> "AbstractJAXRSFactoryBean.checkResources()":
>>
>> -----------------
>> if (list.size() == 0) {
>> org.apache.cxf.common.i18n.Message msg =
>> new
>> org.apache.cxf.common.i18n.Message("NO_RESOURCES_AVAILABLE",
>> BUNDLE);
>> LOG.severe(msg.toString());
>> throw new
>> WebApplicationException(Response.Status.NOT_FOUND);
>> }
>> ---------------
>>
>> This list would be empty if "serviceFactory.getRealClassResourceInfo()"
>> returned an empty list. What exactly would that indicate?
>>
>> My beans.xml is very simple right now, just:
>> -----------------------
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:jaxws="http://cxf.apache.org/jaxws"
>> xmlns:jaxrs="http://cxf.apache.org/jaxrs"
>> xsi:schemaLocation="
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>> http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
>>
>> <import resource="classpath:META-INF/cxf/cxf.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"
>> />
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>>
>> <jaxrs:server name="restcatalogserver" address="/rest">
>> <jaxrs:serviceBeans>
>> <bean class="com.att.ecom.catalog.Catalog"/>
>> </jaxrs:serviceBeans>
>> </jaxrs:server>
>> </beans>
>> --------------------
>>
>> The "Catalog" class is also very primitive so far:
>> --------------------------
>> package com.att.ecom.catalog;
>>
>> import java.util.ArrayList;
>> import java.util.List;
>>
>> import javax.ws.rs.GET;
>> import javax.ws.rs.Path;
>> import javax.ws.rs.Produces;
>>
>> @Path("/catalog/")
>> @Produces("application/xml")
>> public class Catalog {
>>
>> @GET
>> @Path("/items")
>> public List<Item> getItems() {
>> ArrayList<Item> result = new ArrayList<Item>();
>> result.add(new Item());
>> return (result);
>> }
>>
>> public static class Item {
>> private String title;
>> private String description;
>>
>> public String getTitle() { return title; }
>> public String getDescription() { return description; }
>>
>> public void setTitle(String title) { this.title = title;
>> }
>> public void setDescription(String description) {
>> this.description = description; }
>> }
>> }
>> ----------------------------
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/getting-%22NO_RESOURCES_AVAILABLE%22-from-%22AbstractJAXRSFactoryBean.checkResources%28%29%22-tp25120790p25123062.html
Sent from the cxf-user mailing list archive at Nabble.com.