How to add my own classjar files to a package

Hi all,

I want to add my own class/jar files to my package and write a java service to import those class/jar files. Do I need to place my class files in

<root_dir>/IS/packages/<mypackage>lib/
Or
<root_dir>/IS/packages/<mypackage>/code/jars
Or
<root_dir>/IS/packages/<mypackage>/code/classes

Thanks
Kevin

Hello,
Do you want the Integration server to load them for you? If you have your own classloader you want to use and your files can’t be loaded by the default loader (over network, fragment file, etc.), you should put jars in the code/jars section. If you are just using regular files that could be loaded by standard means in an application, you should probably make another folder like “frag” that will house them. That way you can have your classloader look in this location exclusively to load your files. There was a great article on this with eclipse in DDJ (#372 May 2005). So some things you may have gone over but for others note (from article):

  • Class loaders must have a parent class loader, except for the bootstrap class loader.
  • Class loaders must delegate the loading of classes to their parent class loader before attempting to load a class themselves.
  • A class can only be loaded once by any one class loader; any attempts to load an identical class (where the name serves as the identifier) in a class loader that has already loaded a class of the same name results in the cached copy of the original class being loaded. This rule implies that a class may be loaded several different times by several different loaders, but only once by each class loader.

That is stuff to be familiar with and easy to actually work with. Good day.

Yemi Bedu

Kevin,

Just place your jar file in the <root_dir>/IS/packages/<mypackage>/code/jars/static folder and restart the server.

HTH, Rohit

Kevin for jar files just copy your jar into <root_dir>/IS/packages/<mypackage>/code/jars directory and reload a package! You do not have to restart IS as mentioned earlier, it will work. However package reload is simpler.
If you have java clsses that is bit more complex. you can import your classes into <root_dir>/IS/packages/<mypackage>/code/classes directory and create your java package dirs to reflect your classs location. But this may crete conflicts with existing classes. Also if you want these calsses to be registered asactual IS services then you must follow WM developer package naming and also name space requirementsa dn source formating.

Thanks All,

I got it…I used <root_dir>/IS/packages/<mypackage>/code/jars for jar files.

Thanks
Kevin