Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using JarJar repackaging tool

I have deployed a web application to the Google app engine and my web service uses the jersey 1.14 framework. When I try to consume or invoke the web services on the GAE I get a java.lang.IncompatibleClassChangeError: Implementing class. I searched around and got to realize that jersey 1.14 depends on asm 3.1 and google app engine uses asm 4.0 and realize that I had to use JarJar to package the dependencies to fix this problem but I don't have a clue about how to do this with JarJar. The tutorial I found was very cryptic and geared towards experience programmers.So can someone post a tutorial that is geared towards a beginner or walk me through the steps to solve this problem.

like image 263
Joel Dean Avatar asked Sep 27 '12 01:09

Joel Dean


1 Answers

Well this is quite late answer, but if someone crosses by may be it would help. I will take an example and explain this. jarjar can be used to repackage java libraries. it can be used to change namespace for example org.apache.common.codec needs to be changed to some_random_name.org.apache.common.codec. Download jarjar from jarjar download site later paste the jar file you want to change (myinjar.jar) and downloaded jarjar into one folder and run this command 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 myoutjar.jar will be saved into same folder and you can use it in your project without any conflicts

like image 94
krishna chaitanya Avatar answered Sep 21 '22 05:09

krishna chaitanya