You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Alex Kashko <aa...@yahoo.com> on 2001/10/12 12:19:32 UTC
Soap server cannot locate target object
I'm writing a simple HelloWorld server/client pair modifiying the code (in trivial ways)
I got from www.skyserver.org.
I have two classes
c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloServer.class
c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloClient.class
everything compiles fine with Kawa pro and I deploy the service (urn:SoapHelloServer) OK
using the
Apache Admin tool and the entries match those in the screenshot on www.skyserver.org
typing java SoapHelloClient gives the following fault
Unable to resolve target object: SoapHelloServer
Set up and Background
-----------------------
Running Apache Soap 2_2
xerces.jar from Xerces 1.4.3 (I found Apache's samples won't run with xerces 2.0 and I
have also tried 1.2.3)
Windows NT
Yes my system classpath does include c:\ApacheGroup\Soap-2_2\samples\local
the script I am using is
java -cp
c:\JarFiles\xerces.jar;.;c:\JavaZipFiles\classes12.zip;c:\JarFiles\mail.jar;c:\JarFiles\activation.jar;\c:\JarFiles\bsf.jar;c:\JarFiles\js.jar;c:\JarFiles\soap.jar;c:\ApacheGroup\soap-2_2;c:\ApacheGroup\soap-2_2\samples\local;c:\ApacheGroup\soap-2_2\SoapHelloServer%CLASSPATH%
SoapHelloClient
(classes12.zip holds oracle jdbc drivers)
The client code is
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.encoding.soapenc.*;
public class SoapHelloClient
{
public static void main(String[] args)
{
String client="Alex";
String host = "tvldpc003.ddns.asa-ehv.ce.philips.com:";
String port = "8080";
String protocol = "http://";
String directory = "/soap/servlet/rpcrouter";
URL theURL = null;
try {theURL= new URL(protocol + host + port + directory);}
catch (MalformedURLException mue) { }
System.out.println(theURL);
Call helloCall= new Call();
helloCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
helloCall.setTargetObjectURI("urn:SoapHelloServer");
helloCall.setMethodName("getMessage");
Vector params = new Vector();
Parameter p = new Parameter("clientName",String.class,(Object)client,null);
params.addElement(p);
helloCall.setParams(params);
try
{
Response resp = helloCall.invoke(theURL,"");
if ( resp.generatedFault())
{
System.err.println("There was a fault:" );
String s = resp.getFault().toString();
System.out.println(s);
System.out.println("Response was");
System.out.println(resp.toString());
Parameter pr = resp.getReturnValue();
System.out.println(p.getValue());
}
else
{ Parameter pr = resp.getReturnValue();
System.out.println(p.getValue());
}
}
catch (SOAPException e)
{
System.err.println("There was an exception");
System.err.println(e.getFaultCode()+"\n") ;
System.err.println(e.getMessage()+"\n");
}
}
}
The server code is
public class SoapHelloServer
{
public String getMessage(String clientName)
{
String response = "Hello to " + clientName + " From the soap Hello server";
// System.out.println("Response was: " + response);
return response;
}
}
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
Re: Soap server cannot locate target object
Posted by Alex Kashko <aa...@yahoo.com>.
Two of us double checked the classpath - The font in Windows environment control panel is
too small for me and I expected there might be something wrong. We corrected it and the
problem persisted. We restarted Tomcat with an explicit classpath (creating a batch file
from the targets of the menu shortcuts the installer created and inserting a classpath)
and the problem persisted.
It WAS a classpath problem since jarring up the classfile and putting the jar file in
Tomcat-home/lib, where jarfiles are automatically added, cured it.
I now need to dig into the documentation I have and find exactly how to modify the
classpath Tomcat 4.0 uses at launch. Otherwise "hot deployment" in the course of testing
becomes difficult and the tomcat_home/lib directory will get cluttered with junk.
As usual solving one problem leads to another. A good solution is one that leads to a
good problem.
--- Acz�l_Csilla <ac...@freemail.hu> wrote:
> I think this is a classpath problem. The semicolon is missing from your
> classpath setting (-cp ...). At the end you should separate the
> c:\...\SoapHelloServer and the %CLASSPATH% entries.
>
> ----- Original Message -----
> From: "Alex Kashko" <aa...@yahoo.com>
> To: <so...@xml.apache.org>
> Sent: Friday, October 12, 2001 12:19 PM
> Subject: Soap server cannot locate target object
>
>
> > I'm writing a simple HelloWorld server/client pair modifiying the code (in
> trivial ways)
> > I got from www.skyserver.org.
> >
> > I have two classes
> > c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloServer.class
> > c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloClient.class
> >
> > everything compiles fine with Kawa pro and I deploy the service
> (urn:SoapHelloServer) OK
> > using the
> > Apache Admin tool and the entries match those in the screenshot on
> www.skyserver.org
> >
> > typing java SoapHelloClient gives the following fault
> >
> > Unable to resolve target object: SoapHelloServer
> >
> >
> > Set up and Background
> > -----------------------
> > Running Apache Soap 2_2
> > xerces.jar from Xerces 1.4.3 (I found Apache's samples won't run with
> xerces 2.0 and I
> > have also tried 1.2.3)
> > Windows NT
> >
> > Yes my system classpath does include
> c:\ApacheGroup\Soap-2_2\samples\local
> > the script I am using is
> >
> > java -cp
> >
> c:\JarFiles\xerces.jar;.;c:\JavaZipFiles\classes12.zip;c:\JarFiles\mail.jar;
> c:\JarFiles\activation.jar;\c:\JarFiles\bsf.jar;c:\JarFiles\js.jar;c:\JarFil
> es\soap.jar;c:\ApacheGroup\soap-2_2;c:\ApacheGroup\soap-2_2\samples\local;c:
> \ApacheGroup\soap-2_2\SoapHelloServer%CLASSPATH%
> > SoapHelloClient
> >
> > (classes12.zip holds oracle jdbc drivers)
> >
> >
> > The client code is
> >
> > import java.net.*;
> > import java.util.*;
> > import org.apache.soap.*;
> > import org.apache.soap.rpc.*;
> > import org.apache.soap.encoding.soapenc.*;
> >
> > public class SoapHelloClient
> > {
> > public static void main(String[] args)
> > {
> > String client="Alex";
> > String host = "tvldpc003.ddns.asa-ehv.ce.philips.com:";
> > String port = "8080";
> > String protocol = "http://";
> > String directory = "/soap/servlet/rpcrouter";
> > URL theURL = null;
> >
> > try {theURL= new URL(protocol + host + port + directory);}
> > catch (MalformedURLException mue) { }
> > System.out.println(theURL);
> >
> >
> > Call helloCall= new Call();
> > helloCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > helloCall.setTargetObjectURI("urn:SoapHelloServer");
> > helloCall.setMethodName("getMessage");
> >
> > Vector params = new Vector();
> > Parameter p = new
> Parameter("clientName",String.class,(Object)client,null);
> > params.addElement(p);
> > helloCall.setParams(params);
> >
> > try
> > {
> > Response resp = helloCall.invoke(theURL,"");
> > if ( resp.generatedFault())
> > {
> > System.err.println("There was a fault:" );
> > String s = resp.getFault().toString();
> > System.out.println(s);
> > System.out.println("Response was");
> > System.out.println(resp.toString());
> > Parameter pr = resp.getReturnValue();
> >
> > System.out.println(p.getValue());
> >
> > }
> > else
> > { Parameter pr = resp.getReturnValue();
> > System.out.println(p.getValue());
> > }
> > }
> > catch (SOAPException e)
> > {
> > System.err.println("There was an exception");
> > System.err.println(e.getFaultCode()+"\n") ;
> > System.err.println(e.getMessage()+"\n");
> > }
> >
> >
> > }
> >
> > }
> >
> >
> > The server code is
> >
> >
> > public class SoapHelloServer
> > {
> > public String getMessage(String clientName)
> > {
> >
> > String response = "Hello to " + clientName + " From the soap Hello
> server";
> > // System.out.println("Response was: " + response);
> > return response;
> > }
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> >
> >
>
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
Re: Soap server cannot locate target object
Posted by Alex Kashko <aa...@yahoo.com>.
Two of us double checked the classpath - The font in Windows environment control panel is
too small for me and I expected there might be something wrong. We corrected it and the
problem persisted. We restarted Tomcat with an explicit classpath (creating a batch file
from the targets of the menu shortcuts the installer created and inserting a classpath)
and the problem persisted.
It WAS a classpath problem since jarring up the classfile and putting the jar file in
Tomcat-home/lib, where jarfiles are automatically added, cured it.
I now need to dig into the documentation I have and find exactly how to modify the
classpath Tomcat 4.0 uses at launch. Otherwise "hot deployment" in the course of testing
becomes difficult and the tomcat_home/lib directory will get cluttered with junk.
As usual solving one problem leads to another. A good solution is one that leads to a
good problem.
--- Acz�l_Csilla <ac...@freemail.hu> wrote:
> I think this is a classpath problem. The semicolon is missing from your
> classpath setting (-cp ...). At the end you should separate the
> c:\...\SoapHelloServer and the %CLASSPATH% entries.
>
> ----- Original Message -----
> From: "Alex Kashko" <aa...@yahoo.com>
> To: <so...@xml.apache.org>
> Sent: Friday, October 12, 2001 12:19 PM
> Subject: Soap server cannot locate target object
>
>
> > I'm writing a simple HelloWorld server/client pair modifiying the code (in
> trivial ways)
> > I got from www.skyserver.org.
> >
> > I have two classes
> > c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloServer.class
> > c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloClient.class
> >
> > everything compiles fine with Kawa pro and I deploy the service
> (urn:SoapHelloServer) OK
> > using the
> > Apache Admin tool and the entries match those in the screenshot on
> www.skyserver.org
> >
> > typing java SoapHelloClient gives the following fault
> >
> > Unable to resolve target object: SoapHelloServer
> >
> >
> > Set up and Background
> > -----------------------
> > Running Apache Soap 2_2
> > xerces.jar from Xerces 1.4.3 (I found Apache's samples won't run with
> xerces 2.0 and I
> > have also tried 1.2.3)
> > Windows NT
> >
> > Yes my system classpath does include
> c:\ApacheGroup\Soap-2_2\samples\local
> > the script I am using is
> >
> > java -cp
> >
> c:\JarFiles\xerces.jar;.;c:\JavaZipFiles\classes12.zip;c:\JarFiles\mail.jar;
> c:\JarFiles\activation.jar;\c:\JarFiles\bsf.jar;c:\JarFiles\js.jar;c:\JarFil
> es\soap.jar;c:\ApacheGroup\soap-2_2;c:\ApacheGroup\soap-2_2\samples\local;c:
> \ApacheGroup\soap-2_2\SoapHelloServer%CLASSPATH%
> > SoapHelloClient
> >
> > (classes12.zip holds oracle jdbc drivers)
> >
> >
> > The client code is
> >
> > import java.net.*;
> > import java.util.*;
> > import org.apache.soap.*;
> > import org.apache.soap.rpc.*;
> > import org.apache.soap.encoding.soapenc.*;
> >
> > public class SoapHelloClient
> > {
> > public static void main(String[] args)
> > {
> > String client="Alex";
> > String host = "tvldpc003.ddns.asa-ehv.ce.philips.com:";
> > String port = "8080";
> > String protocol = "http://";
> > String directory = "/soap/servlet/rpcrouter";
> > URL theURL = null;
> >
> > try {theURL= new URL(protocol + host + port + directory);}
> > catch (MalformedURLException mue) { }
> > System.out.println(theURL);
> >
> >
> > Call helloCall= new Call();
> > helloCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > helloCall.setTargetObjectURI("urn:SoapHelloServer");
> > helloCall.setMethodName("getMessage");
> >
> > Vector params = new Vector();
> > Parameter p = new
> Parameter("clientName",String.class,(Object)client,null);
> > params.addElement(p);
> > helloCall.setParams(params);
> >
> > try
> > {
> > Response resp = helloCall.invoke(theURL,"");
> > if ( resp.generatedFault())
> > {
> > System.err.println("There was a fault:" );
> > String s = resp.getFault().toString();
> > System.out.println(s);
> > System.out.println("Response was");
> > System.out.println(resp.toString());
> > Parameter pr = resp.getReturnValue();
> >
> > System.out.println(p.getValue());
> >
> > }
> > else
> > { Parameter pr = resp.getReturnValue();
> > System.out.println(p.getValue());
> > }
> > }
> > catch (SOAPException e)
> > {
> > System.err.println("There was an exception");
> > System.err.println(e.getFaultCode()+"\n") ;
> > System.err.println(e.getMessage()+"\n");
> > }
> >
> >
> > }
> >
> > }
> >
> >
> > The server code is
> >
> >
> > public class SoapHelloServer
> > {
> > public String getMessage(String clientName)
> > {
> >
> > String response = "Hello to " + clientName + " From the soap Hello
> server";
> > // System.out.println("Response was: " + response);
> > return response;
> > }
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> >
> >
>
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
Re: Soap server cannot locate target object
Posted by Aczél Csilla <ac...@freemail.hu>.
I think this is a classpath problem. The semicolon is missing from your
classpath setting (-cp ...). At the end you should separate the
c:\...\SoapHelloServer and the %CLASSPATH% entries.
----- Original Message -----
From: "Alex Kashko" <aa...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Friday, October 12, 2001 12:19 PM
Subject: Soap server cannot locate target object
> I'm writing a simple HelloWorld server/client pair modifiying the code (in
trivial ways)
> I got from www.skyserver.org.
>
> I have two classes
> c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloServer.class
> c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloClient.class
>
> everything compiles fine with Kawa pro and I deploy the service
(urn:SoapHelloServer) OK
> using the
> Apache Admin tool and the entries match those in the screenshot on
www.skyserver.org
>
> typing java SoapHelloClient gives the following fault
>
> Unable to resolve target object: SoapHelloServer
>
>
> Set up and Background
> -----------------------
> Running Apache Soap 2_2
> xerces.jar from Xerces 1.4.3 (I found Apache's samples won't run with
xerces 2.0 and I
> have also tried 1.2.3)
> Windows NT
>
> Yes my system classpath does include
c:\ApacheGroup\Soap-2_2\samples\local
> the script I am using is
>
> java -cp
>
c:\JarFiles\xerces.jar;.;c:\JavaZipFiles\classes12.zip;c:\JarFiles\mail.jar;
c:\JarFiles\activation.jar;\c:\JarFiles\bsf.jar;c:\JarFiles\js.jar;c:\JarFil
es\soap.jar;c:\ApacheGroup\soap-2_2;c:\ApacheGroup\soap-2_2\samples\local;c:
\ApacheGroup\soap-2_2\SoapHelloServer%CLASSPATH%
> SoapHelloClient
>
> (classes12.zip holds oracle jdbc drivers)
>
>
> The client code is
>
> import java.net.*;
> import java.util.*;
> import org.apache.soap.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.encoding.soapenc.*;
>
> public class SoapHelloClient
> {
> public static void main(String[] args)
> {
> String client="Alex";
> String host = "tvldpc003.ddns.asa-ehv.ce.philips.com:";
> String port = "8080";
> String protocol = "http://";
> String directory = "/soap/servlet/rpcrouter";
> URL theURL = null;
>
> try {theURL= new URL(protocol + host + port + directory);}
> catch (MalformedURLException mue) { }
> System.out.println(theURL);
>
>
> Call helloCall= new Call();
> helloCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> helloCall.setTargetObjectURI("urn:SoapHelloServer");
> helloCall.setMethodName("getMessage");
>
> Vector params = new Vector();
> Parameter p = new
Parameter("clientName",String.class,(Object)client,null);
> params.addElement(p);
> helloCall.setParams(params);
>
> try
> {
> Response resp = helloCall.invoke(theURL,"");
> if ( resp.generatedFault())
> {
> System.err.println("There was a fault:" );
> String s = resp.getFault().toString();
> System.out.println(s);
> System.out.println("Response was");
> System.out.println(resp.toString());
> Parameter pr = resp.getReturnValue();
>
> System.out.println(p.getValue());
>
> }
> else
> { Parameter pr = resp.getReturnValue();
> System.out.println(p.getValue());
> }
> }
> catch (SOAPException e)
> {
> System.err.println("There was an exception");
> System.err.println(e.getFaultCode()+"\n") ;
> System.err.println(e.getMessage()+"\n");
> }
>
>
> }
>
> }
>
>
> The server code is
>
>
> public class SoapHelloServer
> {
> public String getMessage(String clientName)
> {
>
> String response = "Hello to " + clientName + " From the soap Hello
server";
> // System.out.println("Response was: " + response);
> return response;
> }
>
> }
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
>
>
Re: Soap server cannot locate target object
Posted by Aczél Csilla <ac...@freemail.hu>.
I think this is a classpath problem. The semicolon is missing from your
classpath setting (-cp ...). At the end you should separate the
c:\...\SoapHelloServer and the %CLASSPATH% entries.
----- Original Message -----
From: "Alex Kashko" <aa...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Friday, October 12, 2001 12:19 PM
Subject: Soap server cannot locate target object
> I'm writing a simple HelloWorld server/client pair modifiying the code (in
trivial ways)
> I got from www.skyserver.org.
>
> I have two classes
> c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloServer.class
> c:\ApacheGroup\Soap-2_2\samples\local\SoapHelloClient.class
>
> everything compiles fine with Kawa pro and I deploy the service
(urn:SoapHelloServer) OK
> using the
> Apache Admin tool and the entries match those in the screenshot on
www.skyserver.org
>
> typing java SoapHelloClient gives the following fault
>
> Unable to resolve target object: SoapHelloServer
>
>
> Set up and Background
> -----------------------
> Running Apache Soap 2_2
> xerces.jar from Xerces 1.4.3 (I found Apache's samples won't run with
xerces 2.0 and I
> have also tried 1.2.3)
> Windows NT
>
> Yes my system classpath does include
c:\ApacheGroup\Soap-2_2\samples\local
> the script I am using is
>
> java -cp
>
c:\JarFiles\xerces.jar;.;c:\JavaZipFiles\classes12.zip;c:\JarFiles\mail.jar;
c:\JarFiles\activation.jar;\c:\JarFiles\bsf.jar;c:\JarFiles\js.jar;c:\JarFil
es\soap.jar;c:\ApacheGroup\soap-2_2;c:\ApacheGroup\soap-2_2\samples\local;c:
\ApacheGroup\soap-2_2\SoapHelloServer%CLASSPATH%
> SoapHelloClient
>
> (classes12.zip holds oracle jdbc drivers)
>
>
> The client code is
>
> import java.net.*;
> import java.util.*;
> import org.apache.soap.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.encoding.soapenc.*;
>
> public class SoapHelloClient
> {
> public static void main(String[] args)
> {
> String client="Alex";
> String host = "tvldpc003.ddns.asa-ehv.ce.philips.com:";
> String port = "8080";
> String protocol = "http://";
> String directory = "/soap/servlet/rpcrouter";
> URL theURL = null;
>
> try {theURL= new URL(protocol + host + port + directory);}
> catch (MalformedURLException mue) { }
> System.out.println(theURL);
>
>
> Call helloCall= new Call();
> helloCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> helloCall.setTargetObjectURI("urn:SoapHelloServer");
> helloCall.setMethodName("getMessage");
>
> Vector params = new Vector();
> Parameter p = new
Parameter("clientName",String.class,(Object)client,null);
> params.addElement(p);
> helloCall.setParams(params);
>
> try
> {
> Response resp = helloCall.invoke(theURL,"");
> if ( resp.generatedFault())
> {
> System.err.println("There was a fault:" );
> String s = resp.getFault().toString();
> System.out.println(s);
> System.out.println("Response was");
> System.out.println(resp.toString());
> Parameter pr = resp.getReturnValue();
>
> System.out.println(p.getValue());
>
> }
> else
> { Parameter pr = resp.getReturnValue();
> System.out.println(p.getValue());
> }
> }
> catch (SOAPException e)
> {
> System.err.println("There was an exception");
> System.err.println(e.getFaultCode()+"\n") ;
> System.err.println(e.getMessage()+"\n");
> }
>
>
> }
>
> }
>
>
> The server code is
>
>
> public class SoapHelloServer
> {
> public String getMessage(String clientName)
> {
>
> String response = "Hello to " + clientName + " From the soap Hello
server";
> // System.out.println("Response was: " + response);
> return response;
> }
>
> }
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
>
>