Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

XML-RPC servlet problem with jetty9

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic