lambdaj fails java.lang.ExceptionInInitializerError with any call on Android
Asked Answered
A

1

2

I'm trying to use lambdaj on Android but with every simple call I make I get an exception (java.lang.ExceptionInInitializerError).

The class that fills the collection is:

@DatabaseTable(tableName = "sections")
public class Section {

    @DatabaseField(id = true, unique = true)
    private int id;

    @DatabaseField(canBeNull = false)
    private String name;

    public Section() {

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

The annotations are used by ORMLite. I left them in case they could be relevant somehow. I doubt it though.

And now if I try to make a simple call like, it crashes:

List<Section> sections = fillSections(); //this is correctly filled
select(sections, having(on(Section.class).getId(), Matchers.greaterThan(1)))

Logcat:

 FATAL EXCEPTION: main
 java.lang.ExceptionInInitializerError
    at ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89)
    at ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49)
    at ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory.java:68)
    at ch.lambdaj.function.argument.ArgumentsFactory.registerNewArgument(ArgumentsFactory.java:58)
    at ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.java:50)
    at ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.java:39)
    at ch.lambdaj.Lambda.on(Lambda.java:63)

What puzzles me is that I tried the very same code in a java console application and it worked...

Any idea why this wouldn't work on Android?

Thanks.

Aesthetically answered 27/4, 2013 at 20:6 Comment(0)
A
5

Apparently, lambdaj won't work on Android per the creator's words. https://groups.google.com/d/msg/lambdaj/km7uFgvSd3k/grJhgl3ik5sJ

After reading that I stopped trying to make it work myself.

Aesthetically answered 13/5, 2013 at 17:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.