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

problems with SQLite database with ActiveRecord #661

Open
DHFE opened this issue Aug 21, 2014 · 20 comments
Open

problems with SQLite database with ActiveRecord #661

DHFE opened this issue Aug 21, 2014 · 20 comments
Labels
bug community contribution wanted Can you contribute to resolving this issue? Please join in! documentation
Milestone

Comments

@DHFE
Copy link

DHFE commented Aug 21, 2014

I trried with the https://github.com/ruboto/ruboto/wiki/Tutorial%3A-Using-an-SQLite-database-with-ActiveRecord, the project run but is suddenly stoped. I was run roboto on windows and my example is running on android API 10.

this is the logcat message:
E/AndroidRuntime(11150): FATAL EXCEPTION: Thread with large stack
E/AndroidRuntime(11150): org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- active_record
E/AndroidRuntime(11150): at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
E/AndroidRuntime(11150): at RUBY.(root)(file:/data/app/org.ruboto.example.sqlite_ar-2.apk!/database.rb:1)
E/AndroidRuntime(11150): at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
E/AndroidRuntime(11150): at RUBY.(root)(jar:file:/data/app/org.ruboto.example.sqlite_ar-2.apk!/sqlite_ar_activity.rb:1)
E/AndroidRuntime(11150): at org.jruby.RubyProc.call(org/jruby/RubyProc.java:249)
E/AndroidRuntime(11150): at RUBY.onResume(jar:file:/data/app/org.ruboto.example.sqlite_ar-2.apk!/sqlite_ar_activity.rb:20)

@donv donv added this to the 1.1.3 milestone Aug 23, 2014
@gdurelle
Copy link

same problem.

jruby 1.7.13 (1.9.3p392) 2014-06-24 43f133c on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- active_record

when trying with last activerecord:

org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- i18n

no change when adding i18n gem though.

@donv donv added bug labels Sep 1, 2014
@donv
Copy link
Member

donv commented Sep 1, 2014

Hi @DHFE and @gdurelle !

I am working on getting the Ruboto tests green for the next release. I will take a look at this right after that. If someone else has the time before that, please go ahead.

@gdurelle
Copy link

gdurelle commented Sep 1, 2014

Great :) Thx.

@DHFE
Copy link
Author

DHFE commented Sep 8, 2014

Hi

I made another test with windows 8, RUBOTO_CORE_VERSION_NAME: 1.0.2
Ruby version: RUBY1_9 y android 4.0.2
this is from logcat
I/ActivityManager( 80): START {act=android.intent.action.VIEW cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.ruboto.example.sqlite_ar/.SqliteArActivity} from pid 547
W/WindowManager( 80): Failure taking screenshot for (240x394) to layer 21015
D/RUBOTO ( 547): onPause:
D/RUBOTO ( 547): EntryPointActivity onCreate:
I/System.out( 547): RubotoActivity onCreate(): org.ruboto.example.sqlite_ar.SqliteArActivity, finishing: false
D/RUBOTO ( 547): Looking for Ruby class: SqliteArActivity
D/RUBOTO ( 547): Found: null
D/RUBOTO ( 547): Checking path: /mnt/sdcard/Android/data/org.ruboto.example.sqlite_ar/files/scripts/sqlite_ar_activity.rb
D/RUBOTO ( 547): Checking path: scripts/sqlite_ar_activity.rb
D/RUBOTO ( 547): Classpath resource: jar:file:/data/app/org.ruboto.example.sqlite_ar-1.apk!/sqlite_ar_activity.rb
D/RUBOTO ( 547): Found script.
D/RUBOTO ( 547): Checking path: /mnt/sdcard/Android/data/org.ruboto.example.sqlite_ar/files/scripts/sqlite_ar_activity.rb
D/RUBOTO ( 547): Checking path: scripts/sqlite_ar_activity.rb
D/RUBOTO ( 547): Classpath resource: jar:file:/data/app/org.ruboto.example.sqlite_ar-1.apk!/sqlite_ar_activity.rb
D/RUBOTO ( 547): hasBackingJavaClass
D/RUBOTO ( 547): Loading script: sqlite_ar_activity.rb
D/RUBOTO ( 547): Script contains class definition
D/RUBOTO ( 547): Script has separate Java class
D/dalvikvm( 547): GC_CONCURRENT freed 1567K, 6% free 27210K/28871K, paused 11ms+22ms
D/dalvikvm( 547): GC_CONCURRENT freed 1010K, 4% free 28284K/29383K, paused 12ms+19ms
D/RUBOTO ( 547): Set class: Java::OrgRubotoExampleSqlite_ar::SqliteArActivity
D/RUBOTO ( 547): Checking path: /mnt/sdcard/Android/data/org.ruboto.example.sqlite_ar/files/scripts/sqlite_ar_activity.rb
D/RUBOTO ( 547): Checking path: scripts/sqlite_ar_activity.rb
D/RUBOTO ( 547): Classpath resource: jar:file:/data/app/org.ruboto.example.sqlite_ar-1.apk!/sqlite_ar_activity.rb
D/dalvikvm( 547): GC_CONCURRENT freed 1377K, 5% free 28959K/30407K, paused 11ms+26ms
D/dalvikvm( 547): GC_CONCURRENT freed 818K, 3% free 30222K/31111K, paused 15ms+19ms
D/dalvikvm( 547): GC_CONCURRENT freed 1646K, 6% free 30674K/32391K, paused 14ms+23ms
W/ActivityManager( 80): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 80): Activity idle timeout for ActivityRecord{4193d1f8 org.ruboto.example.sqlite_ar/.SqliteArActivity}
D/dalvikvm( 547): GC_CONCURRENT freed 1310K, 5% free 31399K/32839K, paused 13ms+21ms
D/dalvikvm( 547): GC_CONCURRENT freed 1675K, 6% free 31779K/33543K, paused 16ms+20ms
W/ActivityManager( 80): Activity destroy timeout for ActivityRecord{41a371b0 org.ruboto.example.sqlite_ar/org.ruboto.SplashActivity}
D/dalvikvm( 547): GC_CONCURRENT freed 1672K, 6% free 32094K/33927K, paused 18ms+19ms
D/dalvikvm( 547): GC_CONCURRENT freed 1794K, 6% free 32269K/34247K, paused 12ms+20ms
D/dalvikvm( 547): GC_CONCURRENT freed 1674K, 6% free 32570K/34439K, paused 13ms+21ms
E/dalvikvm( 547): Could not find class 'jnr.ffi.Platform$Darwin', referenced from method jnr.ffi.Platform.determinePlatform
W/dalvikvm( 547): VFY: unable to resolve new-instance 1155 (Ljnr/ffi/Platform$Darwin;) in Ljnr/ffi/Platform;
D/dalvikvm( 547): VFY: replacing opcode 0x22 at 0x0011
E/dalvikvm( 547): Could not find class 'jnr.ffi.Platform$Windows', referenced from method jnr.ffi.Platform.determinePlatform
W/dalvikvm( 547): VFY: unable to resolve new-instance 1163 (Ljnr/ffi/Platform$Windows;) in Ljnr/ffi/Platform
D/dalvikvm( 547): VFY: replacing opcode 0x22 at 0x001d
D/dalvikvm( 547): DexOpt: unable to opt direct call 0x207d at 0x13 in Ljnr/ffi/Platform;.determinePlatform
D/dalvikvm( 547): DexOpt: unable to opt direct call 0x2091 at 0x1f in Ljnr/ffi/Platform;.determinePlatform
W/dalvikvm( 547): Exception Ljava/lang/NullPointerException; thrown while initializing Ljnr/ffi/Platform$SingletonHolder;
E/dalvikvm( 547): Could not find class 'sun.misc.Signal', referenced from method jnr.posix.JavaPOSIX.signal
W/dalvikvm( 547): VFY: unable to resolve new-instance 9196 (Lsun/misc/Signal;) in Ljnr/posix/JavaPOSIX;
D/dalvikvm( 547): VFY: replacing opcode 0x22 at 0x0000
D/dalvikvm( 547): DexOpt: unable to opt direct call 0xd87c at 0x11 in Ljnr/posix/JavaPOSIX;.signal
I/dalvikvm( 547): Failed resolving Ljnr/posix/JavaPOSIX$SunMiscSignalHandler; interface 9197 'Lsun/misc/SignalHandler;'
W/dalvikvm( 547): Link of class 'Ljnr/posix/JavaPOSIX$SunMiscSignalHandler;' failed
D/dalvikvm( 547): DexOpt: unable to opt direct call 0x2490 at 0x16 in Ljnr/posix/JavaPOSIX;.signal
I/System.out( 547): Exception in Thread with large stack: Can't create handler inside thread that has not called Looper.prepare()
W/System.err( 547): at java.lang.Thread.run(java/lang/Thread.java:856)

W/dalvikvm( 547): threadid=11: thread exiting with uncaught exception (group=0x409961f8)

E/AndroidRuntime( 547): FATAL EXCEPTION: Thread with large stack
E/AndroidRuntime( 547): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

@donv
Copy link
Member

donv commented Sep 8, 2014

Exception in Thread with large stack: Can't create handler inside thread that has not called Looper.prepare()

This is your reason. I don't have time to investigate more right now, but if this is from the tutorial I will get to it "soon".

@DHFE
Copy link
Author

DHFE commented Sep 8, 2014

Thanks donv
Nice day

@iPet
Copy link

iPet commented Sep 19, 2014

Any progress on fixing this bug?

@donv
Copy link
Member

donv commented Sep 19, 2014

Sorry, I have not had any time for this one. Maybe this weekend. If someone else has time, please go ahead.

@DHFE
Copy link
Author

DHFE commented Sep 19, 2014

@gdurelle
Hi

We have the same problem, Are you develop on Windows?

@gdurelle
Copy link

@DHFE Nop I'm on Mac OSX.

@DHFE
Copy link
Author

DHFE commented Sep 25, 2014

I have installed this gem:
gem 'activerecord', '<4.0.0'
gem 'activerecord-jdbc-adapter', '<1.3.0'
gem 'activerecord-jdbcsqlite3-adapter', '<1.3.0'
gem 'sqldroid'

and tested the example again, I got a little bit diferrent message from logcat:
I/System.out( 588): Exception in Thread with large stack: load error: active_record/attribute_methods -- java.lang.OutOfMemoryError: null
I/System.out( 588): file:/data/app/org.ruboto.example.sqlite_ar-1.apk!/active_record.rb:105:in `ActiveRecord'
W/System.err( 588): org.jruby.exceptions.RaiseException: (LoadError) load error: active_record/attribute_methods -- java.lang.OutOfMemoryError: null
E/AndroidRuntime( 588): FATAL EXCEPTION: Thread with large stack
E/AndroidRuntime( 588): org.jruby.exceptions.RaiseException: (LoadError) load error: active_record/attribute_methods -- java.lang.OutOfMemoryError: null
W/System.err( 608): org.jruby.exceptions.RaiseException: (LoadError) load error: active_record/attribute_methods -- java.lang.OutOfMemoryError: null

@DHFE
Copy link
Author

DHFE commented Sep 29, 2014

Now, I got this error:
E/AndroidRuntime( 448): FATAL EXCEPTION: Thread with large stack
E/AndroidRuntime( 448): org.jruby.exceptions.RaiseException: (NameError) cannot load Java class org.sqldroid.SQLDroidDriver
Some idea?

@DHFE
Copy link
Author

DHFE commented Sep 30, 2014

Hi @donv

A little question, I was reading this article https://github.com/SQLDroid/SQLDroid/wiki/Quick-Start and i did this "In order to use the SQLDroid driver you will need to put the SQLDroid Jar in the "libs" directory of your Android project." and after that I got this from logcat:

V/SQlDRoid( 980): opening database /data/data/org.ruboto.example.sqlite_ar/files/my_db.sqlite
D/dalvikvm( 980): GC_FOR_ALLOC freed 1409K, 5% free 38927K/40583K, paused 955ms
I/System.out( 980): �[1m�[36m (19.0ms)�[0m �[1mSELECT name FROM sqlite_master WHERE type = 'table' AND name = "schema_migrations"�[0m
I/System.out( 980): �[1m�[35m (5.0ms)�[0m SELECT name FROM sqlite_master WHERE type = 'table' AND name = "schema_migrations"
I/System.out( 980): �[1m�[36m (5.0ms)�[0m �[1mSELECT "schema_migrations"."version" FROM "schema_migrations" �[0m
I/System.out( 980): Found 1 migrations.
I/System.out( 980): Migrating to CreatePeople (1)
I/System.out( 980): == CreatePeople: migrating ===================================================
I/System.out( 980): -- create_table(:people)
D/dalvikvm( 980): GC_FOR_ALLOC freed 1532K, 5% free 39306K/41095K, paused 931ms
W/System.err( 980): ********************* not implemented @ org.sqldroid.SQLDroidStatement (getGeneratedKeys) line 222
I/System.out( 980): �[1m�[35m (237.0ms)�[0m CREATE TABLE "people" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(32) NOT NULL, "birthdate" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
I/System.out( 980): -> 3.3470s
I/System.out( 980): -> 1 rows
I/System.out( 980): -- add_index(:people, :name, {:unique=>true})
W/System.err( 980): ********************* not implemented @ org.sqldroid.SQLDroidDatabaseMetaData (storesLowerCaseIdentifiers) line 987
W/System.err( 980): ********************* not implemented @ org.sqldroid.SQLDroidDatabaseMetaData (storesLowerCaseIdentifiers) line 987
W/System.err( 980): ********************* not implemented @ org.sqldroid.SQLDroidDatabaseMetaData (getIndexInfo) line 381
D/dalvikvm( 980): GC_FOR_ALLOC freed 1867K, 6% free 39268K/41479K, paused 944ms
I/System.out( 980): Exception in Thread with large stack: An error has occurred, this and all later migrations canceled:

This error is caused for "W/System.err( 980): ********************* not implemented @ org.sqldroid.SQLDroidDatabaseMetaData (storesLowerCaseIdentifiers) line 987
W/System.err( 980): ********************* not implemented @ org.sqldroid.SQLDroidDatabaseMetaData (storesLowerCaseIdentifiers) line 987
W/System.err( 980): ********************* not implemented @ " insn't it?

Thanks

@DHFE
Copy link
Author

DHFE commented Oct 2, 2014

Hi @donv
There is my Settings:

C:\rubotoproj\sqlite_ar>jruby -v
jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b on Java HotSpot(TM) 64-Bit Server VM
1.6.0-b105 [Windows Vista-amd64]
C:\rubotoproj\sqlite_ar>ruboto
WARN: Unresolved specs during Gem::Specification.reset:
rake (~> 10.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Ruboto -- Ruby for Android 1.1.2
Execute ruboto gen app --help for instructions on how to gener
ate a fresh Ruby-enabled Android app
Execute ruboto --help for other options
C:\rubotoproj\sqlite_ar>

Could you tell me If i need to use another jruby, ruboto, or java version?

@donv donv modified the milestones: 1.1.3, 1.1.4 Oct 13, 2014
@donv
Copy link
Member

donv commented Apr 5, 2015

Hi @DHFE @gdurelle @iPet !

I am releasing Ruboto 1.3.0 later today. Could you try it and see if it fixes your problem?

@donv donv modified the milestones: 1.3.1, 1.3.0 Apr 5, 2015
@viniciusgati
Copy link

same for 1.3.1-dev maybe a workaround?
i am with the sqldroid.jar RC

@donv
Copy link
Member

donv commented Apr 28, 2015

Hi @viniciusgati !

Do you have a GitHub repository I could try?

@viniciusgati
Copy link

Hi @donv thanks for the reply! i created one https://github.com/viniciusgati/sqlite_ar
i followed the tutorial and i am getting this error, im on yosemite.

@donv donv added the contribution wanted Can you contribute to resolving this issue? Please join in! label May 4, 2015
@donv
Copy link
Member

donv commented May 4, 2015

Thanks for the repository. I am pretty swamped right now, but I will try to get around to it quickly.

If anybody else has the time, please help.

@donv donv modified the milestones: 1.3.1, 1.3.2 Oct 12, 2015
@donv
Copy link
Member

donv commented Dec 22, 2015

Hi all!

Working on the 1.3.2 release now. Postponing this issue to the next release.

@donv donv modified the milestones: 1.3.3, 1.3.2 Dec 22, 2015
@gfowley gfowley modified the milestones: 1.4.1, 1.4.2 Jan 21, 2016
@donv donv modified the milestones: 1.5.0, 1.5.1 Nov 17, 2016
@donv donv modified the milestones: 1.6.0, 1.6.1 Dec 27, 2016
@donv donv modified the milestones: 1.6.1, 1.6.2 Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community contribution wanted Can you contribute to resolving this issue? Please join in! documentation
Projects
None yet
Development

No branches or pull requests

6 participants