You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/09/18 18:25:02 UTC

[GitHub] [netbeans] errael opened a new issue, #4651: Java hints disabled by exception; Java Platforms has bad entry

errael opened a new issue, #4651:
URL: https://github.com/apache/netbeans/issues/4651

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   No hint highlights after exception in hints processing
   
   ### How to reproduce
   
   (These steps reproduce 100% for me. I can provide the project and tainted userdir if that would be useful)
   
   I narrowed down the issue with these steps. Once there's a userdir that has the problem, just start NB and get the exception
   - staring with clean .nb/15 (some -J-D added to netbeans.conf)
   - start nb, no imports
   - open project, java file; note visible hints highlights
     (not all projects exhibit the problem)
   - import from "tainted userdir", restart
       categories: general, miscellaneous (need both)
   - OBSERVE: no hints, exception (see below)
   
   In Java Platform Manager there are several entries, the entry `Zulu 18.0.2.1+1`
   is shown in red. Select it and the following for PlatformInstallFolder:
   ```
   /junk/Downloads/zulu18.32.13-ca-jdk18.0.2.1-linux_x64/zulu18.32.13-ca-jdk18.0.2.1-linux_x64
   ```
   is displayed in red, and there's the message `Error: the specified folder does not contain a java platform`
   Restart NB and the problem persists.
   Remove this bad entry, and the hints show up again.
   
   NOTE: the project does not reference this JDK.
   
   I wonder if Platform is providing garbage to HintProcessing, or if HintProcessing is not handling a valid return from Platform.
   
   I can see how importing miscellaneous is required, I wonder what's in General that's needed to trigger it.
   
   FYI: While doing some cleanup I moved the referenced directory to where all the jdk's on this system reside, and forgot about it. Several days later, after changing and moving around lots of stuff locally, I noticed there was a hints problem.
   
   ```
   SEVERE [org.openide.util.Exceptions]
   java.lang.NullPointerException
   	at com.sun.tools.javac.code.Types$ImplementationCache.implementationInternal(Types.java:2983)
   	at com.sun.tools.javac.code.Types$ImplementationCache.get(Types.java:2969)
   	at com.sun.tools.javac.code.Types.implementation(Types.java:3004)
   	at com.sun.tools.javac.comp.Check.checkClassOverrideEqualsAndHash(Check.java:2199)
   	at com.sun.tools.javac.comp.Check.checkClassOverrideEqualsAndHashIfNeeded(Check.java:2189)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5389)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5210)
   	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:5155)
   	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1317)
   	at org.netbeans.modules.java.hints.spiimpl.Utilities.constructScope(Utilities.java:775)
   	at org.netbeans.modules.java.hints.declarative.Hacks.constructScope(Hacks.java:73)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser.lambda$resolve$0(DeclarativeHintsParser.java:494)
   	at org.netbeans.modules.java.source.parsing.MimeTask.run(MimeTask.java:60)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
   	at org.netbeans.modules.parsing.api.ParserManager$MimeTaskAction.run(ParserManager.java:364)
   	at org.netbeans.modules.parsing.api.ParserManager$MimeTaskAction.run(ParserManager.java:347)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
   	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
   	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
   	at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
   	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
   	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:318)
   	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:433)
   	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser.resolve(DeclarativeHintsParser.java:473)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser.access$000(DeclarativeHintsParser.java:80)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser$Impl.parseCondition(DeclarativeHintsParser.java:307)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser$Impl.parseConditions(DeclarativeHintsParser.java:254)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser$Impl.parseRule(DeclarativeHintsParser.java:211)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser$Impl.parseInput(DeclarativeHintsParser.java:180)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser$Impl.access$200(DeclarativeHintsParser.java:87)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser.parse(DeclarativeHintsParser.java:391)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintRegistry.parseHints(DeclarativeHintRegistry.java:255)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintRegistry.parseHintFile(DeclarativeHintRegistry.java:233)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintRegistry.readHints(DeclarativeHintRegistry.java:122)
   	at org.netbeans.modules.java.hints.declarative.DeclarativeHintRegistry.computeHints(DeclarativeHintRegistry.java:105)
   	at org.netbeans.modules.java.hints.spiimpl.RulesManagerImpl.readHints(RulesManagerImpl.java:139)
   	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:132)
   	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:127)
   	at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:113)
   	at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:63)
   [catch] at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:273)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
   	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	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)
   SEVERE [null]: Last record repeated again.
   ```
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Linux harmony 5.19.0-76051900-generic #202207312230~1660780566~22.04~9d60db1
   
   ### JDK
   
   OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1254073755

   Fixed by #4672


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1253197036

   Nuking the data might work, but I don't like the idea. If the Platform is an object, it should have an `isValid()` method. And something around hints/parser should be checking it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1252036014

   > NOTE: the project does not reference this JDK.
   
   Do you have any other project open that references the bad platform entry?  Set in any of the global options?  I was looking at other parsing errors recently, and noticed errors in code and paths for other opened (but unrelated) projects affecting things.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1254035095

   So in java/java.platform/.../JavaPlatform, there's already
   ```
       public boolean isValid() {
           return !getInstallFolders().isEmpty();
       }
   ```
   So it's down to finding what is using an invalid JavaPlatform.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael closed issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael closed issue #4651: Java hints disabled by exception; Java Platforms has bad entry
URL: https://github.com/apache/netbeans/issues/4651


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1250365499

   Started up with jdk-17
   ```
   SEVERE [org.openide.util.Exceptions]
   java.lang.NullPointerException: Cannot read field "name" because "ms" is null
   	at com.sun.tools.javac.code.Types$ImplementationCache.implementationInternal(Types.java:2983)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
mbien commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1251362030

   I noticed something like this myself. I wrote some notes down that broken entries in the java platforms list can potentially stop the hints engine from working. I once had a JDK build registered which i built myself locally and problems started when i cleaned that build even though it wasn't even used in that particular project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien closed issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
mbien closed issue #4651: Java hints disabled by exception; Java Platforms has bad entry
URL: https://github.com/apache/netbeans/issues/4651


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1252293618

   After the restart after the import of `General` and `Miscellaneous` the projects window says
   ```
   <No Project Open>
   ```
   Subsequent restarts have the same situation, no project open and hints exception. Attaching log
   
   [messages.log](https://github.com/apache/netbeans/files/9607609/messages.log)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] errael commented on issue #4651: Java hints disabled by exception; Java Platforms has bad entry

Posted by GitBox <gi...@apache.org>.
errael commented on issue #4651:
URL: https://github.com/apache/netbeans/issues/4651#issuecomment-1253151305

   There's `userdir/config/Services/Platforms/org-netbeans-api-java-Platform/Zulu_18.0.2.1_1.xml` which is full of data even though it should be considered invalid, consider the ERROR color in the `Java Platforms` dialog because it can't file the file, didn't see where things got set to red. Looks like the  In the log there's
   ```
   WARNING [org.netbeans.modules.java.j2seplatform.platformdefinition.J2SEPlatformImpl]: 
   No sun.boot.class.path property in platform Zulu 18.0.2.1+1, broken platform?
   ```
   In `J2SEPlatformImpl` there's `getJ2SEPlatformDefaultSources` which serves up the platforms.
   
   Consider that the platform's dialog says
   ```
   Error: The specified folder does not contain a Java platform.
   If you want to specify a different folder for this platform, remove this platform and 
   create a new one with exactly the same name pointing to the correct platform folder.
   ```
   I'm wondering if stripping everything from a platform xml file that doesn't have an install directory, except a few things that it could display that it's broken. I sure seems like the hint processor thinks it's working with a real jdk installation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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