cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Missing JAR Ressources errors when importing extension

CBraud
3-Newcomer

Missing JAR Ressources errors when importing extension

Hello,

 

I'm currently trying to import my first developed extension with the Eclipse Plugin but I encountered many problems when trying to import my extension.

 

So I wrote a small extension by using Thingworx extension on Eclipse IDE, this extension use an extern library called zip4j (see https://github.com/srikanth-lingala/zip4j), I use this library by adding this in my gradle.build :

 

CB_10166452_0-1649082696537.png

 

Then I created a Thingworx template and added some ThingWorx services... everything seem to work no missing library when using the zip4j functionalities...

 

So I compile my project with gradle with these settings :

 

CB_10166452_1-1649082854749.png

 

Gradle build successfully my ThingWorx extension project, I import my extension with the zip generated in build/distributions.


And I encountered this error :

CB_10166452_2-1649082993187.png

THX tells me some JAR are missing in my .JAR generated, when checking the logs, I can read this :

 

2022-04-04 14:36:03.817+0000 [L: WARN] [O: c.t.p.Project] [I: ] [U: FDL_THX_Student] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-7] The project name of a project cannot be changed. It must be set to itself
2022-04-04 14:36:06.094+0000 [L: INFO] [O: c.t.w.Importer] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-10] Starting entity import of C:\ThingworxStorage\extensions\temp\Zip4jThingWorx_6aba57cd-b612-4900-9b9c-286623ea6f6b\Zip4jThingWorx\metadata.xml
2022-04-04 14:36:06.094+0000 [L: INFO] [O: c.t.migration] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-10] Export file missing version information. No migration will be performed.
2022-04-04 14:36:06.094+0000 [L: INFO] [O: c.t.w.Importer] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-10] Successfully added for import C:\ThingworxStorage\extensions\temp\Zip4jThingWorx_6aba57cd-b612-4900-9b9c-286623ea6f6b\Zip4jThingWorx\metadata.xml
2022-04-04 14:36:06.094+0000 [L: ERROR] [O: c.t.e.u.ExtensionPackageUtilities] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-10] Extension: Zip4jGradle - could not find zip4jgradle.jar in extension.
2022-04-04 14:36:06.094+0000 [L: ERROR] [O: c.t.e.u.ExtensionPackageUtilities] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-10] Extension: Zip4jGradle - could not find all specified JAR files. Please check application log for missing JAR errors.
2022-04-04 14:36:47.346+0000 [L: WARN] [O: c.t.p.Project] [I: ] [U: FDL_THX_Student] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-9] The project name of a project cannot be changed. It must be set to itself
2022-04-04 14:37:16.914+0000 [L: WARN] [O: c.t.p.Project] [I: ] [U: FDL_THX_Student] [S: ] [P: ] [T: http-nio-0.0.0.0-8080-exec-1] The project name of a project cannot be changed. It must be set to itself

 

In my metadata.xml : I can see that some Jar ressources are added :

 

CB_10166452_3-1649083220660.png

 

In the .jar of my extension, no presence of zip4jGradle.jar, this jar should be generated but it's not the case.

Did I forgot to add something in my buildpath/gradle configuration in Eclipse IDE?

Regards.

ACCEPTED SOLUTION

Accepted Solutions
VladimirRosu
19-Tanzanite
(To:CBraud)

Hi @CBraud ,

I don't use the gradle plugin in Eclipse (never managed to install the required plugin), but I am relatively sure that the createZip task in the gradle script does not add the jar file in the extension zip file. That task only adds jars from the lib folder.

While the dependencies section you modified allows you to write your code error-free, you also need to modify the createZip to add the required jar files in the extension zip.

I leave the task of modifying the gradle script to you, since I have no knowledge of gradle outside of guessing what I wrote here.

 

If this suggestion helps, please let us know for the benefit of others (it would be awesome to see the modifications you did to the gradle script)

View solution in original post

2 REPLIES 2
VladimirRosu
19-Tanzanite
(To:CBraud)

Hi @CBraud ,

I don't use the gradle plugin in Eclipse (never managed to install the required plugin), but I am relatively sure that the createZip task in the gradle script does not add the jar file in the extension zip file. That task only adds jars from the lib folder.

While the dependencies section you modified allows you to write your code error-free, you also need to modify the createZip to add the required jar files in the extension zip.

I leave the task of modifying the gradle script to you, since I have no knowledge of gradle outside of guessing what I wrote here.

 

If this suggestion helps, please let us know for the benefit of others (it would be awesome to see the modifications you did to the gradle script)

Turns out that the "Zip4Gradle.jar" in my metadata.xml wasn't supposed to be here, now the extension is imported in my Composer but not without some problems behind, ahah, but I'll see how can I fix those others problems before creating another topic.

Thank you for your help!

Announcements


Top Tags