Using the JarJar Repackaging Tool

I have deployed a web application for the Google App Engine, and my web service uses the jersey 1.14 framework. When I try to use or use web services in GAE, I get the java.lang.IncompatibleClassChangeError: Implementing class. I searched around and realized that jersey 1.14 depends on asm 3.1, and the google app engine uses asm 4.0 and realizes that I had to use JarJar to install dependencies in order to fix this problem, but I have no hint on how to do this with Jarjar. The tutorial I found was very mysterious and oriented to experienced programmers. Someone might post a beginner-oriented tutorial, or walk me through the steps to solve this problem.

+8
java google-app-engine jersey
source share
2 answers

Ok, this is a rather late answer, but if someone crosses, maybe this will help. I will give an example and explain this. jarjar can be used to repack java libraries. it can be used to change the namespace, for example, org.apache.common.codec needs to be changed to some_random_name.org.apache.common.codec. Download the jarjar from the jarjar download site, later insert the jar file you want to modify (myinjar.jar), and load the jarjar in one folder and run this java -jar jarjar-1.4.jar process myrules.txt myinjar.jar myoutjar.jar in myrules.txt add these lines

 rule org.apache.commons.codec.** some_random_name.org.apache.commons.codec.@1 

the output of myoutjar.jar will be saved in one folder and you can use it in your project without conflicts

+9
source share

You can use the jdk jar command to extract and merge jar files.
jar -xvf firstjar.jar .... The jar classes / package wise -com / pak1 / pak2 directory will be extracted
Now, extract the second can and merge both extended folders
No, you can create a single jar of merged class files.
jar -cvf mergedjar.jar [folder name [ex com org ...]], for more information on how jar commands work.

0
source share

All Articles