1

I developed an application that sends SMS (using SMSlib), when I execute my application on netbeans it works well and sends SMS without problem.

with the same PC exported runnable Jar, stops sending the SMS.

but when I execute my jar at the command line:

java -jar "D: \ dist \ Abs.jar"

the application runs well and sends the SMS, I copied the files as follows:

 comm.jar ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ lib
 comm.jar ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ jre \ lib \ ext
 win32com.dll ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ bin
 win32com.dll ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ jre \ bin
 win32com.dll ==> C: \ Windows \ System32
 javax.comm.properties ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ lib
 javax.comm.properties ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ jre \ lib

someone has an idea where the problem comes?

thank you

stack trace(netbeans):

mars 30, 2016 12:32:11 PM Abs.AjouterAbs jBAbsSMSActionPerformed
INFOS: Entering application.

    0 [AWT-EventQueue-0] INFO smslib  - 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.

    0 [AWT-EventQueue-0] INFO smslib  - Version: 3.5.1
    0 [AWT-EventQueue-0] INFO smslib  - JRE Version: 1.7.0_79
    0 [AWT-EventQueue-0] INFO smslib  - JRE Impl Version: 24.79-b02
    0 [AWT-EventQueue-0] INFO smslib  - O/S: Windows 7 / x86 / 6.1
    0 [AWT-EventQueue-0] DEBUG smslib  - Initialized.
    0 [AWT-EventQueue-0] INFO smslib  - Queue directory not defined. Queued messages will not be saved to filesystem.
    0 [AWT-EventQueue-0] DEBUG smslib  - Initialized.
    0 [NotifyQueueManager] DEBUG smslib  - Running...
    0 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager running...
    0 [AWT-EventQueue-0] DEBUG smslib  - Initialized.
    0 [DelayQueueManager] DEBUG smslib  - Running...
    0 [DelayQueueManager] DEBUG smslib  - DelayQueueManager running...
    0 [WatchDog] DEBUG smslib  - Running...
    0 [Thread-7] INFO smslib  - GTW: modem.com4: Starting gateway, using Generic AT Handler.
    0 [Thread-7] INFO smslib  - GTW: modem.com4: Opening: COM20 @9600
    47 [Thread-7] DEBUG smslib  - Initialized.
    47 [Thread-7] DEBUG smslib  - Initialized.
    47 [KeepAlive [modem.com4]] DEBUG smslib  - Running...
    47 [CNMIEmulatorProcessor [modem.com4]] DEBUG smslib  - ** disabled **
    47 [Thread-7] DEBUG smslib  - GTW: modem.com4: ModemReader thread started.
    47 [Thread-7] DEBUG smslib  - GTW: modem.com4: AsyncNotifier thread started.
    47 [Thread-7] DEBUG smslib  - GTW: modem.com4: AsyncMessageProcessor thread started.
    47 [Thread-7] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    1061 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :(27)
    1264 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :+++
    1467 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :ATZ(cr)
    1670 [Thread-7] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    2684 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :ATZ(cr)
    2886 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :ATE0(cr)
    3089 [Thread-7] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    4103 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CPIN?(cr)
    4103 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: +CPIN: READY
    4103 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :+CPIN: READY(cr)
    4103 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :ATE0(cr)
    4306 [Thread-7] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CLIP=1(cr)
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: OK
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :OK(cr)
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+COPS=0(cr)
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: OK
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :OK(cr)
    5320 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :ATE0(cr)
    5523 [Thread-7] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CREG=1(cr)
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: OK
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :OK(cr)
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CREG?(cr)
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: +CREG: 1,1OK
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :+CREG: 1,1(cr)OK(cr)
    6537 [Thread-7] INFO smslib  - GTW: modem.com4: GSM: Registered to home network.
    6537 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMEE=1(cr)
    6552 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: OK
    6552 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :OK(cr)
    6552 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CPMS=?(cr)
    6552 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: +CPMS: ("SM","ME"),("SM","ME"),("SM","ME")OK
    6552 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :+CPMS: ("SM","ME"),("SM","ME"),("SM","ME")(cr)OK(cr)
    6552 [Thread-7] INFO smslib  - GTW: modem.com4: MEM: Storage Locations Found: SMME
    6552 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CNMI=?(cr)
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: +CNMI: (0-2),(0-3),(0,2),(0-2),(0,1)OK
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :+CNMI: (0-2),(0-3),(0,2),(0-2),(0,1)(cr)OK(cr)
    6568 [Thread-7] DEBUG smslib  - CNMI: Found best match: 2
    6568 [Thread-7] DEBUG smslib  - CNMI: Found best match: 1
    6568 [Thread-7] DEBUG smslib  - CNMI: Found best match: 0
    6568 [Thread-7] DEBUG smslib  - CNMI: Found best match: 2
    6568 [Thread-7] DEBUG smslib  - CNMI: Found best match: 0
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CNMI=2,1,0,2,0(cr)
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: OK
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :OK(cr)
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMGF=0(cr)
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: BUFFER: OK
    6568 [Thread-7] DEBUG smslib  - GTW: modem.com4: RECV :OK(cr)
    6568 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager end...
    6568 [Thread-7] DEBUG smslib  - Initialized.
    6568 [Thread-7] INFO smslib  - GTW: modem.com4: Gateway started.
    6568 [QueueManager [modem.com4]] DEBUG smslib  - Running...
    6677 [NotifyQueueManager] DEBUG smslib  - Running...
    6677 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager running...
    6677 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager end...
    6786 [NotifyQueueManager] DEBUG smslib  - Running...
    6786 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager running...
    11576 [QueueManager [modem.com4]] DEBUG smslib  - Running...
    11576 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMMS=2(cr)
    11576 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: BUFFER: AT+CMMS=2OK
    11576 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: RECV :AT+CMMS=2(cr)(cr)OK(cr)
    11591 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: =================================================
    << SmsSubmitPdu >>
    Raw Pdu: 0011000B911296564756F30008FF6000410062007300200076006F0075007300200069006E0066006F0072006D006500200071007500650020006C00270065006E0076006F0069002000640065007300200053004D005300200065007300740020007400E90072006D0069006E00E9

    SMSC Address: [Length: 0 octets]
    First Octet: 11 [TP-MTI: (SMS-SUBMIT), TP-MMS: (has no messages), TP-RD: (allow duplicates), TP-VPF: (validity format, integer, TP-SRI: (No Status Report), TP-SRR: (No Status Report), TP-UDHI: (no UDH)]
    Message Reference: 00
    Destination Address: [Length: 11 (0B), Type: 81 (10000001), Address: 21696574653]
    TP-PID: 00 (00000000)
    TP-DCS: 08 (UCS2 encoding) (00001000)
    TP-VPF: 10584 hours

    User Data Length: 96 (60) octets
    User Data (pdu) : 00410062007300200076006F0075007300200069006E0066006F0072006D006500200071007500650020006C00270065006E0076006F0069002000640065007300200053004D005300200065007300740020007400E90072006D0069006E00E9
    User Data (decoded): [Abs vous informe que l'envoi des SMS est términé]
    =================================================

    11591 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: Sending Pdu: 0011000B911296564756F30008FF6000410062007300200076006F0075007300200069006E0066006F0072006D006500200071007500650020006C00270065006E0076006F0069002000640065007300200053004D005300200065007300740020007400E90072006D0069006E00E9
    11591 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMGS=110(cr)
    11794 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    12808 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :0011000B911296564756F30008FF6000410062007300200076006F0075007300200069006E0066006F0072006D006500200071007500650020006C00270065006E0076006F0069002000640065007300200053004D005300200065007300740020007400E90072006D0069006E00E9
    14259 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: BUFFER: 0011000B911296564756F30008FF6000410062007300200076006F0075007300200069006E0066006F0072006D006500200071007500650020006C00270065006E0076006F0069002000640065007300200053004D005300200065007300740020007400E90072006D0069006E00E9+CMGS: 61OK
    14259 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: RECV :0011000B911296564756F30008FF6000410062007300200076006F0075007300200069006E0066006F0072006D006500200071007500650020006C00270065006E0076006F0069002000640065007300200053004D005300200065007300740020007400E90072006D0069006E00E9(26)(cr)+CMGS: 61(cr)OK(cr)
    14274 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager end...
    14384 [NotifyQueueManager] DEBUG smslib  - Running...
    14384 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager running...
    15008 [WatchDog] DEBUG smslib  - Running...
    19282 [QueueManager [modem.com4]] DEBUG smslib  - Running...
    19282 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMMS=2(cr)
    19282 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: BUFFER: AT+CMMS=2OK
    19282 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: RECV :AT+CMMS=2(cr)(cr)OK(cr)
    19282 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: =================================================
    << SmsSubmitPdu >>
    Raw Pdu: 0051000B911296564756F30008FF8C0500035D02010059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020

    SMSC Address: [Length: 0 octets]
    First Octet: 51 [TP-MTI: (SMS-SUBMIT), TP-MMS: (has no messages), TP-RD: (allow duplicates), TP-VPF: (validity format, integer, TP-SRI: (No Status Report), TP-SRR: (No Status Report), TP-UDHI: (has UDH)]
    Message Reference: 00
    Destination Address: [Length: 11 (0B), Type: 81 (10000001), Address: 21696574653]
    TP-PID: 00 (00000000)
    TP-DCS: 08 (UCS2 encoding) (00001000)
    TP-VPF: 10584 hours

    User Data Length: 140 (8C) octets
    User Data (pdu) : 0500035D02010059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020
    User Data Header (pdu) : 0500035D0201
    User Data Header Length: 5 (05) octets

    UDH Information Elements:
    ConcatInformationElement[00, 03, 5D0201][MpRefNo: 93, MpMaxNo: 2, MpSeqNo: 1]

    Non UDH Data (pdu)    : 0059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020
    Non UDH Data (decoded): [YOSRA BENABDELADHIM est absent(e) le =====>:30-03-2016(séance1) en ]
    =================================================

    19282 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: Sending Pdu: 0051000B911296564756F30008FF8C0500035D02010059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020
    19282 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMGS=154(cr)
    19485 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    20499 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :0051000B911296564756F30008FF8C0500035D02010059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020
    21903 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: BUFFER: 0051000B911296564756F30008FF8C0500035D02010059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020+CMGS: 62OK
    21903 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: RECV :0051000B911296564756F30008FF8C0500035D02010059004F005300520041002000420045004E0041004200440045004C0041004400480049004D002000650073007400200061006200730065006E00740028006500290020006C00650020003D003D003D003D003D003E003A00330030002D00300033002D00320030003100360028007300E90061006E006300650031002900200065006E0020(26)(cr)+CMGS: 62(cr)OK(cr)
    21918 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: =================================================
    << SmsSubmitPdu >>
    Raw Pdu: 0051000B911296564756F30008FF680500035D0202006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065

    SMSC Address: [Length: 0 octets]
    First Octet: 51 [TP-MTI: (SMS-SUBMIT), TP-MMS: (has no messages), TP-RD: (allow duplicates), TP-VPF: (validity format, integer, TP-SRI: (No Status Report), TP-SRR: (No Status Report), TP-UDHI: (has UDH)]
    Message Reference: 00
    Destination Address: [Length: 11 (0B), Type: 81 (10000001), Address: 21696574653]
    TP-PID: 00 (00000000)
    TP-DCS: 08 (UCS2 encoding) (00001000)
    TP-VPF: 10584 hours

    User Data Length: 104 (68) octets
    User Data (pdu) : 0500035D0202006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065
    User Data Header (pdu) : 0500035D0202
    User Data Header Length: 5 (05) octets

    UDH Information Elements:
    ConcatInformationElement[00, 03, 5D0202][MpRefNo: 93, MpMaxNo: 2, MpSeqNo: 2]

    Non UDH Data (pdu)    : 006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065
    Non UDH Data (decoded): [matère:Analyse 2 et son absence est non justifiée]
    =================================================

    21918 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: Sending Pdu: 0051000B911296564756F30008FF680500035D0202006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065
    21918 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :AT+CMGS=118(cr)
    22121 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: clearBuffer() called.
    23135 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: SEND :0051000B911296564756F30008FF680500035D0202006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065
    24165 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: BUFFER: 0051000B911296564756F30008FF680500035D0202006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065+CMGS: 63OK
    24180 [QueueManager [modem.com4]] DEBUG smslib  - GTW: modem.com4: RECV :0051000B911296564756F30008FF680500035D0202006D0061007400E800720065003A0041006E0061006C0079007300650020003200200065007400200073006F006E00200061006200730065006E0063006500200065007300740020006E006F006E0020006A00750073007400690066006900E90065(26)(cr)+CMGS: 63(cr)OK(cr)
    24180 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager end...
    24290 [NotifyQueueManager] DEBUG smslib  - Running...
    24290 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager running...
    29188 [QueueManager [modem.com4]] DEBUG smslib  - Running...
    30015 [WatchDog] DEBUG smslib  - Running...
    30062 [CNMIEmulatorProcessor [modem.com4]] DEBUG smslib  - ** disabled **
    32480 [DelayQueueManager] DEBUG smslib  - DelayQueueManager end...
    32683 [WatchDog] DEBUG smslib  - Stopped.
    32683 [AWT-EventQueue-0] INFO smslib  - GTW: modem.com4: Stopping gateway...
    32683 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager end...
    32683 [QueueManager [modem.com4]] DEBUG smslib  - Stopped.
    32683 [KeepAlive [modem.com4]] DEBUG smslib  - Stopped.
    32683 [CNMIEmulatorProcessor [modem.com4]] DEBUG smslib  - Stopped.
    32683 [SMSLib-AsyncNotifier : modem.com4] DEBUG smslib  - GTW: modem.com4: AsyncNotifier thread ended.
    32683 [SMSLib-AsyncMessageProcessor : modem.com4] DEBUG smslib  - GTW: modem.com4: AsyncMessageProcessor thread ended.
    32683 [SMSlib-ModemReader-modem.com4] DEBUG smslib  - GTW: modem.com4: ModemReader thread ended.
    32683 [AWT-EventQueue-0] INFO smslib  - GTW: modem.com4: Closing: COM20 @9600
    32683 [AWT-EventQueue-0] INFO smslib  - GTW: modem.com4: Gateway stopped.
    32792 [NotifyQueueManager] DEBUG smslib  - Running...
    32792 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager running...
    32792 [NotifyQueueManager] DEBUG smslib  - NotifyQueueManager end...
    32885 [NotifyQueueManager] DEBUG smslib  - Stopped.

mars 30, 2016 12:33:01 PM Abs.AjouterAbs jBAbsSMSActionPerformed
INFOS: Exiting application.

the execution of the jar, catch the following exception (see image) exception

port modem

javax.comm.properties:

#
# Drivers loaded by the Java Communications API standard extension
# at initialization time
#
# Format:
#   Each line must contain ONE driver definition only
#   Each line must be of the form:
#           driver=<ClassName>
#       No spaces or tabs in the line.
#       ClassName must implement the interface javax.comm.CommDriver
#           example: driver=Win32Serial
#   
#
# The hash(#) character indicates comment till end of line.
#
# Windows Serial Driver
Driver=com.sun.comm.Win32Driver
  • Please edit your question and add stack trace – Nadeem Shukoor Mar 30 '16 at 10:29
  • what you(Nadeem Shukoor ) said (You have not signed the jar file....) somble most logical especially when I see the "16 [AWT-EventQueue-0] INFO smslib. - Queue directory not defined Queued messages will not be saved to filesystem" in the stack trace. I think my jar is not allowed to write in the partition that contains the system files"c:". I will try to understand how to sign a jar and I'll try that. – Mehdi Dellegi Mar 30 '16 at 11:59
  • I signed the jar as he said Nadeem Shukoor , but it does not always work – Mehdi Dellegi Mar 30 '16 at 12:59
  • Are you using USB Modem to Send SMS ? , If so from Image I see that you can change port Modem. Please change it and check – Nadeem Shukoor Mar 30 '16 at 14:46
  • I tested the port 1 ...21, but it's still the same error – Mehdi Dellegi Mar 30 '16 at 14:59
  • Add the content of javax.comm.properties from both your NetBeans version and your Windows standalone version to your question, obfuscating any connection details that you consider sensitive. Don't obfuscate the port or interface details though. We'll need that to answer your question. – ManoDestra Mar 30 '16 at 15:21
  • Don't change the properties of the modem. It's the javax.comm.properties file that you may have to amend, I suspect. It will almost certainly have the port number defined in there, I think, unless there's another properties file being used in addition to that one. If you post the contents of javax.comm.properties, then hopefully we can fix this very quickly. – ManoDestra Mar 30 '16 at 15:30
  • sorry I did not understand what you mean. you have a link to documentation that you said? – Mehdi Dellegi Mar 30 '16 at 15:33
  • I did not change the properties of the modem, I disconnect the modem and I connect it to another USB port and every time I change the modem connection then the com port changes. I publish javax.com file, you find after the image 2. – Mehdi Dellegi Mar 30 '16 at 15:48
  • Try searching through your application's code to see where the port number is being set when you try to connect. It doesn't appear to be in this properties file. Or there may be some other application properties file where this configuration is being stored. It may help to also see the full stack trace. Ensure that it's being output in your application, so that you can get more detailed info on the exception. – ManoDestra Mar 30 '16 at 16:05
  • here is a part of the console netbeans : 16 [Thread-7] INFO smslib - GTW: modem: Starting gateway, using Generic AT Handler. 16 [Thread-7] INFO smslib - GTW: modem: Opening: **COM8**-9600 47 ....... 47 ........... - Running... 47..... 47 [Thread-7] DEBUG smslib - GTW: modem: ModemReader thread started. .......... 18814................ - GTW: modem: ModemReader thread ended. 18814 [AWT-EventQueue-0] INFO smslib - GTW: modem: Closing: **COM8**- 9600 .....GTW: modem: Gateway stopped. – Mehdi Dellegi Mar 30 '16 at 16:31
  • Can the problem is the **debug mode **SMSlib! remember that my jar to execute well in **netbeans** and in **command prompt**! or I said the silliness! if not how to disable the debug mode? I saw documentation SMSlib and I did not understand how come – Mehdi Dellegi Mar 30 '16 at 16:58
  • finally I found the solution: SMSlib documentation required: If you have a separate JRE directory, do the same copies for the JREDIR directory! I took this remark lightly !! thank you for all – Mehdi Dellegi Mar 31 '16 at 11:25

3 Answers3

1

The exception you're getting is regarding an invalid port. What port does it use for comms when running in NetBeans? And check your properties files when you're running the JAR as a fat jar outside of NetBeans to see what you're setting as the port number. It may simply be empty or an invalid number e.g. "" or -1.

Ports can in the range 0 - 65535. Some are reserved and cannot be used. If you're using two identical ports on the same network interface, then you could run into a port conflict issue. Here's a way to check port issues via netstat.

ManoDestra
  • 6,325
  • 6
  • 26
  • 50
  • it is the same port in netbeans (port com20). – Mehdi Dellegi Mar 30 '16 at 14:11
  • Double check that you're not using the port twice as well. Listening on the same port in NetBeans as well as outside of NetBeans will cause an error. Change the port number to something else outside of NetBeans and see if it works. – ManoDestra Mar 30 '16 at 14:21
  • javax.comm.properties ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ lib javax.comm.properties ==> C: \ Program Files \ Java \ jdk1.7.0_79 \ jre \ lib the jar is always on the same PC that netbeans ! and the javax.comm.properties is like this: # Windows Serial Driver Driver=com.sun.comm.Win32Driver I do not sai if something should chancher? – Mehdi Dellegi Mar 30 '16 at 14:34
  • Your English is somewhat broken. I am not sure of what you're trying to say above. Change the port to a valid port number, such as 9000 and try again. This will eradicate any issues with shared ports or an invalid port range being used. – ManoDestra Mar 30 '16 at 14:36
  • I tested the port 1 ...21, but it's still the same error – Mehdi Dellegi Mar 30 '16 at 14:48
  • sorry my English is poor – Mehdi Dellegi Mar 30 '16 at 14:51
  • port 9000 ! But I only have 256 Port – Mehdi Dellegi Mar 30 '16 at 14:56
  • You're running this JAR on Windows, right? You have 65536 ports, some of which are reserved and cannot be used - https://en.wikipedia.org/wiki/Port_%28computer_networking%29. If you use the same port twice, you're going to run into conflict issues. If you use a reserved port, you will also run into issues. – ManoDestra Mar 30 '16 at 15:05
  • I try with the port "COM9000", but it did not change :same exception ! – Mehdi Dellegi Mar 30 '16 at 15:09
  • That's not your port. That's the network interface. You need to look to see which port is being used, not the interface, the PORT. It's a number in the range 0 - 65535. – ManoDestra Mar 30 '16 at 15:15
  • 1-I stop netbeans 2-I change the modem into a new USB port 3-I look on what COM port is connected (now it gets COM8) 4 I execute my jar with COM8: same problem! – Mehdi Dellegi Mar 30 '16 at 15:19
  • please see the new image to know the modem port, is just? – Mehdi Dellegi Mar 30 '16 at 15:29
  • See my comment above on the question itself. You're changing the modem properties, rather than the application's .properties file. You need to change the application's properties file, which to me looks to be javax.comm.properties. – ManoDestra Mar 30 '16 at 15:31
  • I did not change the properties of the modem, I disconnect the modem and I connect it to another USB port and every time I change the modem connection then the com port changes. I publish javax.com file, you find after the image 2. – Mehdi Dellegi Mar 30 '16 at 15:48
  • Can the problem is the **debug mode **SMSlib! remember that my jar to execute well in **netbeans and in command prompt!** or I said the silliness! if not how to disable the debug mode? I saw documentation SMSlib and I did not understand how come – Mehdi Dellegi Mar 30 '16 at 16:59
  • License restriction on SMSlib perhaps? Don't know. I've ran out of possibilities for you. – ManoDestra Mar 30 '16 at 17:37
  • finally I found the solution: SMSlib documentation required: If you have a separate JRE directory, do the same copies for the JREDIR directory! I took this remark lightly !! thank you for all – Mehdi Dellegi Mar 31 '16 at 11:25
1

finally I found the solution: SMSlib documentation required: If you have a separate JRE directory, do the same copies for the JREDIR directory!

I took this remark lightly !!

thank you for all enter image description here

0

Without stack trace it is hard to tell exactly the Issue, But it should be one of below:

  • You haven't signed the jar file, Please sign your jar file link
  • Missing required depended jar files
Nadeem Shukoor
  • 323
  • 2
  • 4
  • 15