Open beirigo opened 13 years ago
I'm not sure what's going on right now. There may be several problems regarding this issue, let's work on it:
If none of the above solves your problem, can you simplify your source code and send us your environment so that we can debug? If you want to debug it yourself, clone project to your computer and then include in your classpath and add breakpoints to PackageEntityInspector.java
.
It is very unlikely that this problem is Android-specific, I think.
I've created a new project now it couldn't find packages automatically or detect classes by specifying package name.
The whole thing is broken for some reason now. @0ffffffffh can you investigate please?
It seems broken, i built the jar from source but the problem persists. I'd recomend creating tags for stable releases so one can use it if something goes wrong on master branch. This might be useful: I tried to use MappingSession.registerEntity(MyClass.class) and got the following error:
E/AndroidRuntime(25103): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime(25103): java.lang.NoSuchMethodError: java.util.LinkedList.descendingIterator
E/AndroidRuntime(25103): at org.orman.mapper.EntityDependencyGraph.getDestroySchedule(EntityDependencyGraph.java:186)
E/AndroidRuntime(25103): at org.orman.mapper.MappingSession.constructSchema(MappingSession.java:432)
E/AndroidRuntime(25103): at org.orman.mapper.MappingSession.startNoCheck(MappingSession.java:316)
E/AndroidRuntime(25103): at org.orman.mapper.MappingSession.start(MappingSession.java:237)
It looks like there's a problem with Android SDK in this issue, it is different than entity search process (it creates dependency graph to create entities in correct order, that's when the error occurs).
http://developer.android.com/reference/java/util/LinkedList.html#descendingIterator() says that this method is implemented. That's totally weird.
Since API 9 only, however. What version are you running it on?
@JakeWharton oops I missed that part (under jetlag) and just focused to LinkedList exists since API 1. We shouldn't rely on that and create our own iterator.
@marcosbeirigo, thanks for noticing this bug.
What's the MinSDK version to run orman on android? Couldn't find it on the wiki...
Since it is written in pure Java SE, we didn't even checked for what's min version actually. That exception was really a surprise for me. It should throw compilation error before you create APK since the method does not exist, but apparently it doesn't.
I'm fixing it right now. It should work on API≥3.
It will only produce an error if you compile against the lowest API level you support. Most apps compile against higher API levels even though they support older ones.
I didn't know that. NoSuchMethodError
exception is fixed with 239de3ac6f573638a2a8. You can now clone and rake
.
@marcosbeirigo, i will investigate this issue. thanks for bug report.
Have another problem with mapping on Android: Occurs: when trying to register db Error: ERROR/AndroidRuntime(14805): Caused by: org.orman.mapper.exception.AnnotatedClassNotFoundInPackageException: Could not find any entity marked class in 'dalvik'
When I map entities by hand everything works fine: MappingSession.registerEntity(Sample.class);
I'm using last library built from git clone rep, built by rake.
@0ffffffffh is working on it already. It is a dalvik vm classloading policy issue. He'll push his work when he's done with it. thanks for your patience.
Thanks for your work, guys! When it would be critical bugs free, it would be awesome framework for Android.
Is there any update on merging the development branch with master
that this bug is fixed @0ffffffffh? Thanks.
yes. I will commit an update soon. Currently, I'm developing an eclipse plugin. Of course, that is related with this issue. (You can see at https://github.com/0ffffffffh/OrmanEclipseDevPlugin). Dalvik classloader issue is a stringent problem to resolve. I'm still working on it.
Same issue @0ffffffffh here. Waiting for the update.
I had the same issue, while registering packages and when searching automatically for entities. Registering the entities one by one seems to work.
Database db = new SQLiteAndroid(getApplicationContext(), "mydatabase.db");
MappingSession.getConfiguration().setCreationPolicy(SchemaCreationPolicy.CREATE_IF_NOT_EXISTS);
MappingSession.registerEntity(MyEntity.class); //Works
MappingSession.registerPackage("my.package.name"); //Doesn't work
MappingSession.registerDatabase(db);
MappingSession.start();
@ragunathjawahar we are aware of the issue. Unfortunately classloading mechanism is kind of different in Dalvik VM than JVM. Therefore we are having issues, @0ffffffffh is working on it. Until that time, try to use //Works
line if it is not a big deal.
@ahmetalpbalkan, anyways great job, I'll keep following orman closely.
I don't know if this is the right place for this... I'm trying to create a simple android project using orman but can't get my entities mapped. I have all my entities under the "br.com.jera.shoplist.model" package and when i try to start the session i get this error:
Before anybody asks, all my entities have the @Entity annotation. I'm using this in my activty to start the session:
Any idea? am I missing something?