Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML-RPC servlet problem with jetty9

 
Nasser Abdullah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome

i have servlet and web.xml (show below) and i use jetty container to run it . but when i run jetty server dont read my project.

how can i solve this problem ?



servlet is ExampleService.java

package example;

import java.util.Random;
import java.util.HashMap;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import redstone.xmlrpc.XmlRpcServlet;

public class ExampleService extends XmlRpcServlet
{
public void init( ServletConfig servletConfig ) throws ServletException
{
super.init( servletConfig );

getXmlRpcServer().addInvocationHandler( "SimpleDatabase", new HashMap() );
getXmlRpcServer().addInvocationHandler( "RandomNumberGenerator", new Random() );
}
}


and the web.xml file is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.5">

<!-- To save as "hello\WEB-INF\web.xml" -->
<servlet>
<servlet-name>ExampleService</servlet-name>
<servlet-class>ExampleService</servlet-class>
<init-param>
<param-name>streamMessages</param-name>
<param-value>1</param-value>
</init-param>
<init-param> <!-- Optional! Defaults to text/xml and ISO-8859-1 -->
<param-name>contentType</param-name>
<param-value>text/xml; charset=ISO-8859-1</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ExampleService</servlet-name>
<url-pattern>/redstone</url-pattern>
</servlet-mapping>

</web-app>


The final application like this in jetty:
/WEB-INF
web.xml
classes/
example/ExampleService.class
lib/
xmlrpc.jar

i wait to help queckly please . thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic