MyDeployingVerticle start some error

78 views
Skip to first unread message

振亚张

unread,
Mar 21, 2016, 4:00:18 AM3/21/16
to vert.x
hi:
i modidy the project /maven-service-factory-api, and copy the Runner.java into.

public class MyDeployingVerticle extends AbstractVerticle {


public static void main(String[] args) {

Runner.runExample(MyDeployingVerticle.class);

}


@Override

public void start(Future<Void> future) throws Exception {

System.setProperty("vertx.maven.localRepo", "/Users/zzy/Documents/work/maven/repository");

// The `my-verticle` is deployed using the following convention:

// `maven:` + groupId + `:` + artifactId + `:` + version + `::` + verticle name

vertx.deployVerticle("maven:io.vertx:maven-service-factory-verticle:3.2.1::my-verticle", ar -> {

if (ar.succeeded()) {

future.complete();

} else {

future.fail(ar.cause());

}

});

}

}


and i run mvn clean package install the project "maven-service-factory-verticle".

and run above the java code main. and throw an exception.


三月 21, 2016 3:52:09 下午 vertx-stack-resolver

信息: Resolving io.vertx:maven-service-factory-verticle:jar:3.2.1

三月 21, 2016 3:52:44 下午 io.vertx.core.Starter

严重: Failed in deploying verticle

java.lang.IllegalArgumentException: Cannot resolve artifact io.vertx:maven-service-factory-verticle:jar:3.2.1 in maven repositories: Could not find artifact io.vertx:maven-service-factory-verticle:jar:3.2.1 in repo0 (https://repo.maven.apache.org/maven2/)

at io.vertx.maven.resolver.ResolverImpl.resolve(ResolverImpl.java:276)

at io.vertx.maven.resolver.ResolverImpl.resolve(ResolverImpl.java:312)

at io.vertx.maven.MavenVerticleFactory.lambda$resolve$1(MavenVerticleFactory.java:113)

at io.vertx.maven.MavenVerticleFactory$$Lambda$7/1364767791.handle(Unknown Source)

at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$17(ContextImpl.java:296)

at io.vertx.core.impl.ContextImpl$$Lambda$9/1199673596.run(Unknown Source)

at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor.lambda$new$265(OrderedExecutorFactory.java:91)

at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor$$Lambda$6/1549725679.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)


any one can help me?

0661FC26-4B72-45A1-BA55-3934E7A9452B.png

振亚张

unread,
Mar 21, 2016, 4:05:15 AM3/21/16
to vert.x
the /Users/zzy/Documents/work/maven/repository/ 
23C922A2-AA34-4367-9A82-BD4E2EC0EC7E.png

振亚张

unread,
Mar 21, 2016, 4:36:13 AM3/21/16
to vert.x
the maven-servcie-factory-api pom.xml add dependency

<dependency>

<groupId>io.vertx</groupId>

<artifactId>vertx-maven-service-factory</artifactId>

<version>3.2.1</version>

</dependency>

02B3C440-0112-4FF8-B94F-5E0A85AE8EE8.png

Clement Escoffier

unread,
Mar 21, 2016, 4:41:13 AM3/21/16
to ve...@googlegroups.com
Hi,

Your application is looking for the "maven-service-factory-verticle”, not “maven-service-factory”. Make sure you built it beforehand as indicated on 

Clement

--
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.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/4cf2558b-1f09-425d-8196-03f85176c60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<02B3C440-0112-4FF8-B94F-5E0A85AE8EE8.png>

振亚张

unread,
Mar 21, 2016, 5:08:56 AM3/21/16
to vert.x
but how to run the projetct “/maven-service-factory-api”,i set application main class "io.vertx.core.Starter" and Arguaments"run io.vertx.examples.MyDeployingVerticle -cp target/maven-service-factory-api-3.2.1.jar"
run Debug throw the below exception:

三月 21, 2016 5:03:09 下午 io.vertx.core.Starter

严重: Failed in deploying verticle

java.lang.ClassNotFoundException: io.vertx:maven-service-factory-verticle:3.2.1::my-verticle

at java.net.URLClassLoader$1.run(URLClassLoader.java:372)

at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:360)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:42)

at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:186)

at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$157(DeploymentManager.java:159)

at io.vertx.core.impl.DeploymentManager$$Lambda$6/1418385211.handle(Unknown Source)

at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)

at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)

at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:132)

at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:104)

at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:92)

at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:546)

at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:510)

at io.vertx.examples.MyDeployingVerticle.start(MyDeployingVerticle.java:17)

at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$163(DeploymentManager.java:429)

at io.vertx.core.impl.DeploymentManager$$Lambda$7/282432134.handle(Unknown Source)

at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335)

at io.vertx.core.impl.ContextImpl$$Lambda$8/615634843.run(Unknown Source)

at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)

at java.lang.Thread.run(Thread.java:745)


在 2016年3月21日星期一 UTC+8下午4:41:13,clement escoffier写道:

Clement Escoffier

unread,
Mar 21, 2016, 5:11:24 AM3/21/16
to ve...@googlegroups.com
As stated on the link I sent you in my previous mail, you must build "https://github.com/vert-x3/vertx-examples/tree/master/maven-service-factory-examples/maven-service-factory-verticle” before. Build means: mvn clean install.

Clement

振亚张

unread,
Mar 21, 2016, 5:18:15 AM3/21/16
to vert.x
yes i run mvn clean install

[INFO] --- maven-install-plugin:2.4:install (default-install) @ maven-service-factory-verticle ---

[INFO] Installing /Users/zzy/Documents/work/workspaces/vertx-examples/maven-service-factory-examples/maven-service-factory-verticle/target/maven-service-factory-verticle-3.2.1.jar to /Users/zzy/Documents/work/maven/repository/io/vertx/maven-service-factory-verticle/3.2.1/maven-service-factory-verticle-3.2.1.jar

[INFO] Installing /Users/zzy/Documents/work/workspaces/vertx-examples/maven-service-factory-examples/maven-service-factory-verticle/pom.xml to /Users/zzy/Documents/work/maven/repository/io/vertx/maven-service-factory-verticle/3.2.1/maven-service-factory-verticle-3.2.1.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------ 

and modify the code ,notice the red code. point to the intalled repository。

public class MyDeployingVerticle extends AbstractVerticle {


@Override

public void start(Future<Void> future) throws Exception {

System.setProperty("vertx.maven.localRepo", "/Users/zzy/Documents/work/maven/repository");

// The `my-verticle` is deployed using the following convention:

// `maven:` + groupId + `:` + artifactId + `:` + version + `::` + verticle name

vertx.deployVerticle("maven:io.vertx:maven-service-factory-verticle:3.2.1::my-verticle", ar -> {

if (ar.succeeded()) {

future.complete();

} else {

future.fail(ar.cause());

}

});

}

}


but  the error still。


三月 21, 2016 5:14:31 下午 io.vertx.core.Starter

振亚张

unread,
Mar 21, 2016, 6:04:04 AM3/21/16
to vert.x
Who once ran this example?

Clement Escoffier

unread,
Mar 21, 2016, 6:05:26 AM3/21/16
to ve...@googlegroups.com
The example is run every week (automatically).

Clement 

On 21 mars 2016, at 11:04, 振亚张 <zhhz...@gmail.com> wrote:

Who once ran this example?

--
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.
Visit this group at https://groups.google.com/group/vertx.

Clement Escoffier

unread,
Mar 21, 2016, 6:09:28 AM3/21/16
to ve...@googlegroups.com
When setting the local repository location it’s too late (the value is cached). You must set it in the java command, or check how it can be set programmatically on http://vertx.io/docs/vertx-maven-service-factory/

Clement

--
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.
Visit this group at https://groups.google.com/group/vertx.

振亚张

unread,
Mar 22, 2016, 3:05:59 AM3/22/16
to vert.x
can you guide me how to run the project “/maven-service-factory-api”。I still have the trouble.


在 2016年3月21日星期一 UTC+8下午6:09:28,clement escoffier写道:
Reply all
Reply to author
Forward
0 new messages