Deploying a module that depends on several other JARs

I’m having a problem testing a module I developed. The module depends on several other JARs that I have included in the build process. The module appears to build and deploy to the gateway server correctly. However, I encounter an error when I attempt to launch the Ignition Designer. The error indicates that one of my dependent JARs cannot be found. I setup the project as described in the documentation. I verified that the dependent JARs are included in the module.

I am certain my module works because I can rebuild, deploy, and run my project without the dependent JARs by including the source code in those JARs within my module. The issue I am encountering is specifically related to building a module that is dependent on other JARs.

Thank you

Does your module.xml file have entries for each jar with the correct scopes?

Kevin,

I verified that the module.xml file has the proper scope definitions. All my dependent JARs are scoped to ‘DC’ since they are required by both designer and client.

The error I am seeing is “Exception: Error unpacking analysis.jar” The ‘analysis.jar’ archive is one of my dependent JARS. I copied the .modl to a temp folder and renamed it .zip. Then I extracted the contents to verify it contains everything that is needed. I see analysis.jar which has been packed to analysis.jar.pack.gz. I assume the problem occurs while unpacking analysis.jar.pack.gz to analysis.jar.

Thanks

Is this your only dependency jar or are there others? Do the others work? Can you post the entire text and stack trace of the error message?

Also - what version of Ignition and what version of the JDK are you using to build this?

EDIT: If you’re using Ignition 7.7 and JDK 8 you need to remove the attributes from the pack200 task in your build file that specify compatibility with Java 5.

Kevin,

There are other dependent JARs. Analysis.jar is the first in the build and module.xml list. I do not know if the others work since this error is the only thing I see. What I see is a pop-up dialog box with the following statement only "

Error launching application:
Exception: Error unpacking analysis.jar
"
Buttons are ‘Exit’ or ‘Retry’ There is no stack trace I can see.

This dialog appears when I launch the ‘Designer’

I am using Java 8 with Ignition 7.7.1 on a Mac. I do not know what attributes you are referring to with respect to the ant task pack200. So I removed the attribute configfile="${p200props}" from each ant pack200 task but that did not resolve my problem. Plus I do not know where the ‘configfile’ is to look up what attributes I may need to remove.

There should be a pack200.properties file in your build directory somewhere…

If it has these lines in it, remove them:

com.sun.java.util.jar.pack.package.majver=150
com.sun.java.util.jar.pack.package.minver=7

inductiveautomation.com/for … 45001&f=89

Kevin,

I remember that before the holiday I made that change after finding that discussion thread on Google. It does not resolve my problem.

Kevin,

Do you have any other tips because the last one you posted does not work. Are there some logs somewhere I can look at to narrow down where my problem exists?

Thanks

Try launching with the Java Console showing and get the full stack trace of the error it’s encountering unpacking the jar.

Good day,

There is a " Copy built project jars and lib jars to temp folder" block in the build.xml of your module, it looks like a line needs to be added for each jar.

example to add collections-generic.jar, located in the ‘lib’ folder in the project gateway root:

<!-- Copy built project jars and lib jars to temp folder -->
<copy file="${basedir}/${modulename_compact}/Gateway/lib/collections-generic-4.01.jar" todir="${basedir}/${modulename_compact}/Build/temp_modl/" />

This is an old thread and you may no longer need it, but I just encountered the same problem and this solved it for me.

[quote=“nifemi”]Good day,

There is a " Copy built project jars and lib jars to temp folder" block in the build.xml of your module, it looks like a line needs to be added for each jar.

example to add collections-generic.jar, located in the ‘lib’ folder in the project gateway root:

<!-- Copy built project jars and lib jars to temp folder -->
<copy file="${basedir}/${modulename_compact}/Gateway/lib/collections-generic-4.01.jar" todir="${basedir}/${modulename_compact}/Build/temp_modl/" />

This is an old thread and you may no longer need it, but I just encountered the same problem and this solved it for me.[/quote]

Thanks for the update.

It’s worth noting that we have a new Maven-based SDK now, along with a Maven plugin for building modl files, and a lot of this work is handled by the plugin now. See github.com/inductiveautomation/ … k-examples for more info.

I know I started this a year ago and never got back until now, sorry.

I’m still having this problem. The Java console states that I have duplicate entries for a class I have defined. This class is in one of my JARs that both the Designer and Client use. So I have scoped that JAR with “DC”.

I’m still using the same module and Java versions when I started this discussion.

I have tried everyones suggestions but this problem remains.

Here are some details:

The dependency order is as follows: designer control depends on the client control which depends on a few JARs. Some of the JARs depend on each other; I made sure all JAR dependencies are included. Each of my JAR dependencies contain class paths to the dependent JARs within their own manifests. Here are my module jar statements:

            <jar scope="C">utils.jar.pack.gz</jar>
	<jar scope="C">exceptions.jar.pack.gz</jar>
	<jar scope="C">core.jar.pack.gz</jar>
	<jar scope="C">mcatypes.jar.pack.gz</jar>
	<jar scope="C">math.jar.pack.gz</jar>
	<jar scope="C">datasrcs.jar.pack.gz</jar>
	<jar scope="C">radtypes.jar.pack.gz</jar>
	<jar scope="C">analysis.jar.pack.gz</jar>
	<jar scope="C">controls.jar.pack.gz</jar>
	<jar scope="CD">spectroscopy-client.jar.pack.gz</jar>
           <jar scope="D">spectroscopy-designer.jar.pack.gz</jar>

When I try to start the designer I add an error in the console indicating the designer control cannot find a class in my ‘controls.jar.pack.gz’ file. But my designer control is dependent on the spectroscopy-client.jar.pack.gz which depends on ‘controls.jar.pack.gz’ file. I tried changing the module.xml to include the jars like

            <jar scope="C">utils.jar.pack.gz</jar>
	<jar scope="C">exceptions.jar.pack.gz</jar>
	<jar scope="C">core.jar.pack.gz</jar>
	<jar scope="C">mcatypes.jar.pack.gz</jar>
	<jar scope="C">math.jar.pack.gz</jar>
	<jar scope="C">datasrcs.jar.pack.gz</jar>
	<jar scope="C">radtypes.jar.pack.gz</jar>
	<jar scope="C">analysis.jar.pack.gz</jar>
	<jar scope="CD">controls.jar.pack.gz</jar>
	<jar scope="CD">spectroscopy-client.jar.pack.gz</jar>
           <jar scope="D">spectroscopy-designer.jar.pack.gz</jar>

But the next time I start the designer I get an error indicating I’m missing a class that I know is contained in ‘datasrcs.jar.pack.gz’. So I tried changing my module.xml to

            <jar scope="C">utils.jar.pack.gz</jar>
	<jar scope="C">exceptions.jar.pack.gz</jar>
	<jar scope="C">core.jar.pack.gz</jar>
	<jar scope="C">mcatypes.jar.pack.gz</jar>
	<jar scope="C">math.jar.pack.gz</jar>
	<jar scope="CD">datasrcs.jar.pack.gz</jar>
	<jar scope="C">radtypes.jar.pack.gz</jar>
	<jar scope="C">analysis.jar.pack.gz</jar>
	<jar scope="CD">controls.jar.pack.gz</jar>
	<jar scope="CD">spectroscopy-client.jar.pack.gz</jar>
           <jar scope="D">spectroscopy-designer.jar.pack.gz</jar>

At this point I see an error in the Java console indicating duplicate class definitions found while unpacking ‘datasrcs.jar.pack.gz’.

Downloading “http://localhost:8088/main/system/jar/mcom.canberra.opcua/datasrcs.jar” (timeout=60000)…
Connect successful.
Starting download of 6764 bytes
Download successful (in 1ms), unpacking…
Download attempt #1 for file datasrcs.jar failed.
java.lang.Exception: Error unpacking datasrcs.jar
at com.inductiveautomation.ignition.client.launch.steps.DownloadJarsStep.downloadJar(DownloadJarsStep.java:224)
at com.inductiveautomation.ignition.client.launch.steps.DownloadJarsStep.run(DownloadJarsStep.java:78)
at com.inductiveautomation.ignition.client.launch.AbstractStepRunner.run(AbstractStepRunner.java:32)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.zip.ZipException: duplicate entry: com/canberra/controllable/IControllable.class
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:233)
at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
at com.sun.java.util.jar.pack.NativeUnpack.writeEntry(NativeUnpack.java:323)
at com.sun.java.util.jar.pack.NativeUnpack.run(NativeUnpack.java:226)
at com.sun.java.util.jar.pack.NativeUnpack.run(NativeUnpack.java:247)
at com.sun.java.util.jar.pack.UnpackerImpl.unpack(UnpackerImpl.java:136)
at com.inductiveautomation.ignition.client.launch.steps.DownloadJarsStep.downloadJar(DownloadJarsStep.java:221)

Thanks

Well I guess the obvious question is: are you sure “com/canberra/controllable/IControllable.class” is defined only in one jar?

Hi Kevin,

I thought not, based on examining the contents, until I tried a tool that err’d revealing duplicates existed. Then I looked at the build scripts for those dependent JARs and noticed duplicates were sneaking in. After fixing the build scripts everything is now working.

Thanks