I see two problems here: 1) SLF4J is not setup correctly. 2) The baud rate you are working with throws some errors. Try with different baud rates as well!
On Mar 7, 10:36 am, NhatThien <[email protected]> wrote: > Sorry for late reply. > I think the problem come from: > --- > this.srv = new Service(); > --- > > I delete "try...catch" to view the exception and got this: > --- > run: > Example: Read messages from a serial gsm modem. > SMSLib: A Java API library for sending and receiving SMS via a GSM > modem or other supported gateways. > This software is distributed under the terms of the Apache v2.0 > License. > Web Site:http://smslib.org > Version: 3.4.5 > Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/ > LoggerFactory > at org.smslib.helper.Logger.<init>(Logger.java:34) > at org.smslib.Service.<init>(Service.java:100) > at firstsmsex.Main.doIt(Main.java:68) > at firstsmsex.Main.main(Main.java:184) > Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: > 319) > ... 4 more > Java Result: 1 > BUILD SUCCESSFUL (total time: 1 second) > --- > > and I've got something when i run comTest program: > ------- > run: > > Searching for devices... > > Found port: COM3 > Trying at 9600... Getting Info... Found: AT+CGMMERROR > Trying at 14400... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 19200... Getting Info... Found: AT+CGMMERROR > Trying at 28800... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 33600... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 38400... Getting Info... Found: AT+CGMMERROR > Trying at 56000... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 57600... Getting Info... Found: AT+CGMMERROR > Trying at 115200... Getting Info... Found: AT+CGMMERROR > > Found port: COM4 > Trying at 9600... Getting Info... Found: AT+CGMM+CGMM: > "GSM900","GSM1800","GSM1900","MODEL=L6" > Trying at 14400... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 19200... Getting Info... Found: AT+CGMM+CGMM: > "GSM900","GSM1800","GSM1900","MODEL=L6" > Trying at 28800... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 33600... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 38400... Getting Info... Found: AT+CGMM+CGMM: > "GSM900","GSM1800","GSM1900","MODEL=L6" > Trying at 56000... no device found > (javax.comm.UnsupportedCommOperationException: Unsupported baud rate) > Trying at 57600... Getting Info... Found: AT+CGMM+CGMM: > "GSM900","GSM1800","GSM1900","MODEL=L6" > Trying at 115200... Getting Info... Found: AT+CGMM+CGMM: > "GSM900","GSM1800","GSM1900","MODEL=L6" > > Test complete. > BUILD SUCCESSFUL (total time: 47 seconds) > ------- > > Thanks for your help. I'm trying to find some answers from others > posts too. -- You received this message because you are subscribed to the Google Groups "SMSLib User Group" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/smslib?hl=en.
