Jar file working in designer but not working in vision client

I have added jar file in
C:\Program Files\Inductive Automation\Ignition\lib\core\client
C:\Program Files\Inductive Automation\Ignition\lib\core\common
C:\Program Files\Inductive Automation\Ignition\lib\core\gateway
C:\Program Files\Inductive Automation\Ignition\lib\core\Designer

When I import the module it works fine in designer and script console. But getting error as no module found in vision client launcher.

The most likely answer is that there are other jars that it has as dependencies that happen to be loaded in the designer but not in a client. You'll have to share specifics for a better guess.

flying-saucer-pdf-itext5-9.3.1 is the jar file. Getting error when i tried to import
from org.xhtmlrenderer.pdf import ITextRenderer in client.
flying-saucer-pdf-itext5-9.3.1.jar (144.8 KB)

That error probably identifies the dependency (by missing class name) that it couldn't find. (Look at the "caused by" lines.)

image

image

Copy the full error report and paste it here as text. After you paste it, select it all and click the "preformatted text" button in the comment editor toolbar--it looks like this: </>

Traceback (most recent call last):
File "event:actionPerformed", line 13, in
ImportError: No module named xhtmlrenderer

at org.python.core.Py.ImportError(Py.java:329)
at org.python.core.imp.import_logic(imp.java:1290)
at org.python.core.imp.import_module_level(imp.java:1369)
at org.python.core.imp.importName(imp.java:1528)
at org.python.core.ImportFunction.__call__(__builtin__.java:1285)
at org.python.core.PyObject.__call__(PyObject.java:433)
at org.python.core.__builtin__.__import__(__builtin__.java:1232)
at org.python.core.imp.importFromAs(imp.java:1620)
at org.python.core.imp.importFrom(imp.java:1595)
at org.python.pycode._pyx42.f$0(<event:actionPerformed>:351)
at org.python.pycode._pyx42.call_function(<event:actionPerformed>)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1687)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:804)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:207)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:300)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
at com.sun.proxy.$Proxy44.actionPerformed(Unknown Source)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Unknown Source)
at java.desktop/java.awt.Container.processEvent(Unknown Source)
at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.1.32 (b2023091211)
Java: Azul Systems, Inc. 11.0.18

Restart your vision client, then open the diagnostics window (from the help menu), and examine the diagnostic console. There may be another error there saying why that jar wasn't loaded.

Also, search your ~/.ignition/cache folder for that jar file to make sure it actually propagated to your client environment.

Looking at this on Maven, it definitely does have dependencies, but they wouldn't be part of the Designer by default...

I don't know why it would work anywhere. Maybe the import wouldn't fail, but something else would, eventually.

1 Like

Interesting library, fwiw. Looks like a light-duty alternative to the reporting module. That the latest and greatest iText dependency uses the Affero GPL is a huge stumbling block, though. Makes me not want to touch it even with a 10-foot pole.