Yes, I know it can be hard to track down.
Is there something I can do to collect useful information if it happens again?

Scott

> On Nov 28, 2019, at 3:14 PM, Laszlo Kishalmi <[email protected]> 
> wrote:
> 
> Issues like these are really hard to tackle. Most likely some cache files 
> got corrupted.
> 
> FYI the default Gradle implementation does not use .nb-gradle folder we put 
> our cached things under .gradle.
> 
> BTW deleting .gradle directory is safe you just removed the corrupted cached 
> content.
> 
>> On 11/28/19 12:01 PM, Scott Palmer wrote:
>> [Testing with 11.2-u1 nbms installed from the binaries recently posted...]
>> 
>> Many imports in the project source are erroneously showing errors like this:
>> 
>> cannot access NativeComponent
>>   bad class file: NativeComponent.class
>>     illegal start of class file
>>     Please remove or make sure it appears in the correct subdirectory of
>> the classpath.
>> ----
>> (Alt-Enter shows hints)
>> 
>> The jars where these classes live is listed correctly in the project tree
>> under Configurations/compile/Local Files/.  I can expand the jar in that
>> view and see it has the correct entries of the classes that fail to import.
>> 
>> When I first noticed this problem I modified my build.gradle file to
>> trigger re-initialization of the project in question.   That didn't help.
>> 
>> messages.log is full of this:
>> 
>> INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve:
>> ElementHandle[kind=CLASS;
>> sigs=ca.digitalrapids.kayak.graph.impl.KayakNodeImpl_V2 ]
>> INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null
>> for kind = INTERFACE
>> 
>> Repeated for hundreds of classes.
>> 
>> I also see this:
>> 
>> INFO [org.netbeans.core.startup.layers.ArchiveURLMapper]: fo:
>> MIMESupport$CachedFileObject@7ee9774c[[Content_Types].xml] archiveFile:
>> C:\dev\<path-to-library-project-that-is-also-open-in-NB>\Dev-instructions.docx
>> java.net.URISyntaxException: Illegal character in path at index 0:
>> [Content_Types].xml
>> at java.net.URI$Parser.fail(URI.java:2848)
>> at java.net.URI$Parser.checkChars(URI.java:3021)
>> at java.net.URI$Parser.parseHierarchical(URI.java:3105)
>> at java.net.URI$Parser.parse(URI.java:3063)
>> at java.net.URI.<init>(URI.java:820)
>> [catch] at
>> org.netbeans.core.startup.layers.ArchiveURLMapper.getURL(ArchiveURLMapper.java:76)
>> at org.openide.filesystems.URLMapper.findURL(URLMapper.java:115)
>> at org.openide.filesystems.FileObject.toURL(FileObject.java:1216)
>> at
>> org.netbeans.modules.openide.filesystems.declmime.DefaultParser.parse(DefaultParser.java:117)
>> at
>> org.netbeans.modules.openide.filesystems.declmime.XMLMIMEComponent$SniffingParser.sniff(XMLMIMEComponent.java:267)
>> at
>> org.netbeans.modules.openide.filesystems.declmime.XMLMIMEComponent.acceptFileObject(XMLMIMEComponent.java:81)
>> at
>> org.netbeans.modules.openide.filesystems.declmime.FileElement.resolve(FileElement.java:77)
>> at
>> org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl$Impl.findMIMEType(MIMEResolverImpl.java:425)
>> at
>> org.openide.filesystems.MIMESupport$CachedFileObject.resolveMIME(MIMESupport.java:346)
>> at
>> org.openide.filesystems.MIMESupport$CachedFileObject.getMIMEType(MIMESupport.java:287)
>> at org.openide.filesystems.MIMESupport.findMIMEType(MIMESupport.java:111)
>> at org.openide.filesystems.FileUtil.getMIMEType(FileUtil.java:1297)
>> at org.openide.filesystems.FileObject.getMIMEType(FileObject.java:642)
>> at
>> org.openide.filesystems.AbstractFileObject.getMIMEType(AbstractFileObject.java:169)
>> at org.openide.loaders.DataLoaderPool.allLoaders(DataLoaderPool.java:307)
>> at
>> org.openide.loaders.DataLoaderPool.findDataObject(DataLoaderPool.java:505)
>> at org.openide.loaders.FolderList.createBoth(FolderList.java:743)
>> at org.openide.loaders.FolderList.getObjects(FolderList.java:539)
>> at org.openide.loaders.FolderList.access$600(FolderList.java:52)
>> at
>> org.openide.loaders.FolderList$ListTask.computeResult(FolderList.java:938)
>> at org.openide.loaders.FolderList$ListTask.run(FolderList.java:914)
>> at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
>> at
>> org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
>> at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
>> at
>> org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
>> 
>> I'm not sure why NB is looking at a .docx file at all, it is in the root of
>> a project folder for one of the libraries that my project with the import
>> problems uses, both projects are open in NB.  That file is not on the
>> classpath of either project.
>> 
>> I re-built the library project from the command line a few times, so the
>> jar would have disappeared and re-appeared.
>> 
>> I also see this earlier in the messages.log, but I'm not sure when it
>> happened (Can we get timestamps for the log entries??)
>> 
>> WARNING [org.openide.filesystems.JarFileSystem]: cannot open
>> C:\dev\<path_to_where_library_jar_is_installed_used_for_compile_dependency_of_main_project>\Thing.jar
>> WARNING [null]: Last record repeated again.
>> 
>> That is repeated for every jar mentioned in the manifest of Thing.jar as
>> well.  Funny, if you can't read the jar file how do you know about all the
>> jars in it's manifest???
>> 
>> I restart NetBeans and even though none of the above issues show in
>> messages.log on after restart, the problem remains.
>> 
>> There is one exception in the log preceeded by many many lines of
>> whitespace:
>> 
>> INFO [org.netbeans.modules.masterfs.watcher.Watcher]: Exception
>> java.nio.file.ClosedWatchServiceException
>> at sun.nio.fs.AbstractPoller.invoke(AbstractPoller.java:216)
>> at sun.nio.fs.AbstractPoller.cancel(AbstractPoller.java:133)
>> at
>> sun.nio.fs.WindowsWatchService$WindowsWatchKey.cancel(WindowsWatchService.java:209)
>> at
>> org.netbeans.modules.masterfs.watcher.nio2.NioNotifier.removeWatch(NioNotifier.java:62)
>> Caused: java.io.IOException
>> at
>> org.netbeans.modules.masterfs.watcher.nio2.NioNotifier.removeWatch(NioNotifier.java:64)
>> at
>> org.netbeans.modules.masterfs.watcher.nio2.NioNotifier.removeWatch(NioNotifier.java:40)
>> at
>> org.netbeans.modules.masterfs.providers.Notifier$1.removeWatch(Notifier.java:95)
>> at
>> org.netbeans.modules.masterfs.watcher.NotifierKeyRef.removeWatch(NotifierKeyRef.java:73)
>> [catch] at
>> org.netbeans.modules.masterfs.watcher.Watcher$Ext.unregister(Watcher.java:297)
>> at
>> org.netbeans.modules.masterfs.watcher.Watcher.unregister(Watcher.java:111)
>> at
>> org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.removeFileChangeListener(BaseFileObj.java:539)
>> at
>> org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectKeeper.listenTo(FileObjectKeeper.java:191)
>> at
>> org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectKeeper.listenNoMore(FileObjectKeeper.java:272)
>> at
>> org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectKeeper.removeRecursiveListener(FileObjectKeeper.java:102)
>> at
>> org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.removeRecursiveListener(FolderObj.java:662)
>> at org.openide.filesystems.DeepListener.run(DeepListener.java:70)
>> at
>> org.openide.filesystems.FileChangeImpl.removeRecursiveListener(FileChangeImpl.java:255)
>> at
>> org.openide.filesystems.FileUtil.removeRecursiveListener(FileUtil.java:381)
>> at
>> org.netbeans.modules.parsing.impl.indexing.RootsListener.lambda$safeRemoveRecursiveListener$5(RootsListener.java:260)
>> at
>> org.netbeans.modules.parsing.impl.indexing.RootsListener.performSave(RootsListener.java:276)
>> at
>> org.netbeans.modules.parsing.impl.indexing.RootsListener.lambda$performAsync$6(RootsListener.java:268)
>> at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
>> at
>> org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
>> at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
>> at
>> org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
>> INFO [org.netbeans.core.netigso.Netigso]: bundle
>> [email protected] 256
>> INFO [org.netbeans.core.netigso.Netigso]: bundle
>> [email protected] stopped
>> INFO [null]: Last record repeated again.
>> 
>> 
>> So then I stopped NB, deleted the .nb-gradle and .gradle folders that were
>> in the project directory and restarted NB.
>> The project is now back to a sane state.
>> 
>> I'm not sure how to reproduce this and I suspect there is more than one
>> thing going wrong.  I haven't entered a bug yet.
>> 
>> Scott
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to