users@jax-rpc.java.net

My example stopped working!?!

From: Barry Burd <me_at_BARRYBURD.COM>
Date: Wed, 03 Apr 2002 08:36:27 -0700

Please excuse the long post, but I'm stumped.
I have an example that was working, earlier
today, and then it stopped working (for no apparent reason).
Since I don't know what part of it isn't working, I'm
sending lots of stuff.

Each of the following files is in my directory named
C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock
(and these are the only files in that directory):

-----------------
File build.properties:
# This file is referenced by the build.xml file.

example=stock
client-class=stock.StockClient
endpoint=http://localhost:8080/jaxrpc-stock/jaxrpc/StockIFPort
web-inf-config=StockQuote_Config.properties
context-path=jaxrpc-stock
war-file=${context-path}.war
client-jar=${example}-client.jar
build-path=${docs-path}/tutorial/examples/jaxrpc/${example}/${build}
--------------
File build.xml:
<!DOCTYPE project [
  <!ENTITY commonTargets SYSTEM "../common/targets.xml">
]>

<project name="JAX-RPC Tutorial" default="build" basedir=".">

  <property file="../common/build.properties"/>
  <property file="build.properties"/>

  &commonTargets; <!-- The ant targets are in ../common/targets.xml -->

</project>
------------------
File Web.xml:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.
    //DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
   <servlet>
      <servlet-name>JAXRPCEndpoint</servlet-name>
      <servlet-class>
         com.sun.xml.rpc.server.http.JAXRPCServlet
      </servlet-class>

      <init-param>
         <param-name>configuration.file</param-name>
         <param-value>
            /WEB-INF/StockQuote_Config.properties
         </param-value>
      </init-param>
   </servlet>

   <servlet-mapping>
      <servlet-name>JAXRPCEndpoint</servlet-name>
      <url-pattern>/jaxrpc/*</url-pattern>
   </servlet-mapping>
</web-app>
-----------------
File config.xml:
<?xml version="1.0" encoding="UTF-8"?>

<configuration
   xmlns="http://java.sun.com/jax-rpc-ri/xrpcc-config">

   <rmi name="StockQuoteService"
      targetNamespace="http://stock.org/wsdl"
      typeNamespace="http://stock.org/types">

      <service name="StockQuote" packageName="stock">
         <interface name="stock.StockIFPort"
            servantName="stock.StockImpl"/>
      </service>
   </rmi>

</configuration>
---------------------
File StockImpl.java:
package stock;

public class StockImpl implements StockIFPort
{
   public double getQuote(String company)
   {
      if (company.equals("SUNW"))
         return 17.5300;
      else
         return 8.6600;
   }

   public String getSymbol(String company)
   {
      if (company.equals("Sun"))
         return ("SUNW");
      else
         return "other";
   }
}
-----------------
File StockIFPort.java:
package stock;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface StockIFPort extends Remote
{
   public double getQuote(String s) throws RemoteException;

   public String getSymbol(String s) throws RemoteException;
}
------------------

So here's what happens:

I start running Tomcat. Then I have the following command-line session:

C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock>ant compile-server
Buildfile: build.xml

prepare:
     [echo] Creating the required directories....
    [mkdir] Created dir: C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\client\
stock
    [mkdir] Created dir: C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\server\
stock
    [mkdir] Created dir: C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\shared\
stock
    [mkdir] Created dir: C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\dist

compile-server:
     [echo] Compiling the server-side source code....
    [javac] Compiling 2 source files to C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stoc
k\build\shared

BUILD SUCCESSFUL

Total time: 5 seconds
C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock>ant xrpcc-server
Buildfile: build.xml

prepare:
     [echo] Creating the required directories....

compile-server:
     [echo] Compiling the server-side source code....
    [javac] Compiling 2 source files to C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stoc
k\build\shared

xrpcc-server:
     [echo] Running xrpcc for the server:

BUILD SUCCESSFUL

Total time: 7 seconds
C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock>ant install
Buildfile: build.xml

setup-web-inf:
     [echo] Setting up build/WEB-INF....
    [mkdir] Created dir: C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\WEB-INF
\classes\stock
     [copy] Copying 12 files to C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\
WEB-INF\classes\stock
     [copy] Copying 1 file to C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\WE
B-INF
     [copy] Copying 1 file to C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock\build\WE
B-INF

install:
     [echo] Installing the application....
  [install] OK - Installed application at context path /jaxrpc-stock
  [install]

BUILD SUCCESSFUL

Total time: 49 seconds
C:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\stock>


THEN, I OPEN MY WEB BROWSER AND POINT TO http://localhost:8080/jaxrpc-stock/jaxrpc,
and I get

HTTP Status 404 - /jaxrpc-stock/jaxrpc

--------------------------------------------------------------------------------

type Status report

message /jaxrpc-stock/jaxrpc

description The requested resource (/jaxrpc-stock/jaxrpc) is not available.


--------------------------------------------------------------------------------

Java Web Services Developer Pack/1.0-ea2

PLEASE HELP!!! THIS IS DRIVING ME CRAZY!!!