Class is run. class
Package: package localjava. client. dynamic
Class requirements:
Import org. apache. wsif. WSIFMessage;
Import org. apache. wsif. WSIFException;
Import org. apache. wsif. WSIFOperation;
Import org. apache. wsif. WSIFPort;
Import org. apache. wsif. WSIFService;
Import org. apache. wsif. WSIFServiceFactory;
The relative path set by classpath: libwsif. jar ;......; (If it is set to an absolute path at that time, it will avoid a lot of unnecessary troubles, so we should try to use the absolute path. Here we use the relative path to help you remember the problem.) lib in c: wsif
The classes to be imported are all in wsif. jar, and there is a decompressed class file in C: wsif-2.0uildclassesorgapachewsif
Actual location of the run. class: c: wsifuildsampleslocaljavaclientdynamic
Run java localjava. client. dynamic. Run samples/localjava/AddressBook. wsdl under Directory: c: wsifuildsamples
Error: Exception in thread "main" java. lang. NoClassDefFoundError: org/apache/wsif/WSIFException
This is because the classpath uses a relative path, so the jar file cannot be found in java, so there are three solutions:
1. Set classpath to an absolute path.
2. Run the following command: java-CP % classpath %; buildsamples; localjava. client. dynamic. run samples/localjava/AddressBook. in wsdl, buildsamples specifies the path of the RUN class.
(The path can also be written in absolute path. In relative path writing, ". "indicates the current path,"... "represents the parent node path. For example, the above path can also be written as". uildsamples; "or" .. wsifuildsamples "). Because the package is specified to localjava, the path should be set to the upper directory samples of the package, so that the run. class can be found under the directory along the package path.
3. Run java-cp [path] localjava. client. dynamic. Run samples/localjava/AddressBook. wsdl in the c: wsifuildsamples path. The path includes all required class paths.
This method is troublesome.
Configuration of system variables is always confusing, so you can edit a batch file. The java commands in the file specify all the class paths.