mozilla / rhino

Rhino is an open-source implementation of JavaScript written entirely in Java
https://rhino.github.io
Other
4.18k stars 850 forks source link

rhino-1.7R4.jar and JarJar command Issue #458

Open AMulyaMishra123 opened 6 years ago

AMulyaMishra123 commented 6 years ago

Hi I am trying to create a single jar by combining few other jars and rhino-1.7R4.jar using JarJar-1.4 command. So the default Package of Rhino changes from org.mozilla. to "com.apps.mozilla."

Everything works fine, but as soon as the code Script.exec() gets invoked to validate a Reg Expr, I keep getting this Exception

Caused by: java.lang.AbstractMethodError: com.apps.mozilla.javascript.gen.re_1.exec(Lcom/apps/mozilla/javascript/Context;Lcom/apps/mozilla/javascript/Scriptable;)Ljava/lang/Object; at com.apps.mozilla.javascript.Context.evaluateString(Context.java:1079)

Is there any solution to this as I am blocked? When I dont use Jarjar and dont change the default Package from org.mozilla to something else, it works very fine.

p-bakker commented 3 years ago

Not an expert, but maybe this is due to bytecode being generated, which uses Strings for package/class names and those don't get converted by jarjar?

I see com/apps/mozilla/javascript/Scriptable in the error message you posted, which is a non-converted package name