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 91895 - IllegalStateException, New Project
Summary: IllegalStateException, New Project
Status: VERIFIED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Build System (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks: 92244
  Show dependency tree
 
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
Exception Reporter:


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

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]
IllegalStateException
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
exception.
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$3.run 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/HelloMidlet.java] is
invalid; you may not call getNodeDelegate on it any more; see #17020 and please
fix your code
	at org.openide.loaders.DataObject.getNodeDelegate(DataObject.java:245)
	at
org.netbeans.modules.project.ui.ProjectUtilities$3.run(ProjectUtilities.java:251)
	at org.openide.util.Mutex.doEvent(Mutex.java:1181)
	at org.openide.util.Mutex.writeAccess(Mutex.java:376)
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 HelloMidlet.java
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