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.
I have a Maven project that generates Groovy classes. The generated classes are shown as a separate package "Generated Sources (groovy stubs)" When I open the folder in the Projects window the classes are listed. When I click on a class, the Navigator shows the methods in that class. When I double click the class, an empty editor opens. No filename is shown in the editor's title tab. In the IDE logfile I can see the following message: WARNING [org.netbeans.modules.openide.loaders.DataObjectEncodingQueryImplementation]: Invalid DataObject: *****\target\generated-sources\groovy-stubs\test\com\****\PlanningWeekMappingDbTest.java The class depends on another class for which the following errors can be found in the logfile: ALL [null]: The file *****/generated-sources/groovy-stubs/test/*****/FoodCampaignsGroovyDbTest.java seems no longer valid! INFO [org.netbeans.api.java.source.UiUtils]: *****\generated-sources\groovy-stubs\test\*****\FoodCampaignsGroovyDbTest.java@73310fe3:1a96cafd[invalid] msg Caused: org.openide.filesystems.FileStateInvalidException: *****\generated-sources\groovy-stubs\test\*****\FoodCampaignsGroovyDbTest.java@73310fe3:1a96cafd[invalid] at org.openide.loaders.DataObject.find(DataObject.java:559) Caused: org.openide.loaders.DataObjectNotFoundException: *****\generated-sources\groovy-stubs\test\*****\FoodCampaignsGroovyDbTest.java@73310fe3:1a96cafd[invalid] at org.openide.loaders.DataObject.find(DataObject.java:582) [catch] at org.netbeans.api.java.source.UiUtils.doOpen(UiUtils.java:355) at org.netbeans.api.java.source.UiUtils.open(UiUtils.java:241) at org.netbeans.api.java.source.ui.ElementOpen.doOpen(ElementOpen.java:207) at org.netbeans.api.java.source.ui.ElementOpen.open(ElementOpen.java:172) at org.netbeans.api.java.source.ui.ElementOpen.access$100(ElementOpen.java:67) at org.netbeans.api.java.source.ui.ElementOpen$2.run(ElementOpen.java:149) at org.netbeans.modules.progress.ui.RunOffEDTImpl$1.run(RunOffEDTImpl.java:150) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) ALL [null]: The file *****/generated-sources/groovy-stubs/test/*****/FoodCampaignsGroovyDbTest.java seems no longer valid! (I removed some parts of the file path for confidentiality reasons) The file is available in the filesystem and I can open it with other editors without problems.
Created attachment 149281 [details] Screenshot showing the problem
This is still the same with 8.1beta
Hello, thank you for reporting this. Regarding the issue: Are you trying to open a Java or a Groovy class when this happens? The file shown in the screenshot appears to be a groovy class but has the .java extension, is this the case?
Those are indeed Java classes. I checked this with NetBeans 8.2 RC and it still doesn't work properly. The classes are generated into "target/generated-sources/groovy-stubs/test". So below that is "com/mycompany/somepackage". But NetBeans 8.2 uses "test" as the first part of the package name and thus complains about com.mycompany.somepackage being wrong because the it uses test/com/mycompany/somepackage as the file location and thus expects the classes to be in the package "test.com.mycompany.somepackage". Note that the Maven project builds fine on the command line. I am the only one in the team using NetBeans. The setup works fine for all the IntelliJ and Eclipse users, so there is nothing I can do about it.