I have created a module.xml using the documentation that has one jar inside as gz using the Pack200 application.
I am unable to create a script that is using an import statement for that class.
error is : ImportError: No module named xxx
What have I done wrong?
What scope did you load the jar into and what scope is your test script in?
scope = “GDC”
and i’m using the Script console from the designer, that’s the only way I know to test a script before implementing it somewhere.
You might try loading it just in CD for now and see if that changes anything. Gateway scope should get its own separate entry that isn’t packed.
If not, we’ll need more information… maybe show us what your module.xml looks like, confirm that your module is being loaded with some logging statements, tell us about the jar you’re loading, show us the script, etc…
So, modified the module and change the scope to CD, imported the module ok
in the script console, simple script to see if module exists:
So, no luck.
That 0kb length in the log message is suspicious…
1 Like
saw that too, not sure what that means.
So, the jar is compressed using pack200 from Oracle.
The module.xml is using the gz as jar.
When I tried using the jar in the jar section, it didn’t work. the jar is 80Mb.
I will try creating a simple class and see if I can use it in ignition.
If the resulting .modl file isn’t also many megabytes in size something is going wrong with your build process. How are you building it?
I have created a new project in Eclipse with one class in it and was able to create the module, import it and use it using the import statement and the call itself.
Noted that I need to call using the full statement of the jar file… x.x.x.proc();
So, a module is working.
I will create what i need for a function call and include that new jar into Ignition and use it as such. There is a depends switch in the module.xml that I might need to use.
Probably started this too far, lets go step by step.
Thanks for the help.