External JAR/API use in RTC Plugin
Hi,
I need to perform several actions on pre & post save of RTC Defect. For that I am trying to develop plugin, which will call some external apis from my RTC plugin. But, whenever I add some code ( which uses some third party jars ), my plugin gives me error "Internal error. Unable to instantiate advisor MyExample.SaveDemo"
Can anyone please help me for the same.
- riddhi
I need to perform several actions on pre & post save of RTC Defect. For that I am trying to develop plugin, which will call some external apis from my RTC plugin. But, whenever I add some code ( which uses some third party jars ), my plugin gives me error "Internal error. Unable to instantiate advisor MyExample.SaveDemo"
Can anyone please help me for the same.
- riddhi
Accepted answer
put your extra jar files in the plugin project lib directory
then in your plugin.xml,
(UI editor), go to the Runtime tab, Classpath section (lower right), and add all the jar files from LIB you want in the plugin build.
then go to the Build tab, and in the 'Binary include' section, expand the LIB folder and select the jar files to add to the build output..
the files will be added to the plugin jar file contents
this should show up in the manifest.mf file and the build tab
works for me on a couple plugins.
note that you cannot select path or file outside the plugin structure.
then in your plugin.xml,
(UI editor), go to the Runtime tab, Classpath section (lower right), and add all the jar files from LIB you want in the plugin build.
then go to the Build tab, and in the 'Binary include' section, expand the LIB folder and select the jar files to add to the build output..
the files will be added to the plugin jar file contents
this should show up in the manifest.mf file and the build tab
works for me on a couple plugins.
note that you cannot select path or file outside the plugin structure.
One other answer
Hi Riddi,
see https://jazz.net/forum/questions/83743/how-to-call-java-classes-on-save-button-in-workitem-page
see https://jazz.net/forum/questions/83743/how-to-call-java-classes-on-save-button-in-workitem-page
Comments
Thanks Ralph.
I have followed all the steps of given link. The issue comes if when I create a plugin and my plugin requires some third party library to perform some actions. For example, on save plugin will send mail to specific teams.
- riddhi
Hi Riddi, I believe it is possible to package and access external Jar's inside a plugin. I think Ihave done that some years back. Currently I have no example to test though. Most important are the tabs "Runtime" and "Build" on the plugin editor.