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 157538 - IllegalStateException: Current thread has already started a transaction
Summary: IllegalStateException: Current thread has already started a transaction
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milos Kleint
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-28 11:20 UTC by arsatyants
Modified: 2009-09-09 15:35 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 143983


Attachments
stacktrace (2.78 KB, text/plain)
2009-01-28 11:20 UTC, arsatyants
Details
stacktrace (3.41 KB, text/plain)
2009-07-02 10:31 UTC, neilg
Details
stacktrace (3.41 KB, text/plain)
2009-07-10 09:38 UTC, neilg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arsatyants 2009-01-28 11:20:30 UTC
Build: NetBeans IDE Dev (Build 200812180001)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Windows XP, 5.1, x86

User Comments:
jonycus: Ma gonite se u trista picke materine



Stacktrace: 
java.lang.IllegalStateException: Current thread has already started a transaction
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:346)
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:341)
        at org.netbeans.modules.maven.api.customizer.ModelHandle.<init>(ModelHandle.java:124)
        at org.netbeans.modules.maven.api.customizer.ModelHandle.<init>(ModelHandle.java:68)
        at org.netbeans.modules.maven.api.customizer.ModelHandle$AccessorImpl.createHandle(ModelHandle.java:108)
        at org.netbeans.modules.maven.spi.customizer.ModelHandleUtils.createModelHandle(ModelHandleUtils.java:90)
Comment 1 arsatyants 2009-01-28 11:20:39 UTC
Created attachment 76292 [details]
stacktrace
Comment 2 neilg 2009-07-02 10:30:57 UTC
Build: NetBeans IDE 6.7 (Build 200906241340)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.28-13-generic, amd64

User Comments: 
Selected "Properties" from the context menu on a maven webapp

Stacktrace: 
java.lang.IllegalStateException: Current thread has already started a transaction
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:346)
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:341)
        at org.netbeans.modules.maven.api.customizer.ModelHandle.<init>(ModelHandle.java:124)
        at org.netbeans.modules.maven.api.customizer.ModelHandle.<init>(ModelHandle.java:68)
        at org.netbeans.modules.maven.api.customizer.ModelHandle$AccessorImpl.createHandle(ModelHandle.java:108)
        at org.netbeans.modules.maven.customizer.CustomizerProviderImpl.init(CustomizerProviderImpl.java:243)
Comment 3 neilg 2009-07-02 10:31:02 UTC
Created attachment 84291 [details]
stacktrace
Comment 4 Exceptions Reporter 2009-07-02 10:31:21 UTC
This issue already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=143983
Comment 5 Exceptions Reporter 2009-07-09 23:59:40 UTC
This issue already has 21 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=143983
Comment 6 neilg 2009-07-10 09:38:44 UTC
Build: NetBeans IDE 6.7 (Build 200906241340)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.28-13-generic, amd64

User Comments: 


Stacktrace: 
java.lang.IllegalStateException: Current thread has already started a transaction
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:346)
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:341)
        at org.netbeans.modules.maven.api.customizer.ModelHandle.<init>(ModelHandle.java:124)
        at org.netbeans.modules.maven.api.customizer.ModelHandle.<init>(ModelHandle.java:68)
        at org.netbeans.modules.maven.api.customizer.ModelHandle$AccessorImpl.createHandle(ModelHandle.java:108)
        at org.netbeans.modules.maven.customizer.CustomizerProviderImpl.init(CustomizerProviderImpl.java:243)
Comment 7 neilg 2009-07-10 09:38:49 UTC
Created attachment 84578 [details]
stacktrace
Comment 8 Exceptions Reporter 2009-07-10 09:38:55 UTC
This issue already has 22 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=143983
Comment 9 neilg 2009-07-10 09:51:01 UTC
This issue is easily repeatable. Right click on a maven project in the projects view, select properties from the context
menu. Once the properties dialog box is open, right click again on the same project and choose properties again.
Comment 10 Sergey Lunegov 2009-07-15 15:14:17 UTC
Alex, please take a look.
Comment 11 _ alexpetrov 2009-07-15 17:56:38 UTC
This issue has been reassigned to the "maven" module due to the following reason.

An IllegalStateException is thrown because the constructor ModelHandle(...)
(maven/src/org/netbeans/modules/maven/api/customizer/ModelHandle.java) contains statements:
    private ModelHandle(POMModel mdl, ProfilesModel profile, MavenProject proj,
                        Map<String, ActionToGoalMapping> mappings,
                        List<Configuration> configs, Configuration active,
                        MavenProjectPropsImpl auxProps) {
        model = mdl;
        model.startTransaction();
        ................................................................................
    }

When this constructor is invoked for the 2nd time (see the last scenario for reproducing of the bug from "neilg" Fri Jul
10 08:51:01), the previous transaction has been started already and has not been finished yet.

The class "org.netbeans.modules.xml.xam.AbstractModel" contains the method "isIntransaction()" which allows to check
whether a transaction initialized already or not.

So, before starting of a new transaction the constructor "ModelHandle" should invoke the method
"model.isIntransaction()" or use "try-catch" for handling an IllegalStateException.
Comment 12 Milos Kleint 2009-07-16 08:27:33 UTC
the dialog has to be modal, I've always thought it is.. :(
http://hg.netbeans.org/main/rev/ca35534e4f25
Comment 13 Quality Engineering 2009-07-16 17:40:15 UTC
Integrated into 'main-golden', will be available in build *200907161401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ca35534e4f25
User: Milos Kleint <mkleint@netbeans.org>
Log: #157538 the project properties dialog has to be modal
Comment 14 Jaroslav Pospisil 2009-09-09 15:35:03 UTC
v.