- This topic has 5 replies, 2 voices, and was last updated 17 years, 8 months ago by Lee Harrington.
-
AuthorPosts
-
Lee HarringtonMemberI followed the steps of the tutorial — and I get the following error:
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:108)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy13.convertPlaceToLonLatPt(Unknown Source)
at com.myeclipse.terraws.TerraServiceClient.main(TerraServiceClient.java:130)Here’s the code for the main procedure:
public static void main(String[] args) { TerraServiceClient client = new TerraServiceClient(); //create a default service endpoint TerraServiceSoap terraServiceSoap = client.getTerraServiceSoap(); // Setup query Place place = new Place(); place.setCity("Dallas"); place.setState("Texas"); place.setCountry("United States"); // Process result LonLatPt result = terraServiceSoap.convertPlaceToLonLatPt(place); System.out.println("City: " + place.getCity() + ", " + place.getState() + ", " + place.getCountry()); System.out.println("Latitude = " + result.getLat() + " Longitude: " + result.getLon()); System.out.println("test client completed"); System.exit(0); } }
I’m sure it’s something I’ve done wrong, but I’m stumped. The error occurs on the first attempt at the soap call:
LonLatPt result = terraServiceSoap.convertPlaceToLonLatPt(place);
Lee
tomekszMemberCheck what http-client version you have in classpath.
Lee HarringtonMember@tomeksz wrote:
Check what http-client version you have in classpath.
There isn’t one — but it’s a java propject so I’m not surprised. The build path has the following.
MyEclipse Jre 5.1
Xfire 1.2 Core
Xfire 1.2 JAXB2Lee
tomekszMemberso you need some more jars 🙂
This is ( more or less ) classpath i have ( classpath created by maven ) :
commons-codec-1.3.jar
commons-httpclient-3.0.jar
commons-logging-1.0.4.jar
jaxen-1.1-beta-9.jar
jdom-1.0.jar
stax-api-1.0.1.jar
stax-utils-20040917.jar
wsdl4j-1.6.1.jar
wstx-asl-3.2.0.jar
XmlSchema-1.1.jarI’m not sure if every jar is required ( must check this out someday;)
Lee HarringtonMember@tomeksz wrote:
so you need some more jars 🙂
This is ( more or less ) classpath i have ( classpath created by maven ) :
commons-codec-1.3.jar
commons-httpclient-3.0.jar
commons-logging-1.0.4.jar
jaxen-1.1-beta-9.jar
jdom-1.0.jar
stax-api-1.0.1.jar
stax-utils-20040917.jar
wsdl4j-1.6.1.jar
wstx-asl-3.2.0.jar
XmlSchema-1.1.jarI’m not sure if every jar is required ( must check this out someday;)
Not sure how to load those jars. Are there steps in the tutorial that I missed? Was “Java Project” not the proper type to pick?
Lee
Lee HarringtonMember@tomeksz wrote:
so you need some more jars 🙂
Thanks for the clue! I did the demo steps over again — only choosing Web Service Project instead of java project — which gave me the needed libs.
Also — the “cut and paste” code for the “main” method has a bug the line
LonLatPt result = terraServiceSoap.convertPlaceToLonLatPt(place);
should be
LonLatPt result = service.convertPlaceToLonLatPt(place);
finally — one needs to add an import statement to the top of the TerraServiceClient.java file:
import com.terraservice_usa.*;
Thanks for your help — hopefully someone at Genuitec will update the demo instructions.
Lee
-
AuthorPosts