2015-10-05 48 views
2

使用vertx.io 3.0.0和Java 1.8.0_60Vertx.io start從Java服務器啓動JS Verticle

我試圖從JAVA啓動一個javascript verticle。我發現以下文檔here顯示瞭如何做到這一點。但在我目前的情況下,它實際上並不奏效。

//main class 
vertx.deployVerticle("com.mycompany.services.DiscountServices"); 
vertx.deployVerticle("com.mycompanyservices.SupplierServices"); 
vertx.deployVerticle("com.mycompany.services.ReportTypeServices"); 
vertx.deployVerticle("RELATIVE_PATH_TO_FILE/verticle.js"); 

//verticle.js 
// from the example: http://vertx.io/docs/vertx-core/js/#_writing_verticles 
declare var vertx;  
var eb = new vertx.EventBus() 
eb.consumer("cbweb.validation", (message:any) => { 
    console.log(message); 
}); 
console.log("Validation.js ready") 

在此背景下java的垂直(前三)的正確啓動,當JS verticle是叫我有以下錯誤java.lang.ClassNotFoundException

  • 的文件路徑是正確的。
  • 試圖用js:前綴路徑來調用正確的加載程序沒有任何機會。

有關如何做到這一點的任何想法?

回答

2

我問了關於google group for Vertx.io的問題。這是根據問題確定的答案。

如果你使用Maven:

<dependency> 
    <groupId>io.vertx</groupId> 
    <artifactId>vertx-lang-js</artifactId> 
    <version>3.0.0</version> 
</dependency> 

搖籃:

io.vertx:vertx-lang-js:3.0.0