Linking java services from another package

Hi all,

How can I use a java service that I created in
another package without use invoke ???

I want import the class just like another one.

best regards,

Sebastián Miranda
Barcelona, Spain

Hi Sebastian,

I do not know if you have discovered a way, but we have been playing with Java Services and classes and loaders etc.

For a WebMethods Package, the (Java Service) classes in it are only accessible from within the package (classloaders and all that). So you either have to get in the package (doInvoke) or make the classes available outside of the WebMethods package.

The one way we can achieve what you want is to collect all the class files up from the ‘other’ package, jar them up and put them on either the system classpath, the ‘prependclasses’ path or in the IS lib/jar(s) directory. The side effect of this is that the package is then not hot deployable, and changes to if required a restart.
Alternatively, create a an ‘access’ method/service on the other package to get to the java classes etc that you want to.

If you have come up with something else, let us know.



You can use package dependencies to gain run-time access to classes in other packages. Setting package dependencies modifies the search path when attempting to load a class.

There is a slight gotcha here…You’ll have to modify your development environment to include these dependencies. You can do this in several ways: modify the server’s compile property (used when saving modifications to a Java service) to include the classes & jars of the packages you depend on, modify jcode batch file to update the path dependencies, or alter your IDE build commands to accomodate this.



Cheers for the info - I’ll have a play.



I used package dependencies to try access to classes
in other packages, but it didn’t work.
I’ll try what you say…

Thanx !!!

Sebastián Miranda
Barcelona, Spain