Results 1 to 5 of 5
  1. #1
    TijVoe is offline Member
    Join Date
    Oct 2012
    Location
    Herselt, Belgium
    Posts
    3
    Rep Power
    0

    Question Application only works when executed from netbeans

    Main class initialises and starts 3 Threads :
    • ScannerListener(implements java.lang.Runnable, javax.comm.SerialPortEventListener )
      • listens for data recieved on the com-port connected to a network of barcode scanners.
    • ClientListener(implements runnable)
      • listens for incomming connections (Java.net.Socket) and creates Client-objects.
    • DatabaseListener(implements runnable)
      • Polls a database and sends data to Clients.

    Initialisation:
    Java Code:
    scScannerListener = new ScannerListener("COM1", 9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
    scScannerListener.addEventListener(this);
    
    clClientListener = new ClientListener(63009);
    clClientListener.addEventListener(this);
    
    dlDatabaseListener = new DatabaseListener(DatabaseConnection.getConnection());
    dlDatabaseListener.addEventListener(this); 
    
    new Thread(scScannerListener, "Scanner Listener").start();
    new Thread(clClientListener, "Client Listener").start();
    new Thread(dlDatabaseListener, "Database Listener").start();
    Now, as mentioned in the title, my application only works when runned from Netbeans. When the code is runned by executing myapp.jar, the application wont work. More specific: ScannerListener-Thread doesnt seem to be running at all. Note that are no errors thrown of any kind, and I've been able to confirm the execution of the 2 other Threads.

    Does anyone have a clue whats going on here ?
    If more information is needed, dont hesitate to ask.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: Application only works when executed from netbeans

    You are using a third party library for serial port communication (RXTX? JavaComm?); is the .jar file on the classpath? i.e. do you have a manifest with the following line in it?

    Java Code:
    Class-Path: YourCommLibrary.jar
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    TijVoe is offline Member
    Join Date
    Oct 2012
    Location
    Herselt, Belgium
    Posts
    3
    Rep Power
    0

    Default Re: Application only works when executed from netbeans

    is the .jar file on the classpath? i.e. do you have a manifest with the following line in it?
    javaxcomm\comm.jar is added to compile-time libraries and run-time libraries. Isn't that enough ?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Application only works when executed from netbeans

    Did you read the README.TXT that NetBeans creates in the dist folder?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    TijVoe is offline Member
    Join Date
    Oct 2012
    Location
    Herselt, Belgium
    Posts
    3
    Rep Power
    0

    Default Re: Application only works when executed from netbeans

    Problem solved.
    I forgot to copy win32com.dll to windows\system32

Similar Threads

  1. Code compiles but fails to run (works in NetBeans)
    By swilliams236 in forum New To Java
    Replies: 2
    Last Post: 11-07-2011, 10:05 PM
  2. Replies: 3
    Last Post: 05-02-2011, 09:02 PM
  3. Works within Netbeans, not in browser though
    By Ambergahill in forum New To Java
    Replies: 0
    Last Post: 11-27-2010, 06:46 PM
  4. Replies: 3
    Last Post: 04-15-2010, 03:41 AM
  5. Replies: 0
    Last Post: 10-06-2009, 12:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •