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/28 14:59:34 UTC

[GitHub] [netbeans] blakemcbride opened a new issue, #4558: Can't attach to a debug process on Java 17

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

   ### Apache NetBeans version
   
   Apache NetBeans 15 release candidate
   
   ### What happened
   
   I have been debugging my Java app by attaching to a process under Java 8 with no problem.  I upgraded my app and system to Java 17.  I can no longer attach to the process.  NetBeans says, "Connection refused."  Interestingly, IntelliJ can attach to the process, so I know it is something to do with NetBeans and Java 17. 
   
   When I try to attach to the process with NetBeans, I select:
   
   Debugger:  Java Debugger (JPDA)
   Connector: SocketAttach (Attaches by socket to other VMs)
   Transport:  dt_socket
   Host: i9-tower
   Port: 9090
   Timeout [ms]:  [blank]
   
   These are the same parameters I used with Java 8 that worked fine.
   
   ### How to reproduce
   
   _No response_
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Fedora Linux
   
   ### JDK
   
   17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### 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] lkishalmi commented on issue #4558: Can't attach to a debug process on Java 17

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

   Fedora. SELinux?


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   IntelliJ can attach to port 9090 and debug.


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   Also, I am starting the server and trying to attach from the same user.


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   Perhaps NetBeans should default to localhost rather than the hostname.  (I've never seen a Linux install that auto-added the hostname to the hosts file.)


-- 
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] lkishalmi commented on issue #4558: Can't attach to a debug process on Java 17

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

   Works like a charm. Everything is on Java 17.0.4 provided by Ubuntu packages.
   
   ![image](https://user-images.githubusercontent.com/1381701/187355877-2e34d557-a18d-4eb4-b434-910e08019e60.png)
   


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   Well, under Java 17, I get "Connection refused," but IntelliJ can attach.  If I switch to Java 8, NetBeans can connect.  The app I am working on is a webap hosted on tomcat with about 10,000 classes.  I will try to create a minimum example as soon as I get a chance.  
   Thanks!


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   I turned off SELunix with:
           systemctl disable firewalld.service
     	systemctl stop firewalld.service
   And:
           ufw disable
   
   I still can't connect.  However, the IDE log is giving me:
   
   INFO [org.netbeans.ui.metrics.debugger]: Debugger connect using connector com.sun.jdi.SocketAttach with arguments: timeout=, hostname=i9-tower, port=9090
   INFO [org.netbeans.ui.metrics.debugger]: Connecting via connect type Java Debugger (JPDA)
   INFO [org.netbeans.ui.metrics.debugger]: Debugger session i9-tower:9090 started at i9-tower for Java
   INFO [org.netbeans.api.debugger.jpda.AttachingDICookie]: Attaching Connector = com.sun.jdi.SocketAttach (defaults: timeout=, hostname=i9-tower, port=), arguments = {timeout=timeout=, hostname=hostname=i9-tower, port=port=9090}
   java.net.ConnectException: Connection refused (Connection refused)
   	at java.net.PlainSocketImpl.socketConnect(Native Method)
   	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
   	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
   	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
   	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
   	at java.net.Socket.connect(Socket.java:607)
   	at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:222)
   	at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
   	at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
   [catch] at org.netbeans.api.debugger.jpda.AttachingDICookie.getVirtualMachine(AttachingDICookie.java:206)
   	at org.netbeans.modules.debugger.jpda.actions.StartActionProvider.doStartDebugger(StartActionProvider.java:163)
   	at org.netbeans.modules.debugger.jpda.actions.StartActionProvider.access$200(StartActionProvider.java:55)
   	at org.netbeans.modules.debugger.jpda.actions.StartActionProvider$1.run(StartActionProvider.java:140)
   	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)
   
   
   


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   Okay.  I've got a simple example.  Type the following (on Linux)
   
   $ git clone https://github.com/blakemcbride/Kiss.git
   $ cd Kiss
   $ ./bld develop
   
   Now, from NetBeans click Debug / Attach Debugger...
   
   Debugger:  Java Debugger (JPDA)
   Connector: SocketAttach
   Transport: dt_docket
   Host:  [your host]
   Port: 9000
   
   If I build under Java 8 the debugger attaches.  If I build the above app under Java 17 NetBeans gives me "Connection refused".
   


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   I am sure NetBeans can debug Java 17 programs.  That is not what I am talking about.  I am talking about the ability to attach to a running program for debug purposes.  This is done by clicking on Debug / Attach Debugger...
   When doing this with a Java 17 program, NetBeans responds with "Connection refused."
   Again, IntelliJ can attach to the same process so I know the problem is with NetBeans.


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   Okay.  That's good news.  I turned off my firewall, and that didn't help.  I also looked at the NetBeans log.  Nothing.  How can I figure out why it isn't working on my machine?


-- 
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] lkishalmi commented on issue #4558: Can't attach to a debug process on Java 17

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

   Well working with Java 17 on Ubuntu for over 6 months by now I do not see such issues. (I switched from running NetBeans from Java 11 to 17 early this year.)


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   FYI:
   [root@i9-tower ~]# cd /etc
   [root@i9-tower etc]# cat hosts
   127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
   ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
   137.184.221.59    wtg
   157.245.254.75 tse
   
   [root@i9-tower etc]# hostname
   i9-tower
   


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   That worked!   Thank you very much!!


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   I reconfigured my machine back to Java 8.  I can again attach to the debug process with the exact same setup.  The problem is clearly associated with Java 17.


-- 
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] lkishalmi commented on issue #4558: Can't attach to a debug process on Java 17

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

   Could you try localhost in the hosname field instead of i9-tower?


-- 
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] lkishalmi closed issue #4558: Can't attach to a debug process on Java 17

Posted by GitBox <gi...@apache.org>.
lkishalmi closed issue #4558: Can't attach to a debug process on Java 17
URL: https://github.com/apache/netbeans/issues/4558


-- 
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] lkishalmi commented on issue #4558: Can't attach to a debug process on Java 17

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

   Just tested on my computer (it has Java 17 only). Attaching debugger works.
   My testcase was:
   
   1. Create a new Gradle Application Project
   2. Open the App.java, place a valid breakpoint
   3. Select the app project
   4. Tools > Open in Terminal
   5. execute: ```../gradlew run --debug-jvm```
   6. Attach the debugger on port: 5005
   7. Check the breakpoint caught.
   
   ```
   Product Version: Apache NetBeans IDE 15
   Java: 17.0.4; OpenJDK 64-Bit Server VM 17.0.4+8-Ubuntu-122.04
   Runtime: OpenJDK Runtime Environment 17.0.4+8-Ubuntu-122.04
   System: Linux version 5.15.0-46-generic running on amd64; UTF-8; en_US (nb)
   User directory: /home/lkishalmi/snap/netbeans/69
   Cache directory: /home/lkishalmi/snap/netbeans/common/69
   ```


-- 
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] blakemcbride commented on issue #4558: Can't attach to a debug process on Java 17

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

   BTW, of all the things I've reported, this one is the most important to me.  Until I get it working, I can't switch to Java 17.
   Thanks for all of your help!
   


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