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/08/18 16:09:26 UTC

[GitHub] [netbeans] maffe opened a new issue, #4516: Links in stacktraces do not work (Source file not found)

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

   ### Apache NetBeans version
   
   Apache NetBeans 14
   
   ### What happened
   
   The links in stacktraces do not work with JDK 9+.
   
   ### How to reproduce
   
   Run any code causing an exception in JDK code in a Maven project, for example:
   
   ```
   package com.acme.bugs.netbeans;
   
   import java.io.FileNotFoundException;
   import java.io.FileReader;
   
   public class StacktraceLink {
       public static void main(final String[] args) throws FileNotFoundException {
           new FileReader("nonexistent");
       }
   }
   ```
   
   Output:
   ```
   --- exec-maven-plugin:3.0.0:exec (default-cli) @ Test ---
   Exception in thread "main" java.io.FileNotFoundException: nonexistent (The system cannot find the file specified)
   	at java.base/java.io.FileInputStream.open0(Native Method)
   	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
   	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
   	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:111)
   	at java.base/java.io.FileReader.<init>(FileReader.java:60)
   	at com.acme.bugs.netbeans.StacktraceLink.main(StacktraceLink.java:10)
   ```
   
   Clicking on a link starting with `java.base/` (or any other Java module) does not open the file and a message `Source file not found for "FileReader"`/`Source file not found for "FileInputStream"` appears in the status bar.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 10 64-bit
   
   ### JDK
   
   OpenJDK 18.0.2 Windows x64
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   Always happens with JDK 9+.
   
   NetBeans is running on OpenJDK 18.0.2 and the project uses an OpenJDK 18.0.2 Maven toolchain. (Maven istself is running on Java 8, but that shouldn’t matter.)
   
   NetBeans found the sources when adding the JDK 18.0.2 platform and these files can be opened in the Debugging tab when using the debugger. The links do not work even when the matching JDK file is opened.
   
   I believe the links worked earlier when using Java 8 or older (without the module system).
   
   ### 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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   > figure out how to get the project JDK info
   
   Reminds me of what's going on sorting out gradle projects and which jdk... with https://github.com/apache/netbeans/pull/5052


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   So looks like this code and the regex it uses need updating to be module aware - https://github.com/apache/netbeans/blob/master/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java#L172
   
   See also regex in StackAnalyzer https://github.com/apache/netbeans/blob/master/java/java.navigation/src/org/netbeans/modules/java/stackanalyzer/StackLineAnalyser.java#L57
   
   Would be good to have this in one place, but if not at least kept in sync?  Anywhere else analyzing stack traces?


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   @mbien yes, certainly didn't mean that the regex is the only issue that needs addressing in that code!  It searches for the wrong package name with JDK missing from the classpath.  Both are equally important, surely?  Won't work with either broken.  Project module info shouldn't be relevant to JDK classes being in a module.  But module aware stack elements would also fix more than just the JDK links.


-- 
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 #4516: Links in stacktraces do not work (Source file not found)

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

   btw as workaround you could paste the stack trace into the windows -> debugging -> analyze stack trace window. 
   
   It works from there.


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

Posted by GitBox <gi...@apache.org>.
mbien closed issue #4516: Links in output window stacktraces do not work (when they point to JDK code)
URL: https://github.com/apache/netbeans/issues/4516


-- 
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] maehem commented on issue #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   
   Michael, 
   
   I downloaded and ran the dev build in the link for #5091 and it appears to work for me on OSX 12.5.1.  Both stack trace links links  into the JDK and my own code seem to be working when I click them in the output window.
   
   Thank you for making this work!   I look forward to seeing this in NB17.
   
   
   mark
   
   
   > On Dec 14, 2022, at 8:05 AM, Michael Bien ***@***.***> wrote:
   > 
   > 
   > forgot to post here that #5091 <https://github.com/apache/netbeans/pull/5091> is pending and should fix the issue encountered here. dev build is linked from the PR. Would be good if someone could confirm that this issue is fixed.
   > 
   > —
   > Reply to this email directly, view it on GitHub <https://github.com/apache/netbeans/issues/4516#issuecomment-1351695974>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABTT4KBHHO6F3YAVPYJOEATWNHV6PANCNFSM565XUTUA>.
   > You are receiving this because you are subscribed to this thread.
   > 
   
   


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   @maehem awesome, thanks a lot for verifying!


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   opening JDK links already didn't work on NB 8 + JDK 8 which indicates that it was most likely never implemented for maven projects. Going to take a look how to get the active jdk of a project and see how to proceed from there.
   
   I already couldn't figure out how to get the project JDK info when I wrote #4802, lets give it another try.


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   @mbien yes, both are broken.  I would guess lack of `ClassPath.BOOT` in the response at https://github.com/apache/netbeans/blob/master/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java#L244 ?
   
   The stack trace analyzer doesn't work correctly here either, obviously, as it's just using the global classpath info, so always going to give the running JDK.


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   @neilcsmith-net there are multiple issues here I believe. If you set a breakpoint at https://github.com/apache/netbeans/blob/cf48b1fd9a97a8294c10b99fa00ad488f5837206/java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java#L186 you see that the cp does not include the active JDK. So it doesn't find anything even if the parsing works.
   
   This seems to be the case no matter if the project has a module info or not.
   
   'packageName' a few lines above the breakpoint is incorrect too if a module is in the trace line.


-- 
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 #4516: Links in output window stacktraces do not work (when they point to JDK code)

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

   forgot to post here that #5091 is pending and should fix the issue encountered here. dev build is linked from the PR. Would be good if someone could confirm that this issue is fixed.


-- 
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 #4516: Links in stacktraces do not work (Source file not found)

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

   Thanks for the detailed report. Could reproduce it on latest master too (basically NB 15).


-- 
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