Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerExeception when performing RushSearch (Duplicate of #74) #99

Open
null-dev opened this issue Feb 12, 2016 · 1 comment
Open

Comments

@null-dev
Copy link

Hey guys,
I'm having the same problem as #74... I'm getting a NullPointerException when trying to execute a Rush search...
Heres some raw data:

Stack Trace:

02-11 23:30:33.780 10392-10672/xyz.nulldev.slickmangaapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
                                                                           Process: xyz.nulldev.slickmangaapp, PID: 10392
                                                                           java.lang.RuntimeException: An error occured while executing doInBackground()
                                                                               at android.os.AsyncTask$3.done(AsyncTask.java:300)
                                                                               at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                                                                               at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                                                                               at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                               at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                                                                               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                               at java.lang.Thread.run(Thread.java:818)
                                                                            Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String co.uk.rushorm.core.AnnotationCache.getTableName()' on a null object reference
                                                                               at co.uk.rushorm.core.RushSearch.buildSql(RushSearch.java:90)
                                                                               at co.uk.rushorm.core.RushSearch.find(RushSearch.java:41)
                                                                               at xyz.nulldev.slickmangaapp.fragment.LoadMangaTask.doInBackground(MyMangaFragment.java:75)
                                                                               at xyz.nulldev.slickmangaapp.fragment.LoadMangaTask.doInBackground(MyMangaFragment.java:61)
                                                                               at android.os.AsyncTask$2.call(AsyncTask.java:288)
                                                                               at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                               at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
                                                                               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                               at java.lang.Thread.run(Thread.java:818) 

In case you are interested, RushORM is initialized in a background thread (but the application blocks until initialization is complete) with this code:

AndroidInitializeConfig config = new AndroidInitializeConfig(context.getApplicationContext());
config.addRushColumn(new RushURLColumn());
config.addRushColumn(new RushUUIDColumn());
config.addRushColumn(new ReadingDirection.ReadingDirectionColumn());
config.addRushColumn(new Status.StatusColumn());
RushCore.initialize(config);

Here is line 75 of MyMangaFragment.java:

mangas.addAll(new RushSearch().find(Manga.class));

The Manga.java class (object being persisted) is gigantic so here it is in a seperate Gist: https://gist.github.com/null-dev/f0bf2daa32217dd105c0

P.S: This is a manga reading app but it's open source (just unpublished) so if you need any other code just ask me.

@null-dev
Copy link
Author

I have successfully solved this problem by settings the classes manually using config.setClass. I will keep this issue open however as this is not my preferred solution (I would prefer the automated scanning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant