I’m using an external jar (with 2 required extra jars) in a Servoy method, in this case to generate a QR code. This works great, but I’m having an issue when deploying the solution as a war deployment.
I’d expect it to work when I put the jars in \beans or \plugins but the code throws an error in the servoy log that it cannot find the method in the jar. However, when I put the jars in the \WEB-INF\lib\ subdirectory in the WAR file, the method is found and the code works.
Why doesn’t it work when just placing the jars in \beans or \plugins?
Are those external jars Servoy plugins/beans? If so you should be able to check them when exporting to .war (there is a page where you choose which plugins/beans should be included).
If they are just simple java jars and you access them directly through Rhino then it explains why they are not exported. In this case you could try to copy them to the app_server/lib folder before war export. Then they will end up I think where you need them.
They are just simple java jars, no plugins.
When I put them in the plugins or beans folder in developer, the code works. I can even check them for WAR export. They also end up in the war file’s plugin directory, but the code won’t work unless I put them in the \WEB-INF\lib dir.
I just do that now by opening the war file with 7zip and drag the jars into it, but it will work if I put them in the application_server\lib folder I guess.
Just wondering why it works in developer but not in WAR environment.
you have to somehow tell servoy to include it
so with a bean you have to have a dummy bean.jar (with a dummy bean in it in the manifest) and then have the classpath attribtue of the manifest file pointing to the jars you want to ship
or you have to generate a dummy plugin.jnlp file with a dummy plugin that includes your jars
this way we know what really is used. And it should be then included in the classloader.