How to add a jar file into Integration Server without restart

What product/components do you use and which version/fix level are you on?

Integration Server 10.5

Is your question related to the free trial, or to a production (customer) instance?

License

What are you trying to achieve? Please describe it in detail.

I am trying to add a jar into my packages and use it without restart Integration Server

Do you get any error messages? Please provide a full error message screenshot and log file.

I have java service. I need to use this new jar in it. I’ve done the following steps:

  1. To add .jar to workspace into project. As soon as I did that I could import all classes in the java service.
  2. To add the new .jar into Integration Server in SoftwareAG\IntegrationServer\instances\default\packages\PubSubGCP\code\jars
    In this path there were 2 jar more loaded already.
  3. To realod package in Packages > Managment > Reload
  4. To make a change in java service and save then.

In step number 4 that error appears. It can’t compile. IS doen’t recognize the new jar in it classpath I think.

I really can’t restart. What should I do?

Have you installed all the latest fixes for the products and systems you are using?

No

UDPATED - I should’ve read between the lines as “Designer doesn’t recognize”, when you said “IS doesn’t recognize”; I missed the compile keyword. Take a look at John’s response below.

This is how Java works, so a restart is required.
I’d be surprised (and learn something new) if there was a way.

KM

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.

-NP

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 ‘[55555]’, 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.

regards,
John.

1 Like

Ah, I misread the question as to mean not reload the package as well. Clear answer as always :slight_smile: John.

-NP

Hi John,

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.

Regards,
Holger

err, I think that is what I said. However, you did make it much clearer.
thanks,
John.

1 Like

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.

Thank you

Hi Jesus,

in this case I would like you to share the compiler error messages with us.

There are several points here, which can cause compiler errors, so without the exact messages we are not able determine which these are.

Regards,
Holger

Others have addressed this nicely. I’ll take a different angle. What jars are you looking to use and are you sure you need them?

1 Like