This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 57690 - Adding new jarfile to project libraries hangs NetBeans GUI
Summary: Adding new jarfile to project libraries hangs NetBeans GUI
Status: RESOLVED DUPLICATE of bug 57534
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: Other Windows ME/2000
: P3 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-08 20:02 UTC by cirvine
Modified: 2008-12-23 14:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread Dump from "First Case" attempt to open JInternalFrame form (7.86 KB, text/plain)
2005-04-22 16:47 UTC, mabrown
Details
Thread Dump from "First Case" attempt to open JDialog form (11.31 KB, text/plain)
2005-04-22 16:48 UTC, mabrown
Details
NB log from "First Case" runs (161.71 KB, text/plain)
2005-04-22 16:49 UTC, mabrown
Details
NB log from "Second Case" and "Third Case" runs (96.55 KB, text/plain)
2005-04-22 16:50 UTC, mabrown
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cirvine 2005-04-08 20:02:24 UTC
Adding a new jarfile to project libraries hangs (sometimes only temporarily) 
the NetBeans GUI. Steps to reproduce:
- Invoke "Properties" on project node.
- Add a jarfile for compilation.
- Click "OK" to finish adding jarfile to libraries.

At this point, the NetBeans GUI hangs with a grey space where the properties 
dialog had been. Sometimes the GUI will eventually come back. Sometimes not. I 
don't know whether it's relevant or not, but my project is located on a 
microsoft network directory.
Comment 1 Peter Pis 2005-04-11 12:11:00 UTC
Can you provide more information about the version of jdk and NetBeans, please?
If hang happens , can you attach the message.log? Thanks.
Comment 2 mabrown 2005-04-22 16:45:28 UTC
I also am having problems with a project located on a network drive, in this
case a NetWare volume mapped to a drive letter. These issues (detailed below)
did not occur with NetBeans 4.0.
Software information: NetBeans 4.1 RC 1 with J2SDK 1.4.2_04 on Windows 2000
Professional SP4
Below is the series of attempts I made to open form files with 4.1RC1.
After I post this comment, I will attach the thread dumps I took and the
messages.log files from these attempts.

First case: 
Started NB 4.1RC1 and allowed it to import settings from NB 4.0. At startup, I
received a message window with the title "Warning" and message
"L:\PCT\DEVELOP\RCM\project\nbproject\private\.LCKprivate.properties~". With the
exception of this message, it appeared to work fine, including opening the last
project I'd had open in 4.0. I was able to open source files with no problems,
including right-clicking on a form  and selecting "Edit". However, when I
attempted to switch to the "Design" view, NetBeans displayed the form (and it
looked correct), the "Pallete" (also looking correct), and empty "Properties"
and "Inspector" tabs, then drove CPU usage to 100% and stopped responding
(apparently forever - I allowed it to sit unattended for several minutes).
After killing NetBeans and restarting it, I attempted to open the same form by
double-clicking on it and achieved the same results. After once again killing
NetBeans and restarting it, I attempted to open a different form (with a
different parent class) and achieved the same results.
The first form I attempted to open was a JInternalFrame (actually a subclass of
JInternalFrame that I created and that was present in the source directory with
the form I was attempting to open). The second was a JDialog. In looking at
messages.log, I was able to find exceptions when opening the JInternalFrame but
now when opening the JDialog, but opening either file resulted in the same lock-up.

Second case:
Removed the NB4.1RC1 user directory and did not import settings from 4.0 when
starting for the first time. No warnings or errors on startup. Attempted to open
the project from the first case (with all project-related files on the network
drive). It, of course, complained about unresolved dependencies. I right-clicked
on the project node in the "Projects" tab and selected the menu option to
resolve the problems ("Resolve dependencies" or something similar). It prompted
me to upgrade the project. I agreed and it displayed a message box with
"Warning" as the title and
"L:\PCT\DEVELOP\RCM\project\nbproject\.LCKproject.xml~" as the entire message.
The project was apparently *not* upgraded, because each time I tried to resolve
the dependency issues I would receive the upgrade message.

Third case:
Moved the project directory structure and files (not the source files) to my
local drive and started NetBeans. I was able to open and upgrade the project,
and resolve the dependencies, but when attempting to open forms, I had the same
problem as in the first case (100% CPU usage and nonresponsive NetBeans).

Fourth case:
Moved the source and test files to my local drive, modified private.properties
to point to the new source and test directories, and started NetBeans.
Everything appears to work properly.
Comment 3 mabrown 2005-04-22 16:47:34 UTC
Created attachment 21830 [details]
Thread Dump from "First Case" attempt to open JInternalFrame form
Comment 4 mabrown 2005-04-22 16:48:12 UTC
Created attachment 21831 [details]
Thread Dump from "First Case" attempt to open JDialog form
Comment 5 mabrown 2005-04-22 16:49:36 UTC
Created attachment 21832 [details]
NB log from "First Case" runs
Comment 6 mabrown 2005-04-22 16:50:15 UTC
Created attachment 21833 [details]
NB log from "Second Case" and "Third Case" runs
Comment 7 Roman Strobl 2005-04-26 13:49:09 UTC
Reassigned from ide issues to java/j2seprojects.
Comment 8 Tomas Zezula 2005-04-27 10:48:15 UTC
This does not seem to be a project problem.
Radku, can you evaluate the LCK problem?
Comment 9 rmatous 2005-04-27 16:26:53 UTC
We use java.ni file-locking mechanism. Please, could you evaluate that you are
able to use java.nio.channels.FileLock on your remote L: drive. Write up some
simple program, something like (standalone tiny one class application):

File f = new File
("L:\PCT\DEVELOP\RCM\project\nbproject\private\private.properties");
final RandomAccessFile raf = new RandomAccessFile(f, "rwd");//NOI18N
channel = raf.getChannel();
assert channel.isOpen();
nioLock = channel.tryLock();

Comment 10 mabrown 2005-04-27 17:47:48 UTC
It would appear that I cannot. I took the code you provided and expanded it to
include feedback and to test both a local drive and network (mapped) drive
attempt. Below is the code (which was in a main() method of an otherwise empty
class) and the output.

----------------------------

The code:
File f = new
File("L:\\PCT\\DEVELOP\\RCM\\project\\nbproject\\private\\private.properties");
try {
    final RandomAccessFile raf = new RandomAccessFile(f, "rwd");//NOI18N
    FileChannel channel = raf.getChannel();
    assert channel.isOpen();
    FileLock nioLock = channel.tryLock();
    if(null == nioLock) {
        System.out.println("Attempt to lock on network drive failed with no
exception.");
    } else {
        System.out.println("Attempt to lock on network drive succeeded.
nioLock.toString() contents: " + nioLock.toString());
    }
} catch(FileNotFoundException e) {
    e.printStackTrace();
} catch(IOException e2) {
    e2.printStackTrace();
}

File f2 = new
File("C:\\backups\\RCM\\project\\nbproject\\private\\private.properties");
try {
    final RandomAccessFile raf = new RandomAccessFile(f2, "rwd");//NOI18N
    FileChannel channel = raf.getChannel();
    assert channel.isOpen();
    FileLock nioLock = channel.tryLock();
    if(null == nioLock) {
        System.out.println("Attempt to lock on local drive failed with no
exception.");
    } else {
        System.out.println("Attempt to lock on local drive succeeded.
nioLock.toString() contents: " + nioLock.toString());
    }
} catch(FileNotFoundException e) {
    e.printStackTrace();
} catch(IOException e2) {
    e2.printStackTrace();
}

----------------------------

The output:
run:
Attempt to lock on network drive failed with no exception.
Attempt to lock on local drive succeeded. nioLock.toString() contents:
sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid]
BUILD SUCCESSFUL (total time: 0 seconds)
Comment 11 rmatous 2005-04-28 14:44:07 UTC
Do you have appropriate rights on that network path ?
Comment 12 mabrown 2005-04-28 14:55:45 UTC
Yes, I have the necessary rights to that directory. And I reiterate that I had
no problems of this sort with NB4.0.
I'm also sorry to see that the priority on this defect has been set to a lower
level since failure to fix the problem means that 4.1 is effectively made
unavailable to me and the 3 or 4 people I work with who are currently working
with Java in NB4.0.

Comment 13 rmatous 2005-04-28 15:37:08 UTC
So, from results of the test is obvious that the problem isn't in Netbeans. Then
there might be some specific JDK bug or some problem somwere in your network. 

You can first try JDK 1.5 just in the case there was JDK bug.
You can also try the same simple program (for testing file locking) in C or C++
, compile and see results - then you will know whether this problem is java centric.

If also this program writen in C, C++ will fail then you must ask your admin why
it doesn't work.

You can easily increase priority of this bug again. But I think that the problem
isn't in NB code. 
Comment 14 mabrown 2005-04-29 13:32:34 UTC
I have performed the same test using JDK 1.5.0_02 with the same results. I even
added a third test with a file on a mapped Windows Network drive. The lock
succeeded on that drive but consistently fails on the NetWare drive. The
particularly odd thing is that I achieve the same results (lock failed, no
exception) even if I specify a file name that does not exist.

In any event, it would appear that you're correct and that my problem isn't in
NB itself. Too bad the problem still kills our ability to move forward with NB.

It also may not explain the original reporter's problem since my tests
consistently succeed in achieving a lock on a MS network drive and his problem
was apparently with files on a MS network drive.
Comment 15 rmatous 2005-05-06 08:10:15 UTC
Similar issue (reported on Mac) #57534.
Comment 16 rmatous 2005-09-21 09:53:56 UTC

*** This issue has been marked as a duplicate of 57534 ***
Comment 17 Quality Engineering 2008-12-23 14:22:10 UTC
This issue had *1 votes* before move to platform component