vertx run Verticle1.javavertx run Verticle2.javaException in Java verticlejava.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:436) at sun.nio.ch.Net.bind(Net.java:428) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125) at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:476) at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1021) at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:455) at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:440) at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:844) at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:195) at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:339) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:370) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745)container.deployVerticle("Verticle1.java");container.deployVerticle("Verticle2.java");public class Verticle1 extends Verticle {
@Override public void start() { RouteMatcher routeMatcher = new RouteMatcher(); routeMatcher.get("/test1", new Handler<HttpServerRequest>() { @Override public void handle(HttpServerRequest httpServerRequest) { httpServerRequest.response().end("TEST 1"); } }); vertx.createHttpServer().requestHandler(routeMatcher).listen(1234); }}
public class Verticle2 extends Verticle { @Override public void start() { RouteMatcher routeMatcher = new RouteMatcher(); routeMatcher.get("/test2", new Handler<HttpServerRequest>() { @Override public void handle(HttpServerRequest httpServerRequest) { httpServerRequest.response().end("TEST 2"); } }); vertx.createHttpServer().requestHandler(routeMatcher).listen(1234); }}--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
container.deployVerticle("Verticle1.java");
container.deployVerticle("Verticle2.java");
I know it could be a silly question - but how can I reach that? Because like I said I've tried to use:
container.deployVerticle("Verticle1.java");
container.deployVerticle("Verticle2.java");
But in this case it neither work,
vertx run Startup.java
OK, I think I'm understand that. So please confirm if I'm right. You have ONLY ONE Verticle class which can started HttpServer at port 80.
SEVERE: Exception in Java verticlejava.net.ConnectException: Connection refused: localhost/127.0.0.1:1234localhost:1234/verticle1localhost:1234/verticle2
It's very simple:
...For more options, visit <a
...
--
[HTTP-SERV] [DEPLOY] [SUCESS] in Verticle1 --> org.vertx.java.core.http.impl.DefaultHttpServer@3465bcf4[HTTP-SERV] [DEPLOY] [SUCESS] in Verticle2 --> org.vertx.java.core.http.impl.DefaultHttpServer@725edbc0...
...