cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 148288 - Unable to Open Project Properties (BPEL) With Created Project
: Unable to Open Project Properties (BPEL) With Created Project
Status: RESOLVED WORKSFORME
: soa
BPEL Project
: 6.1
: All All
: P3 (vote)
: S1S
Assigned To:
:
:
: gfesb_rn_candidate
:
: 150066
:
  Show dependency treegraph
 
Reported: 2008-09-24 21:15 by
Modified: 2010-01-14 04:09 (History)
Issue Type: DEFECT
:


Attachments
Problem description file (42.94 KB, application/x-compressed)
2008-09-24 21:19, rpoon
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-09-24 21:16:06
Build:
    http://caps-dist/gfesb/nightly/20080921-1003

After a BPEL project that was deleted (with ‘Delete Source’ option) and
recreated (creating a new project with the same 
name as the one that has been just deleted), user is unable to open project’s
Properties (disabled).

To recreate:

1)Create a new BPEL project (call it testBPEL1).
2)Once project is created, delete this project (with the ‘Also Delete Sources
..’ option).
3)Notice that the project is deleted and the physical folder of the project is
also deleted.
4)Recreate a new BPEL project with the same name (testBPEL1).

Notice that all options are disable except the ‘New’ and ‘Find’.  User is
unable to edit project’s Properties with this 
problem.

(see attached file for details)
------- Comment #1 From 2008-09-24 21:19:03 -------
Created an attachment (id=70522) [details]
Problem description file
------- Comment #2 From 2008-09-24 21:21:11 -------
BTW, the work around is to shutdown netbeans IDE and restart it again.
------- Comment #3 From 2008-10-06 06:34:33 -------
Nikita, please look at this.
------- Comment #4 From 2008-10-13 20:41:24 -------
I made very deep investigation of the problem. There are a few reasons why it
works wrong. 
I believe I found not all of them. And those I found almost all are located
outside of code I can change now. 
So I suppose there is some possible fix which can be made in our code (BPEL,
SOA, ...), bit unfortunately I haven't
found it. 

1. Comparison to NetBeans 6.5 

At first it turned out that the problem doesn't appear in the NetBeans 6.5 
But eventually I have decided that the NetBeans 6.5 also have the same
problems. 
I didn't manage to understand what is the difference between 6.5 and 6.1
regarding this issue. 
It works some magic way. :-) 

2. Changes to BpelDataObject

I tried comparing some files between 6.5 and 6.1 branches and found that the
method BpelDataObject.getLookup() 
has some simplifications in the 6.5 version. The method contain lookup
initialization for BPEL editor. 
It seems in the old version it has some redundant items. But removing of them
didn't resolve the problem. 

3. Problems in the org.netbeans.modules.project.ui.actions.ActionsUtil

It has the method getProjectsFromLookup(). Just this method is the first reason
of the issue. 
I think it has a workaround. It tries looking up the Project classes in the
lookup first. Then 
it tries looking up DataObject classes and extract the Project from them.
Obviously some of these ways is redundant. 
It doesn't lead to any problem in most cases because the both methods return
the same Project. 
But in our case the method return 2 projects. Actually it is the same project
but 2 different Java objects. 
So the Projects' view pop-up menu looks like 2 projects are selected. Also it
is easy to note because of the 
menu item "Close 2 Projects". 
2 different projects are added to a HashSet. They are not recognized as the
same because of the Project doesn't have 
the equals() and hashCode() methods. So they are considered as different
Projects. 
I suppose adding these methods could help. As the smallest workaround such
methods can be redefined in the
BpelproProject class only. 


4. ProjectManager - feature or bag? 


The ProjectManager is caching opened projects. Also it should prevent creating
project duplicates. But actually it
doesn't prevent. It holds the projects in the HashMap with FileObject as a key.
The FileObject doesn't redefine the
equals() and hashCode() functions. So two different instances of FileObject
referencing to the same project folder,
comes to creation of 2 different Project instances. It is the actual reason why
the ActionsUtil get 2 Projects. 
Changes to FileObject and BaseFileObj can help resolve this problem. 
------- Comment #5 From 2008-10-14 15:21:34 -------
I tried add equals() and hashCode() functions to BpelproProject but it didn't
help. Another exception appears 
instead:
org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState()
: line 559.
IllegalStateException("Cannot generate build script from a modified project");
It appears while creating a new project after deleting once with the same name. 

So the result is the issue depends on #150066
------- Comment #6 From 2008-10-15 10:40:53 -------
Candidate for RNs. Since it depends on NB core issue marked as WONTFIX. Nikita
is there any workaround ?
------- Comment #7 From 2008-10-15 12:59:45 -------
the most likely cause of the issue in bpel project is similar to what was
happening in swing app projhect template in
issue http://www.netbeans.org/issues/show_bug.cgi?id=129405.
http://hg.netbeans.org/main/rev/e150f0d43ac6

or your delete project implementation is not calling back to the ProjectManager
via ProjectState..
------- Comment #8 From 2008-10-16 00:23:12 -------
I tried applying similar changes like in the recommended issue #129405, but it
didn't help. 
Also I have found that there is absolutely same problem with XSLT project. No
wonder because it was cloned from BPEL
project. I tried another kinds of projects, but they work well. 

I think we need stop spending time on this issue for a while because of it very
difficult to fix and the problem is not
so painful. Anyway, user can restart NetBeans to recover. The issue is
difficult because it require good understanding
of different parts of source code. I spent about 3 days already and it can take
3 days more to find the real reason. 
------- Comment #9 From 2008-10-16 04:18:28 -------
I'm wonder why this problem appears again. 
The similar issue was filled and fixed about year ago:
http://www.netbeans.org/issues/show_bug.cgi?id=108531

Perhaps the ProjectManager had been change. I'll look at it.
Early it was reproducable also with some other projects: sql, uml, compapp... 
------- Comment #10 From 2008-10-20 10:35:27 -------
Decreasing priotrity to P3. Bug is not reproducible in NB 6.5. So most probably
will not fix it.
------- Comment #11 From 2008-10-29 14:58:55 -------
*** Issue 150431 has been marked as a duplicate of this issue. ***
------- Comment #12 From 2010-01-14 04:09:49 -------
Is not reproducible in GF ESB v2.2