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

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!

Related

How to resolver Arquilian on wildfly test problem under windows

I have a problem related to testing in windows operating system using Idea, I use Arquilian on wildfly server, the error i'm getting is this [CIRCULAR REFERENCE:java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:33390. The connection timed out]
[CIRCULAR REFERENCE:java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:33390. The connection timed out]
[org.jboss.as.arquillian.container.ArchiveDeployer] WARN: Cannot undeploy: project-in-ear.ear
Hmm, what I see is that the problem is with firewall rules; you can try to add the ip and port authorization and see if this work

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

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:

unable to connect to open fire from android

Android application returns error while creating connection with Open Fire while it works fine at my local server.
10-07 14:58:32.347 26785-27124/com.testing.online_soping_app E/XMPPChatDemoActivity: Could not connect to http://demo.vaidiksolutions.in:5222.: remote-server-timeout(504) Could not connect to https://demo.vaidiksolutions.in:5222.
-- caused by: java.net.UnknownHostException: Host is unresolved: http://demo.vaidiksolutions.in
10-07 14:58:32.347 26785-27124/com.testing.online_soping_app E/XMPPChatDemoActivity: Failed to log in as mohit
10-07 14:58:32.347 26785-27124/com.testing.online_soping_app E/XMPPChatDemoActivity: java.lang.IllegalStateException: Not connected to server.
It looks like DNS failed to resolve this domain. Have you tried to ping the server domain?
If the ping is OK, you may try to connect using IP directly.

DEBUG [org.jboss.naming.Naming] Error writing response to /127.0.0.1 java.net.SocketException

After starting the run/debug configuration begins build and deploy application. All goes well. The only thing that provides continuously JBoss Log SocketException:
2012-07-16 12:43:30,424 DEBUG [org.jboss.naming.Naming] Error writing response to /127.0.0.1 java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847) at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1756) at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1257) at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1211) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1395) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:333) at org.jnp.server.Main$BootstrapRequestHandler.run(Main.java:516) at org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:148) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756) at java.lang.Thread.run(Thread.java:662)
At issues.jboss.org/browse/JBAS-3417 offer a solution:
If you set server / etc / host with:
IP fqn name
where IP is in «Error writing response to / IP"
Ex:
... "Error writing response to / 10.1.0.1"
10.1.0.1 test.mydomain test
you resolve the problem
But I have something 127.0.0.1 localhost, it is already registered in the default c:\ Windows\system32\drivers\etc\hosts
In the Troubleshooting says:
You may notice something in the JBoss logs similar to the following:
2009-01-28 08:36:57,381 DEBUG
[org.jboss.naming.NamingService]
Error writing response to / 127.0.0.1 <[http://127.0.0.1]>
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0 (Native Method)
This is most likely an anomalous and benign «problem». That is, it should not affect the operation of any applications deployed to JBoss.
If this does not affect deployed application can be any way to hide it? And then the continuous output overshadows the other posts and eats memory.

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.