Java Compiler Error

Hi All ,

any one know what is this means

C:\Program Files\webMethods6\IntegrationServer\packages\Test\code\source\Test.java:71: cannot resolve symbol
symbol : class PostMethod
location: class Test
PostMethod mPost = new PostMethod(postURL);

Are you sure you should be writing Java? :wink:

The class PostMethod cannot be found. You either need to import the class with an import configuration on the service or use the fully-qualified classname.

In my humble opinion, you are headed down the wrong path in trying to do an HTTP post using Java code within IS. There are two reasons for this statement: 1) IS can perform HTTP posts just fine and provides services to do so–you are reinventing the wheel; 2) you are apparently new to Java as this error is a very, very basic problem. I would advise strongly against continuing down this path.

Hi Rob ,

Just I am trying , Yes I am not a Java programmer but have some little knowledge on .

Thank for your reply.

Raj

PostMethod is a class from Apache commons-httpclient
http://jakarta.apache.org/httpcomponents/httpclient-3.x/methods/post.html
All You need to do is to download http://jakarta.apache.org/site/downloads/downloads_commons-httpclient-3.x.cgi
unpack and copy the libraries:

  • commons-httpclient-3.1.jar
  • commons-codec-1.2.jar
  • commons-logging-1.0.4.jar
    to $WM_HOME/IntegrationServer/packages//code/jars/ directory or for global scope of visibility of classes to /code/jars/static/ or $WM_HOME/IntegrationServer/lib/jars/

commons-httpclient is also in Maven2 repository:

commons-httpclient
commons-httpclient
3.1

Or just use the services provided by IS. No need to download and use any of that stuff.

Of course, but somebody already had used some Apache classes (PostMethod) in code and other person try to find out what a problem is.

IMHO and experience: better solution is to do complex things and almost anything else than documents mappings and easy logic in Java code - it’s easier and easier is to find malfunction. Independent of container (IS in this case) Java code may be tested outside of the container - faster and easier. Sorry Rob :slight_smile:

No need to be sorry. We simply disagree on the approach. You feel that writing Java would be good thing to do in this case. My opinion is that if you want to write Java for the bulk of your work (and reinvent a service to do HTTP posts when a quite capable service already exists) then you shouldn’t be using Integration Server in the first place.