Roland,
I did have all the dependencies in the classpath as well. Then I went and
did somehting a little silly. I had multiple versions of JDK & JRE on my
machine. So I decided to clean them up.
Now all I have is JDK1.5.0_08 and its corresponding JRE. These are both
installed by default in C:\Program Files\Java\jdk1.5.0_08
C:\Program Files\Java\jre1.5.0_08
On my C:\ I have another folder set C:\Cld\myJava which contains my
PostXML.java source.
I have the C:\Cld\myJava in my classpath. i have downloaded the following
dependencies -
commons-codec-1.3.zip
commons-logging1.1.zip
commons-httpclient-3.1-alpha1.zip
Unzipped them and have the folders in my C:\Cld\myJava folder.
However now I cannot even compile the PostXML.java. I get an error message
saying it cannot find the Httpclient classes.
I tried " javac -classpath C:\cld\myJava PostXML.java " from the command
prompt and get the following errors. Nothing I do will find these classes.
Here is the error-
C:\CLD\myJava>javac -classpath C:\Cld\myJava PostXML.java
PostXML.java:3: package org.apache.commons.httpclient does not exist
import org.apache.commons.httpclient.HttpClient;
^
PostXML.java:4: package org.apache.commons.httpclient.methods does not exist
import org.apache.commons.httpclient.methods.FileRequestEntity;
^
PostXML.java:5: package org.apache.commons.httpclient.methods does not exist
import org.apache.commons.httpclient.methods.PostMethod;
^
PostXML.java:6: package org.apache.commons.httpclient.methods does not exist
import org.apache.commons.httpclient.methods.RequestEntity;
^
PostXML.java:48: cannot find symbol
symbol : class PostMethod
location: class PostXML
PostMethod post = new PostMethod(strURL);
^
PostXML.java:48: cannot find symbol
symbol : class PostMethod
location: class PostXML
PostMethod post = new PostMethod(strURL);
^
PostXML.java:51: cannot find symbol
symbol : class RequestEntity
location: class PostXML
RequestEntity entity = new FileRequestEntity(input, "text/xml;
charset=I
SO-8859-1");
^
PostXML.java:51: cannot find symbol
symbol : class FileRequestEntity
location: class PostXML
RequestEntity entity = new FileRequestEntity(input, "text/xml;
charset=I
SO-8859-1");
^
PostXML.java:54: cannot find symbol
symbol : class HttpClient
location: class PostXML
HttpClient httpclient = new HttpClient();
^
PostXML.java:54: cannot find symbol
symbol : class HttpClient
location: class PostXML
HttpClient httpclient = new HttpClient();
^
10 errors
Any advice?
Thanks
Veni
-----Original Message-----
From: Roland Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 10:38 AM
To: HttpClient User Discussion
Subject: Re: Error in executing PostXML sample application
Hello Veni Garg,
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/codec/DecoderException
the dependencies for HttpClient are listed on our website:
http://jakarta.apache.org/commons/httpclient/dependencies.html
You don't need junit at runtime, but you do need commons-codec,
as I have already told you in my last mail.
cheers,
Roland
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]