A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Web Services
Author
Can someone help in identifying what is wrong with the code?
Himanshu Gupta
Ranch Hand
Joined: Aug 18, 2008
Posts: 598
I like...
posted
Jun 08, 2009 14:38:27
0
I am trying to learn Webservice. Right now I was looking in RPC and was confronted with the following error.
Can someone help me here.
package com.ecerami.xmlrpc; import java.io.IOException; import javax.management.modelmbean.XMLParseException; import org.apache.xmlrpc.webserver.WebServer; public class AreaServer { public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage: java AreaServer [port]"); System.exit(-1); } try { startServer(args); } catch (IOException e) { System.out.println("Could not start server: " + e.getMessage()); } } public static void startServer(String[] args) throws IOException { // Start the server, using built-in version System.out.println("Attempting to start XML-RPC Server..."); WebServer server = new WebServer(Integer.parseInt(args[0])); server.run(); System.out.println("Started successfully."); // Register our handler class as area server.addHandler("area", new AreaHandler()); <-- This method is not there in the WebServer class System.out.println("Registered AreaHandler class to area."); System.out.println("Now accepting requests. (Halt program to stop.)"); } }
I am also attaching the screenshot of my workspace for better clarity.
screenShot.jpg
ScreenShot of workspace
My Blog
SCJP 5 SCWCD 5
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35235
7
posted
Jun 08, 2009 16:18:00
0
I'm not familiar with the org.apache.xmlrpc.webserver.WebServer class, but if it doesn't have some particular mathod, why are you trying to use that method?
Android apps
–
ImageJ plugins
–
Java web charts
Himanshu Gupta
Ranch Hand
Joined: Aug 18, 2008
Posts: 598
I like...
posted
Jun 08, 2009 23:01:08
0
Well I am referring some book and in that this program was given. OI was just trying to run it so that I can have better understanding.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35235
7
posted
Jun 09, 2009 01:15:51
0
Well,
that class has no such method
, so you need to try something else.
Himanshu Gupta
Ranch Hand
Joined: Aug 18, 2008
Posts: 598
I like...
posted
Jun 09, 2009 07:27:53
0
Yes the example is done using older version.
Thanks Ulf for the help.
I agree. Here's the link:
http://aspose.com/file-tools
subject: Can someone help in identifying what is wrong with the code?
Similar Threads
question About Packaging
Grizzly Jersey REST and static HTML
how to implement XML-RPC
how to start server in command line...
Problem in WebServer
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter