Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 91895 - IllegalStateException, New Project
IllegalStateException, New Project
Product: javame
Classification: Unclassified
Component: Build System
All Windows XP
: P2 (vote)
: 6.x
Assigned To: Adam Sotona
Depends on:
Blocks: 92244
  Show dependency treegraph
Reported: 2007-01-05 14:08 UTC by Fabiola Rios
Modified: 2007-01-16 10:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

IllegalStateException (1.32 KB, text/plain)
2007-01-05 14:09 UTC, Fabiola Rios
List of stack traces of DataObject.setValid method calls (19.94 KB, text/plain)
2007-01-05 14:42 UTC, David Kaspar

Note You need to log in before you can comment on or make changes to this bug.
Description Fabiola Rios 2007-01-05 14:08:31 UTC
build 070105

IllegalStateException, when you create a New Project. See attachment
Comment 1 Fabiola Rios 2007-01-05 14:09:19 UTC
Created attachment 37075 [details]
Comment 2 David Kaspar 2007-01-05 14:41:35 UTC
When I am creating a new file from MIDP|VisualMIDlet template, I get similar
I am attaching a list of stack traces (stack-traces.txt) for all setValid method
calls during the file creation.

Honzo, do you have an idea what is wrong?
Comment 3 David Kaspar 2007-01-05 14:42:16 UTC
Created attachment 37077 [details]
List of stack traces of DataObject.setValid method calls
Comment 4 Jan Pokorsky 2007-01-10 11:00:18 UTC
While creating a mobile data object from template there is a stage when just the
.java file exists so a JavaDataObject is created as a side effect of performing
some refactorings.

IMO ProjectUtilities$ should check the data object validity (according to
issue #17020). Another possibility would be to copy secondary files before the
primary one (.java).
Comment 5 Martin Ryzl 2007-01-10 12:35:44 UTC
I'm just wondering - isn't it possible to copy files in a kind of atomic
operation so the DataObject is not recognized until all files are there?
Comment 6 David Kaspar 2007-01-10 15:37:17 UTC
Fixed in FileWizardIterator by searching again for a valid data object after the
one created from template is returned.
Comment 7 Jan Pokorsky 2007-01-10 15:40:26 UTC
DataObject.createFromTemplate does copy files inside the atomic section. Anyway
we  have found the fix for the template wizard iterator in order to return the
valid data object. David put it to cvs.
Comment 8 pcmreddy 2007-01-15 09:56:41 UTC
Observed the same exception M6 build using JDK 1.5.0_11 on XP

java.lang.IllegalStateException: The data object
MasterFileObject@866463[C:/Documents and Settings/user1/My
Documents/NetBeansProjects/MobileApplication6/src/hello/] is
invalid; you may not call getNodeDelegate on it any more; see #17020 and please
fix your code
	at org.openide.loaders.DataObject.getNodeDelegate(
	at org.openide.util.Mutex.doEvent(
	at org.openide.util.Mutex.writeAccess(
Comment 9 Fabiola Rios 2007-01-15 10:48:27 UTC
build 070115 

The exception appears altmost everytime when you create a new project.
Comment 10 David Kaspar 2007-01-15 13:05:43 UTC
Fixed. Forcing invalidation of a data object created from
template during new-project-creation.
Please, test it on your machine since this is bad race-condition and I am not
sure whether the change fixes every case.
Comment 11 Lukas Hasik 2007-01-16 10:23:06 UTC
works in 070116-m6 build

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo