While java (not Integration Server) does provide APIs for loading classes,
I’m interested to know why the jar needs to be dynamically loaded while IS is running and not before. What is the java service doing ?
Dynamically loading classes should be reserved for extremely rare occasions where nothing else is really acceptable.
A restart is not required, you can simply reload the package after placing the jar file in the code/jars directory of the package where you have created your java service. However, if you want the eclipse IDE to recognise your new classes then you will need to also add it the build path of the java project that was created automatically for you package. Add the view “package explorer” to your perspective. Then find your package postfixed with ‘’, right click and then select modify build path and make sure your jar file is added there too. That will allow you to use code completion and get the correct colouring in the editor.
Remember the java service is not compiled in your local project, but instead in the IS, when saving.
The advantage of using dynamically loaded jar files is that you don’t have to restart the server if it changes. This is really important if you want to avoid downtime when updating a server. The other advantage is that the jar file is only accessible to the package and hence reduces the risk of conflicts if using a fairly common jar file that may be used elsewhere but of different versions.
If you must reference a jar file statically then create a sub folder in your code/jars directory and name it “static”. Place the jar file into directory and obviously restart the server. This is often the case for drivers etc. as the calling code will search for it explicitly using the global class path and not locally. Also necessary if you want to be able to reference the jar file from a different package.
in general you are right, but here are some additions:
When placing the jar in the code/jars/static folder it will be available for the complete IS instance, but requires a shutdown and restart every time the jar is updated.
When placing the jar in the code/jars folder it can be updated by just reloading the package, but in this case it will only be available for this package itself and all packages, which are marked to be dependent on this one.
When reloading the package containing the jar all dependent packages will reload at the same moment.
Guys, all you said I did. Actually I did it before of open this thread.
My step number 1 is about adding my new jar to buildpath.
The problem is that even doing the step number 2 and reloading the package, the java service does not compile. Even reloading the package, when I save the java service compile errors are shown, its like IS cant recognize the jar.
I want to load that jar in this way because I can’t restart the server because there are many proyects more in it.