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 155010 - IllegalStateException: Cannot generate build scripts from a modified project
Summary: IllegalStateException: Cannot generate build scripts from a modified project
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
: 154723 213488 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-09 10:19 UTC by Marian Mirilovic
Modified: 2012-06-04 22:12 UTC (History)
24 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 132871


Attachments
stacktrace (1.53 KB, text/plain)
2009-02-27 16:39 UTC, Oleg Khokhlov
Details
stacktrace (1.18 KB, text/plain)
2009-04-08 19:27 UTC, chronosmark
Details
stacktrace (1.92 KB, text/plain)
2009-04-21 07:03 UTC, saeed_z_f
Details
stacktrace (1.18 KB, text/plain)
2009-04-28 16:03 UTC, dakala
Details
stacktrace (3.97 KB, text/plain)
2009-05-06 15:45 UTC, swpalmer
Details
stacktrace (4.31 KB, text/plain)
2009-05-06 15:52 UTC, ranbato
Details
stacktrace (4.31 KB, text/plain)
2009-05-06 21:13 UTC, ranbato
Details
stacktrace (3.97 KB, text/plain)
2009-05-13 10:55 UTC, dakala
Details
project that trips the issue (16.89 KB, application/x-compressed)
2009-05-15 14:52 UTC, akochnev
Details
stacktrace (3.53 KB, text/plain)
2009-05-27 15:44 UTC, swpalmer
Details
Sources of module to produce this exception artificially (5.11 KB, application/x-compressed)
2009-07-02 23:51 UTC, Jesse Glick
Details
stacktrace (1.18 KB, text/plain)
2009-08-16 11:56 UTC, mohhmekk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2008-12-09 10:19:00 UTC
16 duplicates so far ...

Build: NetBeans IDE 6.5 RC1 (Build 200810171318)
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: attempting to remove bad/old project reference from project library run jar list.
STACKTRACE: (first 10 lines)
java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$.run(GeneratedFilesHelper.java:559)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$.run(GeneratedFilesHelper.java:557)
        at org.openide.util.Mutex.readAccess(Mutex.java:327)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState(GeneratedFilesHelper.java:556)
        at
org.netbeans.modules.java.jseproject.ui.customizer.JSEProjectProperties.checkModified(JSEProjectProperties.java:443)
        at
org.netbeans.modules.java.jseproject.ui.customizer.CustomizerProviderImpl$OptionListener.actionPerformed(CustomizerProviderImpl.java:176)
        at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$.run(CustomizerDialog.java:213)
        at org.openide.util.Mutex.writeAccess(Mutex.java:394)
        at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.actionPerformed(CustomizerDialog.java:211)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:0)
Comment 1 Oleg Khokhlov 2009-02-27 16:39:08 UTC
Build: NetBeans IDE Dev (Build 200902231401)
VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows XP, 5.1, x86

User Comments: 
web project reopened

Stacktrace: 
java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:579)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:576)
        at org.openide.util.Mutex.readAccess(Mutex.java:327)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState(GeneratedFilesHelper.java:576)
        at org.netbeans.modules.web.project.WebProject$ProjectOpenedHookImpl.projectOpened(WebProject.java:855)
        at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:81)
Comment 2 Oleg Khokhlov 2009-02-27 16:39:12 UTC
Created attachment 77480 [details]
stacktrace
Comment 3 chronosmark 2009-04-08 19:26:53 UTC
Build: NetBeans IDE Dev (Build 200904070200)
VM: Java HotSpot(TM) Client VM, 1.6.0-b105, Java(TM) SE Runtime Environment, 1.6.0-b105
OS: Windows XP, 5.1, x86

User Comments: 
Attempting to enable compile on save in project

Stacktrace: 
java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:579)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:576)
        at org.openide.util.Mutex.readAccess(Mutex.java:327)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState(GeneratedFilesHelper.java:576)
        at org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties.save(J2SEProjectProperties.java:402)
        at org.netbeans.modules.java.j2seproject.ui.customizer.CustomizerProviderImpl$StoreListener.actionPerformed(CustomizerProviderImpl.java:160)
Comment 4 chronosmark 2009-04-08 19:27:02 UTC
Created attachment 79767 [details]
stacktrace
Comment 5 saeed_z_f 2009-04-21 07:03:03 UTC
Build: NetBeans IDE Dev (Build 200904011705)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 
I import an eclipse project and then when i want to open it occur this error.

Stacktrace: 
java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:579)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:576)
        at org.openide.util.Mutex.readAccess(Mutex.java:327)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState(GeneratedFilesHelper.java:576)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$3.run(GeneratedFilesHelper.java:804)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$3.run(GeneratedFilesHelper.java:802)
Comment 6 saeed_z_f 2009-04-21 07:03:12 UTC
Created attachment 80557 [details]
stacktrace
Comment 7 dakala 2009-04-28 16:03:17 UTC
Build: NetBeans IDE 6.7 Beta (Build 200904242137)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05, Java(TM) SE Runtime Environment, 1.6.0_02-b05
OS: Linux, 2.6.18-92.1.6.el5.centos.plusxen, i386

User Comments: 
I edited the project properties (right click Project icon > Properties > Run) - changed the Arguments for my Main class - and clicked "Ok"

Stacktrace: 
java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:579)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:576)
        at org.openide.util.Mutex.readAccess(Mutex.java:327)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState(GeneratedFilesHelper.java:576)
        at org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties.save(J2SEProjectProperties.java:402)
        at org.netbeans.modules.java.j2seproject.ui.customizer.CustomizerProviderImpl$StoreListener.actionPerformed(CustomizerProviderImpl.java:160)
Comment 8 dakala 2009-04-28 16:03:27 UTC
Created attachment 81095 [details]
stacktrace
Comment 9 swpalmer 2009-05-06 15:45:53 UTC
Build: NetBeans IDE Dev (Build 200905051401)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

User Comments: 
Loaded an old project.. it complained about a reference to junit and junit_4..   I went to the project properties and saw junit3.8.2 and junit4.5 libraries were there... I tried to remove the junit3.8.2 library and got this error	

Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed: java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.openide.util.RequestProcessor$Item.fillInStackTrace(RequestProcessor.java:853)
        at java.lang.Throwable.<init>(Throwable.java:181)
        at java.lang.Exception.<init>(Exception.java:29)
        at org.openide.util.RequestProcessor$Item.<init>(RequestProcessor.java:819)
        at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:629)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:295)
Comment 10 swpalmer 2009-05-06 15:45:57 UTC
Created attachment 81662 [details]
stacktrace
Comment 11 ranbato 2009-05-06 15:51:50 UTC
Build: NetBeans IDE Dev (Build 200905051401)
VM: Java HotSpot(TM) Client VM, 14.0-b13, Java(TM) SE Runtime Environment, 1.6.0_14-ea-b04
OS: Windows XP, 5.1, x86

User Comments: 
Trying to fix libs.CopyLibs.classpath property is not set up error after importing project from beta


Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed: java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.openide.util.RequestProcessor$Item.fillInStackTrace(RequestProcessor.java:853)
        at java.lang.Throwable.<init>(Throwable.java:181)
        at java.lang.Exception.<init>(Exception.java:29)
        at org.openide.util.RequestProcessor$Item.<init>(RequestProcessor.java:819)
        at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:629)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:295)
Comment 12 ranbato 2009-05-06 15:52:00 UTC
Created attachment 81666 [details]
stacktrace
Comment 13 swpalmer 2009-05-06 16:05:17 UTC
When I open some old projects I now get reference errors related to JUnit. The project shows JUnit 3.8.2 and Junit 4.5 
under “Test Libraries” but it shows in red with reference problems.  Choosing “Resolve Reference Problems…” it shows me 
to libraries that can’t be found “junit” and “junit_4”.  When I went to the project properties and tried to remove the 
JUnit 3.8.2 library that was there it threw an exception (reported as #199582) claimed as a duplicate of 
http://statistics.netbeans.org/analytics/detail.do?id=132871


I closed the offending project but when I tried to re-open it I get the same error. 
The I exited NB (200905051401) and when I opened the project it no-longer had reference problems.

Comment 14 ranbato 2009-05-06 21:13:43 UTC
Build: NetBeans IDE Dev (Build 200905051401)
VM: Java HotSpot(TM) Client VM, 14.0-b13, Java(TM) SE Runtime Environment, 1.6.0_14-ea-b04
OS: Windows XP, 5.1, x86

User Comments: 
Changing main class in a j2ee client application

Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed: java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.openide.util.RequestProcessor$Item.fillInStackTrace(RequestProcessor.java:853)
        at java.lang.Throwable.<init>(Throwable.java:181)
        at java.lang.Exception.<init>(Exception.java:29)
        at org.openide.util.RequestProcessor$Item.<init>(RequestProcessor.java:819)
        at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:629)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:295)
Comment 15 ranbato 2009-05-06 21:13:53 UTC
Created attachment 81689 [details]
stacktrace
Comment 16 dakala 2009-05-13 10:55:34 UTC
Build: NetBeans IDE Dev (Build 200905121401)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05, Java(TM) SE Runtime Environment, 1.6.0_02-b05
OS: Linux, 2.6.18-92.1.6.el5.centos.plusxen, i386

User Comments: 


Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed: java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.openide.util.RequestProcessor$Item.fillInStackTrace(RequestProcessor.java:853)
        at java.lang.Throwable.<init>(Throwable.java:181)
        at java.lang.Exception.<init>(Exception.java:29)
        at org.openide.util.RequestProcessor$Item.<init>(RequestProcessor.java:819)
        at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:629)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:295)
Comment 17 dakala 2009-05-13 10:55:41 UTC
Created attachment 82028 [details]
stacktrace
Comment 18 Milan Kubec 2009-05-15 14:22:09 UTC
Is anybody able to reliably reproduce this issue? Without reproducible test case it's very difficult to fix.
Comment 19 akochnev 2009-05-15 14:50:35 UTC
Attached is a sample project that trips this behavior for me every time. This project was generated by the Eclipse
Project Importer, it throws an exception when the project is being generated. After the project is generated (there is a
nbproject directory in the project), when I try to open the project in NetBeans this exception is thrown every time. 

I suspect that this issue has something to do w/ timestamps on the files, thus, there is a chance that you might not be
able to reproduce it with the provided sample project. When I take this same project and copy it to a different
directory (presumably, the timestamps will change on files), then I'm able to open the project with no issues. Yet, if
you inspect the timestamps on the files in the zip, that might be helpful in identifying the issue. 

Comment 20 akochnev 2009-05-15 14:52:09 UTC
Created attachment 82197 [details]
project that trips the issue
Comment 21 Milan Kubec 2009-05-15 15:02:56 UTC
As you correctly anticipated I'm not able to reproduce with attached project, I will check those timestamps, but I doubt
it's related to them. It's more threading related problem.
Comment 22 akochnev 2009-05-18 19:58:30 UTC
Indeed, it does look very much like a threading issue. The reason I did mention time stamps is that this is the only
difference between the project causing the issue and the one that doesn't (e.g. unzipping this project into a new
directory stops the behavior). It seems like a particular timestamp on a file causes NB to try to regenerate the
build-impl while something else is holding the lock. 

Anyway, from the other stack traces it's obvious that other issues trip this problem as well, so the root cause is not
in the timestamps. 
Comment 23 swpalmer 2009-05-27 15:44:31 UTC
Build: NetBeans IDE Dev (Build 200905270201)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

User Comments: 
Opened a NB6.5 JavaSE project.. tried to run a file in it.. failed because the working directory was not valid.  Changed the working directory via project properties.  Tried again... NB failed to find build-impl.xml.. instead I saw a "build-impl.xml~" file it it's place, the original had been deleted (subversion showed this).  I reverted the changes with subversion (external to the IDE).. Tried again... but the old, invalid working directory was back... tried to change it again via project properties and this happned

Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed due to: java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:267)
        at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.actionPerformed(CustomizerDialog.java:270)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
Comment 24 swpalmer 2009-05-27 15:44:37 UTC
Created attachment 82867 [details]
stacktrace
Comment 25 Milan Kubec 2009-06-26 15:00:21 UTC
Anybody able to reproduce the issue?
Comment 26 Jesse Glick 2009-07-02 23:51:31 UTC
Created attachment 84322 [details]
Sources of module to produce this exception artificially
Comment 27 Jesse Glick 2009-07-02 23:57:38 UTC
It is easy to produce the exception using a module which intentionally modifies project.xml (without saving it) every
few seconds - attached. Whether there is some module which is actually doing that, I have no idea.

Anyway, I am adding some diagnostics in core-main #f5aca42c4766 so that if it occurs again in a dev build we will get a
stack trace for the code which actually modified project.xml. If my suspicion is correct that this is just some random
module modifying project.xml, then one fix is simply to make sure that module saves the project immediately.

We could also just stop throwing ISE and let build-impl.xml be regenerated even though there are in-memory changes to
project.xml which might be relevant to its contents. (The API specifies that ISE will be thrown, but I guess it is not
much of an incompatibility to cease doing so.) It is likely that the changes are not in fact relevant to build-impl.xml,
so this might be an acceptable workaround, but I would like to get some diagnostics first to make sure we understand
what is happening and why.
Comment 28 Milan Kubec 2009-07-03 14:25:19 UTC
Jesse, do you think it's worth to put this patch to 6.7.1. I'd say so.
Comment 29 Quality Engineering 2009-07-03 17:37:34 UTC
Integrated into 'main-golden', will be available in build *200907031400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f5aca42c4766
User: Jesse Glick <jglick@netbeans.org>
Log: Diagnostics for #155010: ISE when project.xml is modified in memory and build-impl.xml is to be regenerated.
Comment 30 Jesse Glick 2009-07-06 18:30:32 UTC
Well it's not really a fix, just diagnostics. I would like to get some information about the problem before recommending
anything be pushed into 6.7.x. Judging by the number of duplicates I would expect a dev build user to hit this sometime
soon.
Comment 31 Marian Mirilovic 2009-07-09 09:39:00 UTC
108 duplicates ... P2 (at least) ... candidate for NB 6.7 patch (not for Patch1)
Comment 32 Jesse Glick 2009-07-22 18:08:47 UTC
Now just logging the ISE at INFO. Will still capture information about why project.xml was modified, but this will not
be sent to the exception reporter. (It is a potential problem if modules are making modifications but never asking to
save them, so this should be logged somehow.) Also attempting to save the modifications before regenerating
build-impl.xml. Verified behavior against test module, though this may not be representative of the actual situations
people have encountered. core-main #de915f74a7bf (builds on top of f5aca42c4766)
Comment 33 Quality Engineering 2009-07-23 17:48:55 UTC
Integrated into 'main-golden', will be available in build *200907231401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/de915f74a7bf
User: Jesse Glick <jglick@netbeans.org>
Log: #155010: behave more robustly w.r.t. unsaved modifications of project.xml.
Comment 34 mohhmekk 2009-08-16 11:55:58 UTC
Build: NetBeans IDE 6.7.1 (Build 200907230233)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Linux, 2.6.28-15-generic, i386

User Comments: 


Stacktrace: 
java.lang.IllegalStateException: Cannot generate build scripts from a modified project
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:579)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$2.run(GeneratedFilesHelper.java:576)
        at org.openide.util.Mutex.readAccess(Mutex.java:327)
        at org.netbeans.spi.project.support.ant.GeneratedFilesHelper.getBuildScriptState(GeneratedFilesHelper.java:576)
        at org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties.save(J2SEProjectProperties.java:402)
        at org.netbeans.modules.java.j2seproject.ui.customizer.CustomizerProviderImpl$StoreListener.actionPerformed(CustomizerProviderImpl.java:160)
Comment 35 mohhmekk 2009-08-16 11:56:06 UTC
Created attachment 86280 [details]
stacktrace
Comment 36 Marian Mirilovic 2010-04-22 10:42:23 UTC
v/c
Comment 37 Jesse Glick 2010-05-24 17:09:25 UTC
*** Bug 154723 has been marked as a duplicate of this bug. ***
Comment 38 Jesse Glick 2012-06-04 22:11:33 UTC
*** Bug 213488 has been marked as a duplicate of this bug. ***