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 87550 - Sometimes BPEL Project can not be saved
Summary: Sometimes BPEL Project can not be saved
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Zgursky
URL:
Keywords: RELNOTE
: 97689 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-19 17:28 UTC by Andrey Yamkovoy
Modified: 2007-09-03 13:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception from IDE log (2.29 KB, text/plain)
2006-10-19 17:29 UTC, Andrey Yamkovoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Yamkovoy 2006-10-19 17:28:17 UTC
This bug was reproduced on 3 machines (2 WinXP and 1 Solaris Sparc).
Sometimes it's need to create several projects and bpel's in a row to reproduce 
this bug ...

Steps to reproduce:
- Create new bpel project.
- Create new bpel process in project.
- Open bpel and add some activity to process.
- Invoke Save All action.
- Information dialog with message "Cannot save newProcess" appears.
- Also exception appears in IDE log (see attach).
Comment 1 Andrey Yamkovoy 2006-10-19 17:29:03 UTC
Created attachment 35392 [details]
Exception from IDE log
Comment 2 Vitaly Bychkov 2006-10-20 10:26:04 UTC
next scenario always reproducable for me: (WinXP)

- Create new bpel project
- Create new bpel process in project
- add some activities to the process
!!! don't save the changes

- Create another new bpel project
- Create new bpel process in project
- add some activities to the process
!!! don't save the changes

result: there is two opened unsaved processes from different projects
- invoke Save All action
- Information dialog with message "Cannot save newProcess" appears.
Comment 3 Nikita Krjukov 2006-10-20 10:55:22 UTC
I tryid to analize the stack trace and found suspecious part of code.
I removed all not important lines!
org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport;
method: addResource(...)

    boolean isInUse = true;        

    for (int i = 0; i < 10 && isInUse; i++) {
        isInUse = unexpectedCounter != null && unexpectedCounter.size() > 0;

        if (isInUse) {
            wait(200);
        }
    }

    if (isInUse) {
        FSException.io("EXC_CannotGetExclusiveAccess", key.toString());
    }

So the method tries to get exclusive access to the file 10 times 
and does a 200ms timout ofter each attempt. 
It turned out that maximum delay can be 2 seconds. 

So it seems the exception will appear if: 
-- the file with the BPEL process is locked by other IO activity for more then 
2 seconds.
-- the CPU is occupied highly with some other task.

Comment 4 Denis Anisimov 2006-10-20 11:07:26 UTC
It is almost obvious that someone other perform lock on file object and didn't
release it. The problem is in determening who previously obtianed this lock. And
why it was not released.
Comment 5 Denis Anisimov 2006-10-27 11:51:20 UTC
It is noticed that problem appears due mapper presence.
Issue cannot be reproduced if mapper is disabled.

So problem is in the mapper.
Comment 6 Sergey Lunegov 2007-02-14 13:15:09 UTC
The fix for this particular issue should be part of overall change how BPEL
mapper  works with BPEL OM. And fix only for this particular issue can cause
side effect.
Will be fixed by FCS.
Comment 7 astashkova 2007-02-16 15:26:36 UTC
Added to staged NB Enterprise Release Notes 5.5.1 Beta
(http://nbstaging.czech.sun.com/community/releases/55/1/entpack_relnotes.html#87550)
Comment 8 Alexei Mokeev 2007-03-05 17:27:33 UTC
Removed Beta EP551_WAIVER_APPROVED keyword - we are going forward to FCS.
Comment 9 Alexander Zgursky 2007-04-22 17:32:58 UTC
Was able to reproduce it without a mapper being opened at the time of the Save
action. Although, the Mapper was opened for some time before I tried to Save.

Also, I used to be able to reproduce the issue 100% by following lativ's recipe,
but now it's really difficult to reproduce (I've created about 30 projects by
following the recipe and the bug reproduced just twice).
Comment 10 Alexander Zgursky 2007-04-22 17:39:47 UTC
*** Issue 97689 has been marked as a duplicate of this issue. ***
Comment 11 Alexander Zgursky 2007-07-06 11:18:07 UTC
OK, the problem is that in some places in the code there is a call to FileObject.getInputStream() and that input stream
is not explicitly closed. It gets closed later as a part of garbage collecting (there is a call to close() in
finalize()), but until then the file is locked for writing and thus user can not save the file.
Comment 12 Alexander Zgursky 2007-07-06 11:22:22 UTC
Fixed in trunk:

Checking in samples/src/org/netbeans/modules/bpel/samples/SoaSampleUtils.java;
/cvs/enterprise/bpel/samples/src/org/netbeans/modules/bpel/samples/SoaSampleUtils.java,v  <--  SoaSampleUtils.java
new revision: 1.6; previous revision: 1.5
done
Checking in project/src/org/netbeans/modules/bpel/project/BpelproProjectGenerator.java;
/cvs/enterprise/bpel/project/src/org/netbeans/modules/bpel/project/BpelproProjectGenerator.java,v  <-- 
BpelproProjectGenerator.java
new revision: 1.8; previous revision: 1.7
done
Checking in core/src/org/netbeans/modules/bpel/core/wizard/NewBpelFileIterator.java;
/cvs/enterprise/bpel/core/src/org/netbeans/modules/bpel/core/wizard/NewBpelFileIterator.java,v  <-- 
NewBpelFileIterator.java
new revision: 1.5; previous revision: 1.4
done
Comment 13 Andrei Chistiakov 2007-09-03 13:51:41 UTC
Verified in build 200709021200.