Hi Techies,
I am integrating Restlet with Spring,
my web.xml
========
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>org.restlet.component</param-name>
<param-value>component</param-value>
</context-param>
<!-- SPRING -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/SpringRestlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- RESTLET -->
<servlet>
<servlet-name>RestletServlet</servlet-name>
<servlet-class>com.noelios.restlet.ext.spring.SpringServerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/InvokeRestletWS/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
my SpringConfig file
=============
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="component" class="org.restlet.ext.spring.SpringComponent">
<property name="defaultTarget" ref="exampleApplication"/>
</bean>
<bean id="exampleApplication" class="org.restlet.Application">
<property name="root" ref="restletRouter" />
</bean>
<bean name="restletRouter" class="org.restlet.ext.spring.SpringRouter">
<property name="attachments">
<map>
<entry key="/example">
<bean
class="com.restlet.webservice.InvokeRestletWebService">
</bean>
</entry>
</map>
</property>
</bean>
</beans>
==========
and my controller is
==============
public class InvokeRestletWebService extends Application {
public Restlet createInboundRoot() {
Restlet restlet = new Restlet() {
@Override
public void handle(Request req, Response res) {
res.setEntity(new StringRepresentation("Hello
World !!",
MediaType.TEXT_PLAIN));
}
};
return restlet;
}
}
==================
While invoking this Restlet Webservice am facing the following error....
java.lang.NoSuchMethodError:
org.restlet.Client.get(Ljava/lang/String;)Lorg/restlet/data/Response;
com.noelios.restlet.ext.servlet.ServerServlet.isDefaultComponent(ServerServlet.java:838)
com.noelios.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:691)
com.noelios.restlet.ext.servlet.ServerServlet.init(ServerServlet.java:818)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
java.lang.Thread.run(Thread.java:595)
==========
Am using the following Jar files,
asm-1.3.3.jar
cglib-2.0.1.jar
com.noelios.restlet.ext.servlet_2.5.jar
com.noelios.restlet.ext.spring_2.5.jar
com.noelios.restlet.jar
commons-logging.jar
org.restlet.ext.spring.jar
org.restlet.jar
org.restlet.util.jar
spring.jar
========
Any Suggestions and reference welcome please...
========
Thangavel
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Spring-with-Restlet-Issue-tp5338774p5338774.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2638304