io.vertx.core.spi.VerticleFactory: Provider io.vertx.lang.ceylon.CeylonVerticleFactory not a subtype

80 views
Skip to first unread message

Евгений Мартын

unread,
Sep 5, 2016, 11:57:58 AM9/5/16
to vert.x
Hi,

I have java maven project "launcher" :

package launcher;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.json.JsonObject;

public class Deployer {
   
   
public static void deployVerticle(String verticle, HashMap<String,String> dOptions){
       
System.out.println("start deployVerticle");
       
try {
           
File current = new File(".").getCanonicalFile();
           
System.out.println(current.toString());    
           
System.setProperty("vertx.cwd", current.toString());
       
} catch (IOException e) {
            e
.printStackTrace();
       
}

       
// ClusterManager mgr = new HazelcastClusterManager();
       
VertxOptions options = new VertxOptions().setClustered(true);// .setClusterManager(mgr);

       
Vertx.clusteredVertx(options, res->{
           
if (res.succeeded()) {
               
Vertx vertx = res.result();
               
try {
                   
                   
JsonObject jObject = new JsonObject();
                    dOptions
.forEach((key,value)->{
                        jObject
.put(key, value);
                   
});
                   
                    vertx
.deployVerticle(
                            verticle
,
                           
new DeploymentOptions().setConfig(jObject)                            
                   
);
                   
               
} catch (Throwable t) {
                    t
.printStackTrace();
               
}
               
           
} else {
                res
.cause().printStackTrace();
           
}
       
});
       
System.out.println("finish deployVerticle");
   
}
   
   
public static void main(String[] arg){
        deployVerticle
("ceylon:ru.dellin.math.solver.gurobi.client.launcher/1.0.0",new HashMap<String,String>());
   
}
}


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
<modelVersion>4.0.0</modelVersion>
 
<groupId>ru.dellin.math.solver.gurobi.client</groupId>
 
<artifactId>launcher</artifactId>
 
<version>1.0.0</version>
 
<packaging>jar</packaging>
 
<name>launcher</name>
 
<description>module for deploying ceylon verticle</description>
 
 
<build>
       
<plugins>
           
<plugin>
               
<artifactId>maven-compiler-plugin</artifactId>
               
<version>3.3</version>
               
<configuration>
                   
<executable><!--path-to-your-java8-home-directoru--></executable>
                   
<compilerVersion>1.8</compilerVersion>
                   
<source>1.8</source>
                   
<target>1.8</target>
               
</configuration>
           
</plugin>
           
<!-- Maven Assembly Plugin -->
           
<plugin>
               
<groupId>org.apache.maven.plugins</groupId>
               
<artifactId>maven-assembly-plugin</artifactId>
               
<version>2.4.1</version>
               
<configuration>
                   
<descriptorRefs>
                       
<descriptorRef>jar-with-dependencies</descriptorRef>
                   
</descriptorRefs>
               
</configuration>
               
<executions>
                   
<execution>
                       
<id>make-assembly</id>
                       
<phase>package</phase> <!-- bind to the packaging phase -->
                       
<goals>
                           
<goal>single</goal>
                       
</goals>
                   
</execution>
               
</executions>
           
</plugin>
       
</plugins>
   
</build>

   
<dependencies>
       
<dependency>
           
<groupId>io.vertx</groupId>
           
<artifactId>vertx-hazelcast</artifactId>
           
<version>3.2.1</version>
       
</dependency>
       
<dependency>
           
<groupId>io.vertx</groupId>
           
<artifactId>vertx-core</artifactId>
           
<version>3.2.1</version>
       
</dependency>
   
</dependencies>
 
</project>

and Ceylon project "test" with module "verticle":

native("jvm")
module verticle "1.0.0" {
    shared
import io.vertx.ceylon.core "3.2.2";
    shared
import launcher "1.0.0";
}

import java.lang {
   
JString=String
}
import java.util {
   
HashMap
}

import launcher {
   
Deployer
}

"Run the module `verticle`."
shared
void run(){    
}

shared
void testRun() {
   
HashMap<JString,JString> dOptions  = HashMap<JString,JString>();
   
   
Deployer.deployVerticle(
       
"ceylon:verticle/1.0.0",
        dOptions
   
);
}

import io.vertx.ceylon.core {
   
Verticle
}

shared
class TestVerticle() extends Verticle() {
    shared actual
void start(){
       
print("-- TestVerticle --");
   
}
}

When I run testRun() from module "verticle" everything is fine. But if I create other ceylon project "test2" with module "runner":

native("jvm")
module runner "1.0.0" {
    shared
import verticle "1.0.0";
}

import verticle {
    testRun
}

"Run the module `runner`."
shared
void run() {
    testRun
();
}

and run run() from this module I get error:

Exception in thread "main" java.util.ServiceConfigurationError: io.vertx.core.spi.VerticleFactory: Provider io.vertx.lang.ceylon.CeylonVerticleFactory not a subtype
    at java
.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java
.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java
.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java
.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java
.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at io
.vertx.core.impl.DeploymentManager.loadVerticleFactories(DeploymentManager.java:56)
    at io
.vertx.core.impl.DeploymentManager.<init>(DeploymentManager.java:51)
    at io
.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:139)
    at io
.vertx.core.impl.VertxFactoryImpl.clusteredVertx(VertxFactoryImpl.java:49)
    at io
.vertx.core.Vertx.clusteredVertx(Vertx.java:101)
    at launcher
.Deployer.deployVerticle(Deployer.java:27)
    at verticle
.testRun_.testRun(run.ceylon:19)
    at runner
.run_.run(run.ceylon:7)
    at runner
.run_.main(run.ceylon)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:498)
    at ceylon
.modules.api.runtime.SecurityActions.invokeRunInternal(SecurityActions.java:57)
    at ceylon
.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:48)
    at ceylon
.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:68)
    at ceylon
.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:105)
    at ceylon
.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:101)
    at ceylon
.modules.Main.execute(Main.java:69)
    at ceylon
.modules.Main.main(Main.java:42)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:498)
    at org
.jboss.modules.Module.run(Module.java:308)
    at org
.jboss.modules.Main.main(Main.java:487)
    at ceylon
.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:281)
    at com
.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:520)
    at com
.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:405)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:498)
    at com
.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:115)
    at com
.redhat.ceylon.launcher.Launcher.run(Launcher.java:41)
    at com
.redhat.ceylon.launcher.Launcher.run(Launcher.java:34)
    at com
.redhat.ceylon.launcher.Launcher.main(Launcher.java:27)


what could it be?

Евгений Мартын

unread,
Sep 8, 2016, 6:02:30 PM9/8/16
to vert.x
Does anyone know what it means: Provider io.vertx.lang.ceylon.CeylonVerticleFactory not a subtype ?
Reply all
Reply to author
Forward
0 new messages