failed to find free socket port for process dispatcher when trying remote debug - sockets

Highlights:
windows 10 host machine
ubuntu vagrant box (virtualbox) as guest vm
using vagrant port forwarding as like this: config.vm.network "forwarded_port", guest: 1234, host: 12340
IDE: IntelliJ IDEA with Ruby plugin
The Issue:
I've tried to set up remote ruby debug following this guide and getting an error in IDE: "failed to find free socket port for process dispatcher". It looks this issue is not IntelliJ-specific, I was able to reproduce it with latest RubyMine as well.
From IDEA's log
2017-07-07 21:53:03,515 [8879188] INFO - tion.impl.ExecutionManagerImpl - Failed to find free socket port for process dispatcher
com.intellij.execution.ExecutionException: Failed to find free socket port for process dispatcher
at org.jetbrains.plugins.ruby.ruby.debugger.RubyProcessDispatcher.<init>(RubyProcessDispatcher.java:46)
at org.jetbrains.plugins.ruby.ruby.debugger.RubyRemoteDebugRunner.doExecute(RubyRemoteDebugRunner.java:62)
...
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
at java.net.TwoStacksPlainSocketImpl.socketBind(TwoStacksPlainSocketImpl.java:137)
...
I can understand it says Address already in use: JVM_Bind, but how remote debug supposed to work at all then? (I mean Is there any way to access guest vm port not forwarding it before? Clearly no) Any help to solve this issue is much appreciated.

For me the issue was due to another debug session that was open in the background. To prevent that from happening again (and also close all other currently open sessions, once you run the configuration again) select "Single instance only" in the Debug Configuration:

Related

WLST - Cannot connect() with HTTPS - T3S Protocol - Port 9002

We changed the configuration of our WebLogic servers to use HTTPS and T3S for connections and use the secure encrypted port 9002 instead of cleartext port 7001. However when using the Web Logic Scripting Tool (WLST)'s connect() function, errors are thrown. One such error is as follows:
WLSTException: Error occurred while performing connect : Cannot connect via t3s or https. If using demo certs, verify that the -Dweblogic.security.TrustKeyStore=DemoTrust system property is set. : t3s://DatServer:9002: Destination 10.10.100.3, 9002 unreachable; nested exception is:
javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination
Use dumpStack() to view the full stacktrace :
The syntax of the connect function is: connect('user', 'password', 't3s://host:9002')
This connect() function works fine before the switch from HTTP to HTTPS. Now we cannot connect to the remote admin server using the connect command. Does anyone have any idea how to fix this?
I read some interesting help options but none of them seemed to work. These help suggestions and tips are located here: https://community.oracle.com/thread/1036828
We were able to connect to the remote host and port via telnet. We saw that the port is open and listening for connections on the loop back address with netstat. We tried adding these options to the script invocation: java -cp /path/to/weblogic.jar weblogic.WLST -Dweblogic.security.TrustKeyStore=DemoTrust -Dssl.debug=true Dweblogic.security.SSL.ignoreHostnameVerification=true -Djava.security.egd=file:/dev/./urandom but this also did not work.
We enabled tunneling in the General tab of WebLogic but not in the HTTP tab. I am not the one in control of the server so I just have to suggest things and hope that the instructions are followed.
I get it running in 12.2. by adding to
../oracle_common/common/bin/setWlstEnv_internal.sh
at the end the following lines (youu need to customize line 5 und 6, the values in brackets):
JAVA_OPTIONS="-Dweblogic.ssl.JSSEEnabled=true ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.SSL.enableJSSE="true" ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.SSL.ignoreHostnameVerification=true ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.TrustKeyStore=CustomTrust ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.CustomTrustKeyStoreFileName= ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.CustomTrustKeyStorePassPhrase= ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.CustomTrustKeyStoreType=JKS ${JAVA_OPTIONS}"
export JAVA_OPTIONS
and modifying in
../oracle_common/common/bin/wlst_internal.sh
the line starting with
eval '"${JAVA_HOME}/bin/java"' ${JVM_ARGS} ...
by adding ${JAVA_OPTIONS}
so that it looks as follows:
eval '"${JAVA_HOME}/bin/java"' ${JVM_ARGS} ${JAVA_OPTIONS} weblogic.WLST '"$#"'
Hope this helps, allthough modifying scripts that are named "..internal.." doesn´t give me a good feeling
export this before running wlst.sh
export WLST_PROPERTIES=" -Dweblogic.security.TrustKeyStore=CustomTrust -Dweblogic.security.CustomTrustKeyStoreFileName=/u01/oracle/properties/truststore.jks -Dweblogic.security.CustomTrustKeyStoreType=jks -Dweblogic.security.CustomTrustKeyStorePassPhrase=qaz#1234 " ;

Error message while starting JBoss server:Port 9303 already in use

I am getting below error message while starting my Jboss 1.5 server. Kindly help me out with suggestions to fix this issue.
The Jboss servers stays up for matter of minutes and immediately it stops working with the below error message.
Kindly help.
2015-11-21 07:06:12,922 INFO [org.jboss.web.WebService] (main) Using RMI server codebase: http://jboss URL:9303/
2015-11-21 07:06:12,982 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss:service=WebService state=Create mode=Manual requiredState=Installed
java.lang.Exception: Port 9303 already in use.
at org.jboss.web.WebServer.start(WebServer.java:233)
at org.jboss.web.WebService.startService(WebService.java:322)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
Something at your system is running at the port 9303. You can either set port offset or change port of the service which is going to run at the port 9303.
To change port in JBoss 5 is something like:
run -c server_instance_name -Djboss.service.binding.set=ports-01
For test try to kill a service which is using port 9303 and try to run JBoss.

jetty error starting on Mac

Hello Ive downloaded jetty and whenever I try to start it it generate the following log and gives an error so I can't use it, can somebody tell me whats wrong or whats missing
Im starting on terminal in the bin folder with the "./jetty.sh start"
Here's the error on localhost:8080
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
Powered by Jetty Java Web Server
Heres the log:
https://www.dropbox.com/s/u6j7t1lhqscv34l/log.rtf
Looks like that port 8080 is already in use: "java.net.BindException: Address already in use
"
Try an different port or don't declare a port and use logic like this to figure out what you are bound to:
Server server = new Server(0);
int port = ((ServerConnector) server.getConnectors()[0]).getLocalPort();

Intellij unitest Exception encountered when invoking run on a nested suite - java.net.BindException: Permission denied

I am new to scalatest and when I finished the project I add a test file.
Is there any place that I should particularly pay attention to?
I met this problem when I want to run a unitest in intelli idea
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50594,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "/Users/xuyin/Library/Application Support/IdeaIC13/Scala/lib/scala-plugin-runners.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/xuyin/codebase/api-server/target/scala-2.10/test-classes:/Users/xuyin/codebase/api-server/target/scala-2.10/classes:/Users/xuyin/.sbt/boot/scala-2.10.1/lib/scala-library.jar:/Users/xuyin/.ivy2/cache/com.typesafe.slick/slick_2.10/jars/slick_2.10-1.0.0.jar:/Users/xuyin/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar:/Users/xuyin/.ivy2/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.6.4.jar:/Users/xuyin/.ivy2/cache/com.h2database/h2/jars/h2-1.3.166.jar:/Users/xuyin/.ivy2/cache/mysql/mysql-connector-java/jars/mysql-connector-java-5.1.13.jar:/Users/xuyin/.ivy2/cache/org.scalaquery/scalaquery_2.9.1-1/jars/scalaquery_2.9.1-1-0.10.0-M1.jar:/Users/xuyin/.ivy2/cache/com.twitter/finagle-core_2.10/jars/finagle-core_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/io.netty/netty/bundles/netty-3.5.5.Final.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-core_2.10/jars/util-core_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-collection_2.10/jars/util-collection_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.google.guava/guava/jars/guava-13.0.1.jar:/Users/xuyin/.ivy2/cache/com.google.guava/guava/jars/guava-11.0.2.jar:/Users/xuyin/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-hashing_2.10/jars/util-hashing_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-jvm_2.10/jars/util-jvm_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-logging_2.10/jars/util-logging_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-app_2.10/jars/util-app_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/finagle-http_2.10/jars/finagle-http_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-codec_2.10/jars/util-codec_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.6.jar:/Users/xuyin/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.5.jar:/Users/xuyin/.ivy2/cache/commons-lang/commons-lang/jars/commons-lang-2.6.jar:/Users/xuyin/.ivy2/cache/com.twitter/finagle-ostrich4_2.10/jars/finagle-ostrich4_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/ostrich_2.10/jars/ostrich_2.10-9.1.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-eval_2.10/jars/util-eval_2.10-6.1.0.jar:/Users/xuyin/.sbt/boot/scala-2.10.1/lib/scala-compiler.jar:/Users/xuyin/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.1.jar:/Users/xuyin/.ivy2/cache/com.twitter/scala-json_2.10/jars/scala-json_2.10-3.0.1.jar:/Users/xuyin/.ivy2/cache/net.liftweb/lift-json_2.10/jars/lift-json_2.10-2.5.jar:/Users/xuyin/.ivy2/cache/org.scala-lang/scalap/jars/scalap-2.10.0.jar:/Users/xuyin/.ivy2/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.4.1.jar:/Users/xuyin/.ivy2/cache/log4j/log4j/bundles/log4j-1.2.16.jar:/Users/xuyin/.ivy2/cache/log4j/log4j/jars/log4j-1.2.14.jar:/Users/xuyin/.ivy2/cache/com.github.sgroschupf/zkclient/jars/zkclient-0.1.jar:/Users/xuyin/.ivy2/cache/org.apache.zookeeper/zookeeper/jars/zookeeper-3.3.3.jar:/Users/xuyin/.ivy2/cache/jline/jline/jars/jline-0.9.94.jar:/Users/xuyin/.ivy2/cache/junit/junit/jars/junit-3.8.1.jar:/Users/xuyin/.ivy2/cache/org.scalatest/scalatest_2.10/jars/scalatest_2.10-1.9.1.jar:/Users/xuyin/.ivy2/cache/org.scala-lang/scala-actors/jars/scala-actors-2.10.0.jar:/Users/xuyin/.ivy2/cache/com.github.tomakehurst/wiremock/jars/wiremock-1.33.jar:/Users/xuyin/.ivy2/cache/net.sf.jopt-simple/jopt-simple/jars/jopt-simple-4.3.jar:/Users/xuyin/.ivy2/cache/com.fasterxml.jackson.core/jackson-core/jars/jackson-core-2.1.2.jar:/Users/xuyin/.ivy2/cache/org.mortbay.jetty/jetty/jars/jetty-6.1.26.jar:/Users/xuyin/.ivy2/cache/org.mortbay.jetty/jetty-util/jars/jetty-util-6.1.26.jar:/Users/xuyin/.ivy2/cache/org.mortbay.jetty/servlet-api/jars/servlet-api-2.5-20081211.jar:/Users/xuyin/.ivy2/cache/com.jayway.jsonpath/json-path/bundles/json-path-0.8.1.jar:/Users/xuyin/.ivy2/cache/net.minidev/json-smart/jars/json-smart-1.1.1.jar:/Users/xuyin/.ivy2/cache/org.apache.httpcomponents/httpclient/jars/httpclient-4.2.3.jar:/Users/xuyin/.ivy2/cache/org.apache.httpcomponents/httpcore/jars/httpcore-4.2.2.jar:/Users/xuyin/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar:/Users/xuyin/.ivy2/cache/com.fasterxml.jackson.core/jackson-annotations/jars/jackson-annotations-2.1.2.jar:/Users/xuyin/.ivy2/cache/junit/junit-dep/jars/junit-dep-4.10.jar:/Users/xuyin/.ivy2/cache/com.fasterxml.jackson.core/jackson-databind/jars/jackson-databind-2.1.2.jar:/Applications/IntelliJ IDEA 13 CE.app/lib/idea_rt.jar" org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner -s com.umeng.push.apiserver.ApiServerServiceSpec -showProgressMessages true -C org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter
Testing started at PM12:49 ...
Connected to the target VM, address: '127.0.0.1:50594', transport: 'socket'
Exception encountered when invoking run on a nested suite - java.net.BindException: Permission denied
java.lang.RuntimeException: java.net.BindException: Permission denied
at com.github.tomakehurst.wiremock.WireMockServer.start(WireMockServer.java:168)
at com.umeng.push.apiserver.ApiServerServiceSpec.beforeAll(ApiServerServiceSpec.scala:33)
at org.scalatest.BeforeAndAfterAll$class.beforeAll(BeforeAndAfterAll.scala:150)
at com.umeng.push.apiserver.ApiServerServiceSpec.beforeAll(ApiServerServiceSpec.scala:26)
at org.scalatest.BeforeAndAfterAll$class.run(BeforeAndAfterAll.scala:211)
at com.umeng.push.apiserver.ApiServerServiceSpec.run(ApiServerServiceSpec.scala:26)
at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:60)
at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:1604)
at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:1601)
at scala.collection.immutable.List.foreach(List.scala:318)
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1601)
at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:705)
at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:704)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1645)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:703)
at org.scalatest.tools.Runner$.run(Runner.scala:592)
at org.scalatest.tools.Runner.run(Runner.scala)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest1(ScalaTestRunner.java:213)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:37)
Caused by: java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:181)
at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.Server.doStart(Server.java:235)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.github.tomakehurst.wiremock.WireMockServer.start(WireMockServer.java:166)
... 18 more
Disconnected from the target VM, address: '127.0.0.1:50594', transport: 'socket'
Process finished with exit code 0
Jetty is probably trying to open a restricted port (like 80), and you are not running as root. Check the port number your test code is telling it to use (or it might be using a default).
I had a similar problem when I was using a USB surf stick for connecting to the internet, with some provider specific software to operate the surf stick. When disconnecting the stick (and thereby disconnecting from the internet), debugging worked fine for me. The stick software somehow messed up the routing of my computer, such that it tried to connect to localhost via the stick, which failed because the port number was blocked.
So, check if you have a similar configuration, and if it works when you turn off your internet connection.
Alternatively, this might also be a firewall issue. Try turning off your firewall for a while.
I strongly recommend disconnecting from the internet while your firewall is turned off!

JBoss 5.1 binds to host address while run in vserver with -b <guest address>

while starting JBoss 5.1.0.GA in virtual server machine on Debian (linux-VServer technology) I get the following error:
ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.remoting:protocol=rmi,service=JMXConnectorServer state=Create mode=Manual requiredState=Installed
java.io.IOException: Cannot bind to URL [rmi://10.1.2.11:1090/jmxconnector]: javax.naming.NoPermissionException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.AccessException: Registry.Registry.bind disallowed; origin /AA.BB.CC.DD is non-local host]
where AA.BB.CC.DD is host machine name, 10.1.2.11 is vserver guest with JBoss and JBoss is started with -b 10.1.2.11 (I also tried -Djboss.bind.address=10.1.2.11 - the same result).
10.1.2.11 is bound to dummy2 interface on host (serving 10.1.2.1 network).
The root exception is strange - why JBoss wants to bind to host address AA.BB.CC.DD? There were no problems with 4.2.3.GA on the same machine, also started with -b 10.1.2.11.
It starts correctly when no params present - binds to localhost and everything is ok, but it MUST be bound to 10.1.2.11 to be visible by Apache on another vserver guest, acting as proxy.
I thought that it can be fixed by setting net.ipv4.conf.all.promote_secondaries=1 via sysctl (was 0) but it didn't help much.
Has anyone had such problem?
Regards,
bart
Could you confirm if The port //10.1.2.11:1090/ isn't being used by another process (even a zombie one : P)?
There was a problem similar at JbossJIRA a couple of years ago... But i though it was already fixed.