I'm converting a Restlet component to use the Spring extension (on top of the
Servlet extension). The component needs to make calls using ClientResource so
I've added an http connector via Spring but I get the following warning:
By default, the outbound root of an application can't handle calls without
being attached to a parent component.
I didn't have to manually attach a Restlet before starting the Spring
integration so I'm not sure what to do here. I've tried attaching it to the
default Application and then to the Component. In both cases the warning goes
away but I perpetually get a 404 back on my client calls.
I'm attaching my applicationContext.xml
Thanks in advance.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2778197
<?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:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<bean id="component" class="org.restlet.ext.spring.SpringComponent">
<property name="name" value="APIUS Identity Component" />
<property name="description" value="Authentication and authorization. Session management." />
<property name="owner" value="apius.org" />
<property name="author" value="Paul Morris" />
<property name="clientsList">
<list>
<value>http</value>
</list>
</property>
<property name="defaultHost" ref="defaultHost" />
</bean>
<bean id="component.context" class="org.springframework.beans.factory.config.PropertyPathFactoryBean" />
<bean id="defaultHost" class="org.restlet.ext.spring.SpringHost">
<constructor-arg ref="component" />
<property name="defaultAttachment" ref="openAmSessionApplication" />
</bean>
<bean id="componentChildContext" class="org.restlet.Context">
<lookup-method name="createChildContext" bean="component.context" />
</bean>
<bean id="openAmSessionApplication" class="org.restlet.Application">
<constructor-arg ref="componentChildContext" />
<property name="name" value="OpenAM Session Application"/>
<property name="description" value="The APIUS session API meets the OpenAM RESTful API." />
<property name="owner" value="apius.org" />
<property name="author" value="Paul Morris" />
<property name="inboundRoot">
<bean class="org.restlet.ext.spring.SpringRouter">
<constructor-arg ref="openAmSessionApplication" />
<property name="attachments">
<map>
<entry key="/session">
<bean class="org.restlet.ext.spring.SpringFinder">
<lookup-method name="create" bean="openAmSession" />
</bean>
</entry>
<entry key="/session/attributes">
<bean class="org.restlet.ext.spring.SpringFinder">
<lookup-method name="create" bean="openAmSessionAttributes" />
</bean>
</entry>
</map>
</property>
</bean>
</property>
<property name="outboundRoot" ref="component" />
</bean>
<bean id="engine" class="org.restlet.engine.Engine" factory-method="getInstance">
<property name="registeredAuthenticators">
<list merge="true">
<bean class="org.apius.identity.session.SessionAuthenticatorHelper" />
</list>
</property>
</bean>
<!--bean id="hello" class="test.HelloWorldResource" scope="prototype" />-->
<bean id="openAmSession" class="org.apius.identity.session.openam.SessionImpl" scope="prototype">
<constructor-arg ref="openAmSessionProvisionerProxy" />
<constructor-arg ref="openAmAuthenticator" />
</bean>
<bean id="openAmResponseParser" class="org.apius.identity.session.openam.ResponseParser">
<property name="documentHelper" ref="documentHelper"/>
</bean>
<bean id="documentHelper" class="org.apius.xml.DocumentHelper" />
<bean id="openAmSessionProvisionerProxy" class="org.apius.identity.session.openam.SessionProvisionerProxyImpl" scope="prototype">
<constructor-arg ref="openAmResponseParser" />
</bean>
<bean id="openAmSessionAttributes" class="org.apius.identity.session.openam.SessionAttributesImpl" scope="prototype">
<constructor-arg ref="openAmSessionProvisionerProxy" />
<constructor-arg ref="openAmAuthenticator" />
</bean>
<bean id="openAmAuthenticator" class="org.apius.identity.session.filter.SessionAuthenticator">
<constructor-arg ref="componentChildContext" />
<constructor-arg value="nmpg" />
<constructor-arg ref="openAmSessionVerifier" />
<constructor-arg ref="openAmSessionProvisionerProxy" />
</bean>
<bean id="openAmAuthorizer" class="org.apius.identity.session.filter.SessionAuthorizer">
<constructor-arg ref="openAmSessionProvisionerProxy" />
</bean>
<bean id="openAmSessionVerifier" class="org.apius.identity.session.SessionVerifier">
<constructor-arg ref="openAmSessionProvisionerProxy" />
</bean>
</beans>