Note that there are some explanatory texts on larger screens.

plurals
  1. POa Java application works fine on Eclipse but it doesn't work properly after being deployed as a runnable jar
    primarykey
    data
    text
    <p>Like the tile said, my Java application doesn't work as it works fine while developing on Eclipse.</p> <p>I finished to build and test my application on Eclipse. It works fine as I expected. I needed to deploy it as a runnable jar so that my client can't use it on their system. I made it a runnable jar through exporting it on Eclipse. When I run the runnable jar, the application starts to work fine for a while and stops on file reading. I haven't had any problem with it on the same code on Eclipse.</p> <p>The source snippet that seems not to work is the following.</p> <pre><code> sfis = new SmbFileInputStream(sFile); in = new BufferedInputStream(sfis); byte buf[] = new byte[(int)sFile.length()]; int pos = 0; int size = 10; int temp; while((size=in.read(buf, pos, size)) &gt; 0){ pos += size; temp = buf.length - pos; if(temp &lt; 10){ size = temp; } } </code></pre> <p>On Eclipse it doesn't cause any problem. It perfectly reads data from SMB connection and finishes its job. But from the jar application, it seems to stop reading from inputstream inside while loop at some point. This is a very strange case that I have never experienced before. And I can't find any solution for this.</p> <p>Is this because of my code or the jar file that might be wrongly made by Eclipse?</p> <p>---------- additional info -------------------</p> <p>With a big help from Edmondo1984, I find out where the jar program stops. When it goes to inputstream from SmbFile, a new thread jcifs.util.transport.Transport is created and the thread is simply blocked and the application creates another jcifs.util.transport.Transport, and so on. After creating 8 or 9 jcifs.util.transport.Transport thread, it is being stuck and doing nothing.</p> <p>The same code, the same jcifs library. But works differently between running on Eclipse and on local machine as a runnable jar. I have no idea why this is happening. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload