Java:应用程序在连接GSM USB调制解调器时崩溃

时间:2010-06-16 19:42:52

标签: java usb gsm

我正在开发一个名为FrontlineSMS的开源应用程序,它可以与GSM调制解调器连接以发送和接收SMS。通过他们的网站提供的Windows安装程序工作正常。因为我想修改它,我得到了源代码并构建了jar并尝试启动它。当我插入GSM调制解调器并启动应用程序时,它有时会检测到GSM设备,我甚至可以发送和接收短信。要不然 1.)我收到以下错误 -

Launching FrontlineSMS for Windows... Stable Library
========================================= Native lib Version = RXTX-2.1-7 Java lib Version   = RXTX-2.1-7 Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Access is de ied.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Access is de ied.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x57 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2352): The parame er is incorrect.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

Error 0x1 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2497): Incorrect f nction.

2。)或者应用程序有时会因创建包含以下内容的日志文件而崩溃:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ccb, pid=4452, tid=3464
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [rxtxSerial.dll+0x9ccb]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x03433000):  JavaThread "SmsModem :: COM18" daemon [_thread_in_native, id=3464, stack(0x070a0000,0x070f0000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x038cfa10

Registers:
EAX=0x038cfa08, EBX=0x00000003, ECX=0x7c802413, EDX=0x00000001
ESP=0x070ef800, EBP=0x070ef9e8, ESI=0x3360b898, EDI=0x03433000
EIP=0x10009ccb, EFLAGS=0x00010202

Top of Stack: (sp=0x070ef800)
0x070ef800:   3360b8a0 6d9fbc40 6da2ed98 ffffffff
0x070ef810:   070ef848 6d8f0a2c 6d8f0340 070ef95c
0x070ef820:   070ef864 00000dfb 03433000 038cfa08
0x070ef830:   00000007 00000001 00000001 0000000a
0x070ef840:   03433bf4 fffffffe 070ef8f4 6d8f0b7a
0x070ef850:   070ef95c 03433bf8 6da6f210 6da6f538
0x070ef860:   070ef868 03433bf4 27f18708 27f18708
0x070ef870:   22eb9810 03433bc4 00000001 070ef898 

Instructions: (pc=0x10009ccb)
0x10009cbb:   45 1c 7c 19 8b 85 44 fe ff ff 8b 95 4c fe ff ff
0x10009ccb:   89 50 08 8b 55 f4 89 d0 e9 f8 01 00 00 c7 85 50 


Stack: [0x070a0000,0x070f0000],  sp=0x070ef800,  free space=13e070ef334k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [rxtxSerial.dll+0x9ccb]
C  [rxtxSerial.dll+0xa05e]
j  gnu.io.RXTXPort.readByte()I+0
j  gnu.io.RXTXPort$SerialInputStream.read()I+61
j  org.smslib.CSerialDriver.getResponse()Ljava/lang/String;+36
j  net.frontlinesms.smsdevice.SmsModem._doDetection()Z+172
j  net.frontlinesms.smsdevice.SmsModem.run()V+18
v  ~StubRoutines::call_stub
V  [jvm.dll+0xf049c]
V  [jvm.dll+0x17fcf1]
V  [jvm.dll+0xf0667]
V  [jvm.dll+0xf06dd]
V  [jvm.dll+0x11a2a0]
V  [jvm.dll+0x1ddb14]
V  [jvm.dll+0x17f96c]
C  [msvcr71.dll+0x9565]
C  [kernel32.dll+0xb729]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  gnu.io.RXTXPort.readByte()I+0
j  gnu.io.RXTXPort$SerialInputStream.read()I+61
j  org.smslib.CSerialDriver.getResponse()Ljava/lang/String;+36
j  net.frontlinesms.smsdevice.SmsModem._doDetection()Z+172
j  net.frontlinesms.smsdevice.SmsModem.run()V+18
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
=>0x03433000 JavaThread "SmsModem :: COM18" daemon [_thread_in_native, id=3464, stack(0x070a0000,0x070f0000)]
  0x0344b800 JavaThread "D3D Screen Updater" daemon [_thread_blocked, id=4404, stack(0x03dd0000,0x03e20000)]
  0x002b7800 JavaThread "DestroyJavaVM" [_thread_blocked, id=3236, stack(0x008c0000,0x00910000)]
  0x03f6f400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=1888, stack(0x038e0000,0x03930000)]
  0x03ec2400 JavaThread "AWT-Shutdown" [_thread_blocked, id=4300, stack(0x03740000,0x03790000)]
  0x032d8c00 JavaThread "EmailServerHandler" [_thread_blocked, id=5708, stack(0x03830000,0x03880000)]
  0x032f7000 JavaThread "Incoming message processor" [_thread_blocked, id=4184, stack(0x03650000,0x036a0000)]
  0x03004c00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4828, stack(0x035a0000,0x035f0000)]
  0x0303f400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3768, stack(0x03500000,0x03550000)]
  0x02b1e800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4164, stack(0x02dd0000,0x02e20000)]
  0x02b18c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2936, stack(0x02d80000,0x02dd0000)]
  0x02b17400 JavaThread "Attach Listener" daemon [_thread_blocked, id=5444, stack(0x02d30000,0x02d80000)]
  0x02b15c00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4976, stack(0x02ce0000,0x02d30000)]
  0x02b0d800 JavaThread "Finalizer" daemon [_thread_blocked, id=5876, stack(0x02c90000,0x02ce0000)]
  0x02b0c400 JavaThread "Reference Handler" daemon [_thread_blocked, id=5984, stack(0x02c40000,0x02c90000)]

Other Threads:
  0x02b0ac00 VMThread [stack: 0x02bf0000,0x02c40000] [id=4508]
  0x02b29800 WatcherThread [stack: 0x02e20000,0x02e70000] [id=6080]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 7808K, used 4003K [0x22990000, 0x23200000, 0x27ee0000)
  eden space 6976K,  45% used [0x22990000, 0x22ca8e90, 0x23060000)
  from space 832K, 100% used [0x23060000, 0x23130000, 0x23130000)
  to   space 832K,   0% used [0x23130000, 0x23130000, 0x23200000)
 tenured generation   total 17208K, used 15192K [0x27ee0000, 0x28fae000, 0x32990000)
   the space 17208K,  88% used [0x27ee0000, 0x28db6100, 0x28db6200, 0x28fae000)
 compacting perm gen  total 13824K, used 13655K [0x32990000, 0x33710000, 0x36990000)
   the space 13824K,  98% used [0x32990000, 0x336e5f98, 0x336e6000, 0x33710000)
    ro space 10240K,  51% used [0x36990000, 0x36ebae00, 0x36ebae00, 0x37390000)
    rw space 12288K,  54% used [0x37390000, 0x37a272d8, 0x37a27400, 0x37f90000)

Dynamic libraries:
0x00400000 - 0x00424000  C:\WINDOWS\system32\java.exe
0x7c900000 - 0x7c9b2000  C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f6000  C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000  C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f02000  C:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000  C:\WINDOWS\system32\Secur32.dll
0x7c340000 - 0x7c396000  C:\Program Files\Java\jre6\bin\msvcr71.dll
0x6d800000 - 0x6da97000  C:\Program Files\Java\jre6\bin\client\jvm.dll
0x7e410000 - 0x7e4a1000  C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f59000  C:\WINDOWS\system32\GDI32.dll
0x76b40000 - 0x76b6d000  C:\WINDOWS\system32\WINMM.dll
0x76390000 - 0x763ad000  C:\WINDOWS\system32\IMM32.DLL
0x6d7b0000 - 0x6d7bc000  C:\Program Files\Java\jre6\bin\verify.dll
0x6d330000 - 0x6d34f000  C:\Program Files\Java\jre6\bin\java.dll
0x6d290000 - 0x6d298000  C:\Program Files\Java\jre6\bin\hpi.dll
0x76bf0000 - 0x76bfb000  C:\WINDOWS\system32\PSAPI.DLL
0x6d7f0000 - 0x6d7ff000  C:\Program Files\Java\jre6\bin\zip.dll
0x6d000000 - 0x6d14a000  C:\Program Files\Java\jre6\bin\awt.dll
0x73000000 - 0x73026000  C:\WINDOWS\system32\WINSPOOL.DRV
0x77c10000 - 0x77c68000  C:\WINDOWS\system32\msvcrt.dll
0x774e0000 - 0x7761d000  C:\WINDOWS\system32\ole32.dll
0x773d0000 - 0x774d3000  C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\COMCTL32.dll
0x77f60000 - 0x77fd6000  C:\WINDOWS\system32\SHLWAPI.dll
0x5ad70000 - 0x5ada8000  C:\WINDOWS\system32\uxtheme.dll
0x74720000 - 0x7476c000  C:\WINDOWS\system32\MSCTF.dll
0x755c0000 - 0x755ee000  C:\WINDOWS\system32\msctfime.ime
0x7c9c0000 - 0x7d1d7000  C:\WINDOWS\system32\shell32.dll
0x6d230000 - 0x6d284000  C:\Program Files\Java\jre6\bin\fontmanager.dll
0x68000000 - 0x68036000  C:\WINDOWS\system32\rsaenh.dll
0x769c0000 - 0x76a74000  C:\WINDOWS\system32\USERENV.dll
0x5b860000 - 0x5b8b5000  C:\WINDOWS\system32\netapi32.dll
0x6d610000 - 0x6d623000  C:\Program Files\Java\jre6\bin\net.dll
0x71ab0000 - 0x71ac7000  C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000  C:\WINDOWS\system32\WS2HELP.dll
0x71a50000 - 0x71a8f000  C:\WINDOWS\System32\mswsock.dll
0x76f20000 - 0x76f47000  C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000  C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000  C:\WINDOWS\system32\WLDAP32.dll
0x16080000 - 0x160a5000  C:\Program Files\Bonjour\mdnsNSP.dll
0x76d60000 - 0x76d79000  C:\WINDOWS\system32\Iphlpapi.dll
0x63560000 - 0x63568000  C:\Program Files\National Instruments\Shared\mDNS Responder\nimdnsNSP.dll
0x63550000 - 0x63559000  C:\WINDOWS\system32\nimdnsResponder.dll
0x78130000 - 0x781cb000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCR80.dll
0x76fc0000 - 0x76fc6000  C:\WINDOWS\system32\rasadhlp.dll
0x10000000 - 0x10012000  C:\Documents and Settings\bjz677\Desktop\client run\rxtxSerial.dll
0x73d90000 - 0x73db7000  C:\WINDOWS\system32\crtdll.dll
0x4fdd0000 - 0x4ff76000  C:\WINDOWS\system32\d3d9.dll
0x038d0000 - 0x038d6000  C:\WINDOWS\system32\d3d8thk.dll
0x77c00000 - 0x77c08000  C:\WINDOWS\system32\VERSION.dll
0x6d630000 - 0x6d639000  C:\Program Files\Java\jre6\bin\nio.dll
0x03930000 - 0x03977000  C:\Program Files\Iomega\DriveIcons\IMGHOOK.DLL
0x605d0000 - 0x605d9000  C:\WINDOWS\system32\mslbui.dll
0x77120000 - 0x771ab000  C:\WINDOWS\system32\OLEAUT32.DLL

VM Arguments:
java_command: net.frontlinesms.DesktopLauncher
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20\bin
CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;
PATH=C:\Program Files\Intel\MKL\10.0.2.019\ia32\bin;C:\Program Files\Intel\VTune\CGGlbCache;C:\Program Files\Intel\VTune\Analyzer\Bin;C:\Program Files\Intel\VTune\Shared\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;s:\datamart\bin;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\IVI\bin;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\MATLAB\R2007b\bin;C:\Program Files\MATLAB\R2007b\bin\win32;C:\VXIPNP\WinNT\Bin;C:\Program Files\Intel\Compiler\Fortran\10.1.021\\IA32\Lib;C:\Program Files\Intel\Compiler\Fortran\10.1.021\\EM64T\Lib;C:\VXIPNP\WinNT\Bin\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.6.0_20\bin
USERNAME=xxx
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows XP Build 2600 Service Pack 3

CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3

Memory: 4k page, physical 2094960k(1063364k free), swap 4032536k(3038408k free)

vm_info: Java HotSpot(TM) Client VM (16.3-b01) for windows-x86 JRE (1.6.0_20-b02), built on Apr 12 2010 13:52:23 by "java_re" with MS VC++ 7.1 (VS2003)

time: Wed Jun 16 11:53:40 2010
elapsed time: 45 seconds

有谁知道是什么原因造成的?

3 个答案:

答案 0 :(得分:0)

EXCEPTION_ACCESS_VIOLATION(0xc0000005)表示在Windows中拒绝访问,通常是因为您没有权限/权限来执行您尝试执行的操作。

您可能需要对已构建的jar进行签名才能访问驱动程序。这告诉java运行时可以访问系统驱动程序,文件系统等等。

这是一个教程:http://java.sun.com/docs/books/tutorial/deployment/jar/signing.html

答案 1 :(得分:0)

我们必须看到代码,而不仅仅是termios.c中的错误。最有可能的是,从Java调用的本机库中存在错误。当您尝试访问已释放的内存中的变量时,通常会发生访问冲突错误。

答案 2 :(得分:0)

我遇到了和你一样的问题,我的解决方案非常简单,我使用的是USB串口线缆,线缆很糟糕,我只是用不同的驱动器更换了更好的线缆,问题解决了。 RxTxCom驱动程序在从#34; PORT"获取UART时遇到了问题,这就是崩溃的原因,下面是找到其他地方的解决方案:

这是行号。 SetupComm失败。

termios.c(869):

     if( !SetupComm( port->hComm, 2048, 1024 ) )
     {
             YACK(); <===== 869
             return -1;
     }

SetupComm是一个非常古老的w32 API调用,所以有一些不同寻常的东西 港口。

YACK()是一个帮助宏,只是吐出调用失败的原因。 &#34;废话, 哎呀,哎呀!&#34; :)

我的猜测是,这不是一个真正的串口,而是一个司机试图 看起来像一个[不好]。 A&#39;真实&#39;串口有一个UART,通常是 没有额外的司机认可。我们无能为力 从我所知道的那些改进那个函数调用。你可能会看看是否 有一个较新的驱动程序用于串行端口&#39;如果我说的话有道理 给你。

我唯一可以建议的是你不想要任何其他东西 当您尝试使用rxtx找到它时使用该端口的软件。

希望它可以帮助你。