Load other project into Ignition SDK

#1

Hello,

We are trying to load a java project into the SDK to make a component module, buf we have problems. The project that we are trying to load, have packages and .jar files, We are not able to load it, we have an error when we drop the component into a screen and we think that the problem is some references…

The error is:

image

the java project has some packages:

We have tried to put the .jar files in the lib/core/… folders but it doesn’t works…

Any help?

Thank you,

1 Like

#2

If you’ve already got a module, then the /lib/core/ hack shouldn’t necessary. What’s the actual stacktrace of the error message? An IAE is not what I would expect if you were missing required classes - I’d expect a ClassDefNotFound or similar error.

0 Likes

#3

I suspect your issue is that you’ve just got this project sitting next to your module in Eclipse but you haven’t actually managed to get its JAR file into your module when it’s built.

0 Likes

#4

Hello,

Ok, i have copy directly the jar file in the module… I suppose that this is not correct … How can I import correctly the jar file?

Thank you

0 Likes

#5

Are you using ignition-maven-plugin to build your module? It should take care of putting any compile-scope dependencies into the module and making an entry in the module.xml file.

Can you upload a copy of your module or module.xml file?

1 Like

#6

Hello,

Yes, I am using the maven plugin, I attached the ignition module, a folder with the .jar files, and the java project which I want to include in the ignition module (there are two projects, one is called core and the other is a project with the examples)
you can download it form this link:

https://shareittk.thyssenkrupp-elevator-seame.com/public/ignition_module

Thank you,

1 Like

#7

Hello,

The stacktrace is:

java.lang.IllegalArgumentException: No such Gstreamer factory: appsink
	at org.freedesktop.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:307)
	at org.freedesktop.gstreamer.Element.makeRawElement(Element.java:99)
	at org.freedesktop.gstreamer.elements.AppSink.<init>(AppSink.java:86)
	at org.freedesktop.gstreamer.examples.SimpleVideoComponent.<init>(SimpleVideoComponent.java:75)
	at imas.client.OCRComponent.<init>(OCRComponent.java:123)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.base/java.lang.Class.newInstance(Unknown Source)
	at com.inductiveautomation.vision.api.designer.palette.JavaBeanPaletteItem.createJavaBean(JavaBeanPaletteItem.java:58)
	at com.inductiveautomation.vision.api.designer.palette.JavaBeanPaletteItem.createComponent(JavaBeanPaletteItem.java:54)
	at com.inductiveautomation.factorypmi.designer.workspace.tools.InstantiationTool.onClick(InstantiationTool.java:89)
	at com.inductiveautomation.ignition.designer.designable.DesignPanel$ToolMouseListener.onClick(DesignPanel.java:986)
	at com.inductiveautomation.ignition.client.util.gui.CommonMouseAdapter.mouseReleased(CommonMouseAdapter.java:72)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.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.0.5 (b2019101516)
Java: Azul Systems, Inc. 11.0.4

Looking at the source code, the exception is thrown in:

This code is from the source code of the java project(it is not mine), when you execute the project outside Ignition it works, but for some reason from inside the module it doesn’t works.

0 Likes

#8

Hello,

Have you had time to look at the code?

I was looking to the module.xml file, and I have included some lines to include manually some .jar files after that I have zipped the files and rename it but It doesn’t works…

Please any help… (I am desperate with this…:slightly_frowning_face:)

thank you so much,

0 Likes

#9

I would expect a gStreamer Java API to be using a JNI to connect to gStreamer’s native libraries. Running outside of Ignition allows the JVM to use the platform library paths to find and load everything necessary. Within Ignition, you must manage all dependencies yourself. Note that much of gStreamer is GPL code and cannot be distributed in an Ignition module.
Fortunately, once you manage to get a JNI .dll or .so file loaded in Ignition, they will generally follow the platform’s defaults to load other native dependencies. You might find this thread helpful:

In my module, I included a config page to allow the user to specify exactly where the necessary external jar and JNI files are located, if not found in the default location.

0 Likes

#10

You have a folder called “jar” with 2 jars in it that aren’t listed in your dependencies anywhere:

  • jar_mio.jar
  • x86_64-3.3.0-v3346.jar

I don’t really know anything about the libraries you’re using, but if these are necessary for it to run correctly then you should make sure they’re indicated as dependencies by your module.

0 Likes

#11

Hello,

Ok, thank you to all, it was a problem with the .jar and with some initializations.

0 Likes