Recent

Author Topic: LAMW: jMsSqlJDBCConnection can not connect  (Read 1151 times)

af0815

  • Hero Member
  • *****
  • Posts: 656
LAMW: jMsSqlJDBCConnection can not connect
« on: March 02, 2021, 09:14:34 pm »
Based on the Demo AppMSSQLJDBCConnectionDemo i want to connect to a MS-SQLServer.
If i come to the open command, the App is instantly closed without a message on my testdevice.

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jButton3Click(Sender: TObject);
  2. begin
  3.   //jAsyncTask1.Execute;
  4.   jMsSqlJDBCConnection1.ServerIP:='192.168.1.xx';
  5.   jMsSqlJDBCConnection1.UserName:='Looser';
  6.   jMsSqlJDBCConnection1.Password:='secret';
  7.   jMsSqlJDBCConnection1.DatabaseName:='testdb';
  8.   jEditText1.Text:='1';
  9.   if jMsSqlJDBCConnection1.Open() then
  10.   begin
  11.       jEditText1.Text:='2';
  12.       jMsSqlJDBCConnection1.Close();
  13.   end
  14.   else   jEditText1.Text:='Sorry... fail to connect...';
  15. end;
  16.  

With Logcat i found a part of the log with info

Quote
I/System.out(20504): [socket][0] connection /192.168.1.yy1433;LocalPort=36324(0)
I/System.out(20504): [CDS]connect[/192.168.1.xx:1433] tm:90
D/Posix   (20504): [Posix_connect Debug]Process org.lamw.applamwproject1 :1433
I/System.out(20504): [socket][/192.168.1.yy:36324] connected
I/System.out(20504): [CDS]rx timeout:0
D/dalvikvm(20504): GC_CONCURRENT freed 784K (6058), 25% free 3135K/4132K, paused 2ms+3ms, total 46ms
D/dalvikvm(20504): WAIT_FOR_CONCURRENT_GC blocked 39ms
I/dalvikvm(20504): Could not find method org.ietf.jgss.GSSManager.getInstance, referenced from method net.sourceforge.jtds.jdbc.TdsCore.createGssToken
W/dalvikvm(20504): VFY: unable to resolve static method 3303: Lorg/ietf/jgss/GSSManager;.getInstance ()Lorg/ietf/jgss/GSSManager;
D/dalvikvm(20504): VFY: replacing opcode 0x71 at 0x0000
I/dalvikvm(20504): Could not find method org.ietf.jgss.GSSContext.initSecContext, referenced from method net.sourceforge.jtds.jdbc.TdsCore.sendGssToken
W/dalvikvm(20504): VFY: unable to resolve interface method 3297: Lorg/ietf/jgss/GSSContext;.initSecContext ([BII)[B
D/dalvikvm(20504): VFY: replacing opcode 0x72 at 0x0008
W/dalvikvm(20504): VFY: unable to resolve exception class 559 (Lorg/ietf/jgss/GSSException;)
W/dalvikvm(20504): VFY: unable to find exception handler at addr 0x4a
W/dalvikvm(20504): VFY:  rejected Lnet/sourceforge/jtds/jdbc/TdsCore;.sendGssToken ()V
W/dalvikvm(20504): VFY:  rejecting opcode 0x0d at 0x004a
W/dalvikvm(20504): VFY:  rejected Lnet/sourceforge/jtds/jdbc/TdsCore;.sendGssToken ()V
W/dalvikvm(20504): Verifier rejected class Lnet/sourceforge/jtds/jdbc/TdsCore;
W/dalvikvm(20504): JNI WARNING: JNI function GetObjectClass called with exception pending
W/dalvikvm(20504):              in Lorg/lamw/applamwproject1/Controls;.pOnClick:(JI)V (GetObjectClass)
W/dalvikvm(20504): Pending exception is:
I/dalvikvm(20504): java.lang.VerifyError: net/sourceforge/jtds/jdbc/TdsCore
I/dalvikvm(20504):    at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:359)
I/dalvikvm(20504):    at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
I/dalvikvm(20504):    at java.sql.DriverManager.getConnection(DriverManager.java:175)
I/dalvikvm(20504):    at java.sql.DriverManager.getConnection(DriverManager.java:140)
I/dalvikvm(20504):    at org.lamw.applamwproject1.jMsSqlJDBCConnection.createConnection(jMsSqlJDBCConnection.java:73)
I/dalvikvm(20504):    at org.lamw.applamwproject1.jMsSqlJDBCConnection.Open(jMsSqlJDBCConnection.java:82)
I/dalvikvm(20504):    at org.lamw.applamwproject1.Controls.pOnClick(Native Method)
I/dalvikvm(20504):    at org.lamw.applamwproject1.jButton$1.onClick(jButton.java:80)
I/dalvikvm(20504):    at android.view.View.performClick(View.java:4222)
I/dalvikvm(20504):    at android.view.View$PerformClick.run(View.java:17622)
I/dalvikvm(20504):    at android.os.Handler.handleCallback(Handler.java:800)
I/dalvikvm(20504):    at android.os.Handler.dispatchMessage(Handler.java:100)
I/dalvikvm(20504):    at android.os.Looper.loop(Looper.java:194)
I/dalvikvm(20504):    at android.app.ActivityThread.main(ActivityThread.java:5434)
I/dalvikvm(20504):    at java.lang.reflect.Method.invokeNative(Native Method)
I/dalvikvm(20504):    at java.lang.reflect.Method.invoke(Method.java:525)
I/dalvikvm(20504):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:834)
I/dalvikvm(20504):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
I/dalvikvm(20504):    at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(20504): "main" prio=5 tid=1 NATIVE
I/dalvikvm(20504):   | group="main" sCount=0 dsCount=0 obj=0x40e9eaa8 self=0x40e8d0d8
I/dalvikvm(20504):   | sysTid=20504 nice=0 sched=0/0 cgrp=apps handle=1074899084
I/dalvikvm(20504):   | state=R schedstat=( 574480404 114610847 1509 ) utm=41 stm=16 core=2
D/dalvikvm(20504): dump native stack for : main
D/dalvikvm(20504): unwind backtrace
D/dalvikvm(20504): get native symbol
D/dalvikvm(20504): format backtrace line
I/dalvikvm(20504):   #00  pc 000012a0  /system/lib/libcorkscrew.so (unwind_backtrace_thread+27)
I/dalvikvm(20504):   #01  pc 00061da2  /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int)+53)
I/dalvikvm(20504):   #02  pc 00055558  /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool)+355)
I/dalvikvm(20504):   #03  pc 00055606  /system/lib/libdvm.so (dvmDumpThread(Thread*, bool)+25)
I/dalvikvm(20504):   #04  pc 0003950a  /system/lib/libdvm.so
I/dalvikvm(20504):   #05  pc 0004186c  /system/lib/libdvm.so
D/dalvikvm(20504): get native done
I/dalvikvm(20504):   at org.lamw.applamwproject1.Controls.pOnClick(Native Method)
I/dalvikvm(20504):   at org.lamw.applamwproject1.jButton$1.onClick(jButton.java:80)
I/dalvikvm(20504):   at android.view.View.performClick(View.java:4222)
I/dalvikvm(20504):   at android.view.View$PerformClick.run(View.java:17622)
I/dalvikvm(20504):   at android.os.Handler.handleCallback(Handler.java:800)
I/dalvikvm(20504):   at android.os.Handler.dispatchMessage(Handler.java:100)
I/dalvikvm(20504):   at android.os.Looper.loop(Looper.java:194)
I/dalvikvm(20504):   at android.app.ActivityThread.main(ActivityThread.java:5434)
I/dalvikvm(20504):   at java.lang.reflect.Method.invokeNative(Native Method)
I/dalvikvm(20504):   at java.lang.reflect.Method.invoke(Method.java:525)
I/dalvikvm(20504):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:834)
I/dalvikvm(20504):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
I/dalvikvm(20504):   at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(20504):
E/dalvikvm(20504): VM aborting
F/libc    (20504): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 20504 (applamwproject1)
D/AEE/AED (  131): $===AEE===AEE===AEE===$
D/AEE/AED (  131): p 0 poll events 1 revents 0
D/AEE/AED (  131): not know revents:0
D/AEE/AED (  131): p 1 poll events 1 revents 0
D/AEE/AED (  131): not know revents:0
D/AEE/AED (  131): p 2 poll events 1 revents 1
D/AEE/AED (  131): aed_main_fork_worker: generator 0x3c168, worker 0xbe8d39e8, recv_fd 15
D/AEE/AED (  131): p 3 poll events 1 revents 0
D/AEE/AED (  131): not know revents:0
D/AEE/AED (  131): p 4 poll events 1 revents 0
D/AEE/AED (  131): not know revents:0
I/DEBUG   (20661): handle_request(15)
I/DEBUG   (20661): check process 20504 name:applamwproject1
I/DEBUG   (20661): BOOM: pid=20504 uid=10066 gid=10066 tid=20504
I/DEBUG   (20661): [OnPurpose Redunant in preset_info] pid: 20504, tid: 20504, name: applamwproject1  >>> org.lamw.applamwproject1 <<<
I/SurfaceTextureClient(  646): [STC::queueBuffer] (this:0x5e3678b8) fps:1.00, dur:1001.97, max:1001.97, min:1001.97
I/BufferQueue(  137): [StatusBar](this:0x424103a8,api:1) [queue] fps:1.00, dur:1002.05, max:1002.05, min:1002.05
I/DEBUG   (20661): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (20661): Build fingerprint: 'TCT/ALCATEL_ONE_TOUCH_7041D/YARISXL:4.2.2/JDQ39/vASF-0:user/release-keys'
I/DEBUG   (20661): pid: 20504, tid: 20504, name: applamwproject1  >>> org.lamw.applamwproject1 <<<
I/DEBUG   (20661): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
I/BufferQueue(  137): [StatusBar](this:0x424103a8,api:1) [release] fps:1.00, dur:1001.78, max:1001.78, min:1001.78
I/SurfaceTextureClient(  137): [STC::queueBuffer] (this:0x416ff9e0) fps:3.45, dur:1160.06, max:369.92, min:157.99
I/BufferQueue(  137): [FramebufferSurface](this:0x41841008,api:1) [release] fps:3.45, dur:1160.05, max:369.99, min:157.92
I/BufferQueue(  137): [FramebufferSurface](this:0x41841008,api:1) [queue] fps:3.45, dur:1160.03, max:370.04, min:157.85
I/SurfaceFlinger(  137): [SurfaceFlinger] fps:3.448151,dur:1160.04,max:370.11,min:157.80
I/DEBUG   (20661):     r0 00000000  r1 00000000  r2 deadd00d  r3 00000000
I/DEBUG   (20661):     r4 40a0d850  r5 0000020c  r6 1d200232  r7 00000001
I/DEBUG   (20661):     r8 bea13414  r9 56deed94  sl 40e8d0e8  fp bea13254
I/DEBUG   (20661):     ip 00004000  sp bea12f28  lr 4014a77c  pc 409967f8  cpsr 60000030
I/DEBUG   (20661):
I/DEBUG   (20661): backtrace:
I/DEBUG   (20661):     #00  pc 000467f8  /system/lib/libdvm.so (dvmAbort+75)
I/DEBUG   (20661):     #01  pc 0004186d  /system/lib/libdvm.so
I/DEBUG   (20661):     #02  pc 00040f54  /data/app-lib/org.lamw.applamwproject1-2/libcontrols.so
I/DEBUG   (20661):
I/DEBUG   (20661): stack:
I/DEBUG   (20661):          bea12ee8  00000001 
I/DEBUG   (20661):          bea12eec  4018cd8c 
I/DEBUG   (20661):          bea12ef0  4018cd8c 
I/DEBUG   (20661):          bea12ef4  40189178  /system/lib/libc.so
I/DEBUG   (20661):          bea12ef8  4018cd8c 
I/DEBUG   (20661):          bea12efc  4014a77c  /system/lib/libc.so (__sflush_locked+60)
I/DEBUG   (20661):          bea12f00  401891cc  /system/lib/libc.so
I/DEBUG   (20661):          bea12f04  ffffffff 
I/DEBUG   (20661):          bea12f08  00000000 
I/DEBUG   (20661):          bea12f0c  4014c3c0  /system/lib/libc.so (_fwalk+64)
I/DEBUG   (20661):          bea12f10  40a0d850  /system/lib/libdvm.so
I/DEBUG   (20661):          bea12f14  0000020c 
I/DEBUG   (20661):          bea12f18  1d200232 
I/DEBUG   (20661):          bea12f1c  00000001 
I/DEBUG   (20661):          bea12f20  df0027ad 
I/DEBUG   (20661):          bea12f24  00000000 
I/DEBUG   (20661):     #00  bea12f28  58ce5d22  /system/framework/framework.odex
I/DEBUG   (20661):          bea12f2c  6c756e28 
I/DEBUG   (20661):          bea12f30  0000296c 
I/DEBUG   (20661):          bea12f34  00000000 
I/DEBUG   (20661):          bea12f38  00000000 
I/DEBUG   (20661):          bea12f3c  00000000 
I/DEBUG   (20661):          bea12f40  00000000 
I/DEBUG   (20661):          bea12f44  00000000 
I/DEBUG   (20661):          bea12f48  00000000 
I/DEBUG   (20661):          bea12f4c  00000000 
I/DEBUG   (20661):          bea12f50  00000000 
I/DEBUG   (20661):          bea12f54  00000000 
I/DEBUG   (20661):          bea12f58  00000000 
I/DEBUG   (20661):          bea12f5c  00000000 
I/DEBUG   (20661):          bea12f60  00000000 
I/DEBUG   (20661):          bea12f64  00000000 
I/DEBUG   (20661):          ........  ........
I/DEBUG   (20661):     #01  bea13140  6d90001d 
I/DEBUG   (20661):          bea13144  40e8d0d8 
I/DEBUG   (20661):          bea13148  bea1318c  [stack]
I/DEBUG   (20661):          bea1314c  40e76228 
I/DEBUG   (20661):          bea13150  40a02db0  /system/lib/libdvm.so
I/DEBUG   (20661):          bea13154  00000000 
I/DEBUG   (20661):          bea13158  409ec401  /system/lib/libdvm.so
I/DEBUG   (20661):          bea1315c  4098a88d  /system/lib/libdvm.so
I/DEBUG   (20661):          bea13160  00000000 
I/DEBUG   (20661):          bea13164  5d62ad10  /data/app-lib/org.lamw.applamwproject1-2/libcontrols.so
I/DEBUG   (20661):          bea13168  5d62ad10  /data/app-lib/org.lamw.applamwproject1-2/libcontrols.so
I/DEBUG   (20661):          bea1316c  00000000 
I/DEBUG   (20661):          bea13170  56deeda0 
I/DEBUG   (20661):          bea13174  5d5d7f58  /data/app-lib/org.lamw.applamwproject1-2/libcontrols.so
I/DEBUG   (20661):     #02  bea13178  40a0d850  /system/lib/libdvm.so
I/DEBUG   (20661):          bea1317c  4018c210 
I/DEBUG   (20661):          bea13180  00000000 
I/DEBUG   (20661):          bea13184  5d6758a0 
I/DEBUG   (20661):          bea13188  00000000 
I/DEBUG   (20661):          bea1318c  5d6758a0 
I/DEBUG   (20661):          bea13190  00000000 
I/DEBUG   (20661):          bea13194  00000000 
I/DEBUG   (20661):          bea13198  00000000 
I/DEBUG   (20661):          bea1319c  00000000 
I/DEBUG   (20661):          bea131a0  00000000 
I/DEBUG   (20661):          bea131a4  00000000 
I/DEBUG   (20661):          bea131a8  00000000 
I/DEBUG   (20661):          bea131ac  00000000 
I/DEBUG   (20661):          bea131b0  00000000 
Anyy hint ?
regards
Andreas

jmpessoa

  • Hero Member
  • *****
  • Posts: 1791
Re: LAMW: jMsSqlJDBCConnection can not connect
« Reply #1 on: March 03, 2021, 01:29:03 am »

The core error is here:

Quote
W/dalvikvm(20504): Pending exception is:
I/dalvikvm(20504): java.lang.VerifyError: net/sourceforge/jtds/jdbc/TdsCore
I/dalvikvm(20504):    at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:359)
I/dalvikvm(20504):    at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
I/dalvikvm(20504):    at java.sql.DriverManager.getConnection(DriverManager.java:175)
I/dalvikvm(20504):    at java.sql.DriverManager.getConnection(DriverManager.java:140)

I/dalvikvm(20504):    at org.lamw.applamwproject1.jMsSqlJDBCConnection.createConnection(jMsSqlJDBCConnection.java:73)

I/dalvikvm(20504):    at org.lamw.applamwproject1.jMsSqlJDBCConnection.Open(jMsSqlJDBCConnection.java:82)

I will verify LAMW template "jMsSqlJDBCConnection.java" lines 73 and 82



Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

af0815

  • Hero Member
  • *****
  • Posts: 656
Re: LAMW: jMsSqlJDBCConnection can not connect
« Reply #2 on: March 07, 2021, 07:32:08 pm »
I have done more tests, with a newer device  connect, select and delete ist working.

So i think the connection have to be Android 6 or better.

Newer Device: Samsung S5 duos SM-G900FD Android 6.0.1
Older : Alcatel One Touch 7041D Android 4.2.2
regards
Andreas

 

TinyPortal © 2005-2018