I have a pretty simple application I'm trying to work on presently which
attempts to configure Restlet within a Spring container for use with JAXRS
and JAXB.
Here's what my Spring configuration file looks like:
<bean id="restlet.component"
class="org.restlet.ext.spring.SpringComponent">
<property name="server" ref="restlet.server"/>
<property name="defaultTarget" ref="restlet.router"/>
</bean>
<bean id="restlet.server" class="org.restlet.ext.spring.SpringServer"
init-method="start" destroy-method="stop">
<constructor-arg value="${restlet.server.protocol}"/>
<constructor-arg value="${restlet.server.port}"/>
</bean>
<bean id="restlet.router" class="org.restlet.ext.spring.SpringRouter">
<property name="attachments">
<map>
<entry key="/stream/{streamId: (?:\d+)?}"
value="com.rest.StreamResource"/>
</map>
</property>
</bean>
Here's my StreamResource class:
public class StreamResource {
private static Logger logger =
LoggerFactory.getLogger(StreamResource.class);
@GET
@Produces("text/xml")
public Stream getXML(@PathParam("streamName") Integer streamId)
{
logger.debug("returning xml representation of stream:
{}");
return null;
}
}
It's pretty simple, right? However, when my application is booting up, I get
the following warnings in the logs:
15:19:52.419 [main] WARN
org.springframework.beans.GenericTypeAwarePropertyDescriptor - Invalid
JavaBean property 'attachments' being accessed! Ambiguous write methods
found next to actually used [public void
org.restlet.ext.spring.SpringRouter.setAttachments(java.util.Map)]: [public
static void
org.restlet.ext.spring.SpringRouter.setAttachments(org.restlet.routing.Router,java.util.Map)]
15:19:52.423 [main] WARN org.restlet.ext.spring.SpringRouter - Unknown
class found in the mappings. Only subclasses of
org.restlet.resource.Resource and ServerResource are allowed.
How can I configure the application so I can configure my resources with
JAXRS, configure the main boilderplate stuff in Spring, and encode my data
types with JAXB? What am I missing here?
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/How-can-I-use-JAXRS-and-JAXB-with-the-Spring-extension-in-Restlet-tp6639300p6639300.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2807290