Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Tomcat & XML-rpc

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,

Actually I have some problems to understand the real requirements for the XML-RPC. What I later on want to do is to transport information in an XML format and transform them on my server into SQL data for further tasks.

The simple program I am looking for is the Servlet Class - HelloServer. This contains the doPost/doGet functions. Accessing this should be performed by a commandline call "java HelloClient" .

The client should then trigger a "System.out.println" on the Server Side which will be displayed in the Tomcat server window. I think this should only be a few lines. My actual code is the following:

HelloHandler.java:



HelloServer.java



HelloClient.java


My Error Message is on the HelloClient command line:
java.io.IOException: Werver returned HTTP response code: 500 for URL: http://localhost:9090/HelloServerServlet/servlet/HelloServer

On the tomcat side I get
- Ctx(/HelloServerServlet) : Exception in preInit HelloServer - java.lang.InstantiationException: HelloServer
at java.lang.Class.newInstance0(Class.java:293)..... There is none of my classes mentioned! Mentioned are Class, ServletHandler, ContextManager, Tomcat3Adapter, Http11Processor, Http11Protocol, PoolTcpEndpoint, ThreadPool, Thread all have the .java ending

Thx for your help

Regards

Joe
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Put your servlet class in a package
2. create the correct web.xml for your application, specifying the servlet class and the url-mapping you will be using.
3. Read this FAQ entry on the invoker servlet to understand why you should NOT be using a URL with /servlet/ in it.
Bill
 
Joe Schaffer
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your help. I additionally found an error in my code. I haven't initialized the XML-RPC

THis is missing in the server:



Regards

Joe
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! 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