HelenBlack / lambdaj

Automatically exported from code.google.com/p/lambdaj
Apache License 2.0
0 stars 0 forks source link

Android + maven + lambdaj #101

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add to the pom.xml lambdaj 2.4, hamcrest-all 1.3 and objenesis 1.2
2. Exclude hamcrest from the rest of dependencies in order to avoid duplicate 
dependencies.
3. Compile one of the example with the Person.class and select or filter in a 
list.
4. Deploy to a device.

What is the expected output? What do you see instead?
An exception is thrown in runtime. I think due to problem in the static 
initialization. I paste the exception stack:

10-02 06:13:27.962: E/AndroidRuntime(9379): FATAL EXCEPTION: main
10-02 06:13:27.962: E/AndroidRuntime(9379): 
java.lang.ExceptionInInitializerError
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory
.java:68)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.function.argument.ArgumentsFactory.registerNewArgument(ArgumentsFacto
ry.java:58)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.ja
va:50)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.ja
va:39)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
ch.lambdaj.Lambda.on(Lambda.java:63)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
com.gmv.sattoll.activities.MainMenu$1.test(MainMenu.java:230)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
com.gmv.sattoll.activities.MainMenu$1.onItemClick(MainMenu.java:198)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.widget.AdapterView.performItemClick(AdapterView.java:292)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.widget.AbsListView.performItemClick(AbsListView.java:1082)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.widget.AbsListView$PerformClick.run(AbsListView.java:2625)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.widget.AbsListView$1.run(AbsListView.java:3296)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.os.Handler.handleCallback(Handler.java:605)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.os.Looper.loop(Looper.java:137)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
android.app.ActivityThread.main(ActivityThread.java:4697)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
java.lang.reflect.Method.invokeNative(Native Method)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
java.lang.reflect.Method.invoke(Method.java:511)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
dalvik.system.NativeStart.main(Native Method)
10-02 06:13:27.962: E/AndroidRuntime(9379): Caused by: java.lang.VerifyError: 
net/sf/cglib/core/ReflectUtils
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:166)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.jav
a:25)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
10-02 06:13:27.962: E/AndroidRuntime(9379):     at 
net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
10-02 06:13:27.962: E/AndroidRuntime(9379):     ... 22 more

What version of the product are you using? On what operating system?
Android 4.0.3
Maven 3.0.4
Maven android plugin 3.3.2.
Lambdaj 2.4 or 2.3.3 (with or without all-dependencies.jar)
hamcrest-all 1.3
objenesis 1.2

Please provide any additional information below.
This is a great job, I'm looking forward to be able to use it :).
Thanks in advance for your replay.

Best regards.

Original issue reported on code.google.com by A.Poblac...@gmail.com on 2 Oct 2012 at 10:57

GoogleCodeExporter commented 8 years ago
Im also facing the same..
04-20 00:06:40.912: D/StackTrace(17142): java.lang.VerifyError: 
net/sf/cglib/core/ReflectUtils
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:166)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.jav
a:25)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
04-20 00:06:40.912: D/StackTrace(17142):     
net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory
.java:68)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.function.argument.ArgumentsFactory.registerNewArgument(ArgumentsFacto
ry.java:58)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.ja
va:50)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.ja
va:39)
04-20 00:06:40.912: D/StackTrace(17142):     
ch.lambdaj.Lambda.on(Lambda.java:63)
04-20 00:06:40.912: D/StackTrace(17142):     
pl.magot.vetch.ancal.agenda.AgendaViewWeekNew.initLayout(AgendaViewWeekNew.java:
518)
04-20 00:06:40.912: D/StackTrace(17142):     
pl.magot.vetch.ancal.agenda.AgendaViewWeekNew.Rebuild(AgendaViewWeekNew.java:335
)
04-20 00:06:40.912: D/StackTrace(17142):     
pl.magot.vetch.ancal.AnCal.RefreshAgendaAfterViewItemChange(AnCal.java:1787)
04-20 00:06:40.912: D/StackTrace(17142):     
pl.magot.vetch.ancal.AnCal$2.run(AnCal.java:442)
04-20 00:06:40.912: D/StackTrace(17142):     
android.os.Handler.handleCallback(Handler.java:605)
04-20 00:06:40.912: D/StackTrace(17142):     
android.os.Handler.dispatchMessage(Handler.java:92)
04-20 00:06:40.912: D/StackTrace(17142):     
android.os.Looper.loop(Looper.java:137)
04-20 00:06:40.912: D/StackTrace(17142):     
android.app.ActivityThread.main(ActivityThread.java:4560)
04-20 00:06:40.912: D/StackTrace(17142):     
java.lang.reflect.Method.invokeNative(Native Method)
04-20 00:06:40.912: D/StackTrace(17142):     
java.lang.reflect.Method.invoke(Method.java:511)
04-20 00:06:40.912: D/StackTrace(17142):     
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-20 00:06:40.912: D/StackTrace(17142):     
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-20 00:06:40.912: D/StackTrace(17142):     
dalvik.system.NativeStart.main(Native Method)

Original comment by vdkhakhk...@gmail.com on 20 Apr 2013 at 7:08

GoogleCodeExporter commented 8 years ago
I have same problem. I am using 2.4 with the latest Android ADT and getting 
following error. The same test code works fine in normal Java project but 
doesn't work in Android. Please help get this resolved as I really would like 
to use this framework instead of inventing the wheel.

10-16 12:27:36.996: E/AndroidRuntime(2243): FATAL EXCEPTION: main
10-16 12:27:36.996: E/AndroidRuntime(2243): Process: com.usb.cps.axol.usbc, 
PID: 2243
10-16 12:27:36.996: E/AndroidRuntime(2243): java.lang.VerifyError: 
net/sf/cglib/core/ReflectUtils
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:166)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.jav
a:25)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory
.java:68)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.function.argument.ArgumentsFactory.registerNewArgument(ArgumentsFacto
ry.java:58)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.ja
va:50)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.ja
va:39)
10-16 12:27:36.996: E/AndroidRuntime(2243):     at 
ch.lambdaj.Lambda.on(Lambda.java:63)

Original comment by nehalniy...@gmail.com on 16 Oct 2014 at 4:35