Re: Broken Debugger on OS X Sierra

Peter Hansson <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAC55jYOWxC-k=_AFcg128Q_uOLPo9bFg97joBO3njiNbVODAXQ@mail.gmail.com>
Couple of links on this issue:

http://stackoverflow.com/questions/29188789/eclipse-mac-os-x-debug-error-fatal-error-in-native-method-jdwp-no-transports

https://netbeans.org/bugzilla/show_bug.cgi?id=157931

http://forums.netbeans.org/post-36441.html

https://wiki.eclipse.org/Debug/FAQ#I_can_run_a_program_but_not_debug_it.3F.3F.3F

Sorry, the links do not explain why you see this on OS X Sierra and not the
release before that.



On Sun, Oct 2, 2016 at 4:27 AM, Andreas Stefik <[email protected]> wrote:

> Folks,
>
> I recently upgraded to OS X Sierra and have run into a problem with the
> debugger. I don't think it's a bug in NetBeans, but want to report is here,
> see if anyone else has run into it, and see if there's a better solution.
>
> First, the problem is that we have a custom debugger, which boots and runs
> Java Bytecode. Our debug launcher looks like this:
>
> //typical connector
> LaunchingConnector connector = Bootstrap.virtualMachineManager().
> defaultConnector();
>
> //all the flags
> Map map = connector.defaultArguments();
> Connector.Argument mainArg = (Connector.Argument) map.get("main");
> mainArg.setValue("-jar \"" + executable + "\"");
> Connector.Argument optionsArg = (Connector.Argument) map.get("options");
> optionsArg.setValue("-Duser.dir=\"" + workingDirectory + "\"");
>
> //launch the VM
> try {
>     virtualMachine = connector.launch(map);
> } catch (IOException | IllegalConnectorArgumentsException |
> VMStartException ex) {
>     Logger.getLogger(JDIDebugger.class.getName()).log(Level.SEVERE, null,
> ex);
> }
>
> Nothing special here, just bootup a JVM and run it with debug settings.
> This translates to a command that looks something like this on my machine:
>
> /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/bin/java
> -Duser.dir=/Users/stefika/Repositories/quorum-language/Quorum3 -Xdebug
> -Xrunjdwp:transport=dt_socket,address=CSadmins-MacBook-Pro-3.local:63636,suspend=y
> -jar /Users/stefika/Repositories/quorum-language/Quorum3/Run/Default.jar
>
> Again, nothing special here. However, after upgrading to Sierra, I was
> getting this error (key problem in bold):
> ERROR: transport error 202: *gethostbyname: unknown host*
> ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
> JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports
> initialized [debugInit.c:750]
> FATAL ERROR in native method: JDWP No transports initialized,
> jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
> Abort trap: 6
>
> Unknown host tells me it's not connecting. This means my machine's name,
> which happens to be CSadmins-MacBook-Pro-3.local, isn't in the /etc/hosts
> file on my Mac. Now, that's easy to fix by adding a loopback entry to the
> hosts file, but here's what I don't get:
>
> *Questions*:
>
> 1. Why is this necessary on OS X Sierra, but not the previous release?
>
> 2. I'm a little worried this is going to break for others using our stuff
> in deployment. Is there anything I should change about my connector? The
> Map entry doesn't contain a dt_socket command. Should I add one manually to
> the map or is that bad?
>
> 3. The Java debugger doesn't appear to have this problem. For local runs,
> should I be doing something different?
>
> I hope that explains the problem. Obviously, I'd like to avoid users
> having to mess with this file, if possible.
>
> Stefik
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.