首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >java.lang.IllegalArgumentException - 'other‘具有不同的根

java.lang.IllegalArgumentException - 'other‘具有不同的根
EN

Stack Overflow用户
提问于 2015-04-13 20:09:58
回答 1查看 3.4K关注 0票数 2

我正在使用Vertx编写一个java应用程序。我正在尝试使用以下代码部署我的一个模块。但我面对的是IllegalArgumentException,这是我无法解决的。

我的主类的一部分:

代码语言:javascript
复制
System.out.println(System.getProperty("user.dir")
                + File.separator + "modules" + File.separator
                + "agents-0.0.1-SNAPSHOT-mod.zip");
        InputStream agf = new FileInputStream(System.getProperty("user.dir")
                + File.separator + "conf" + File.separator
                + "dbproperties1.json");
            String json = IOUtils.toString( agf );
            LOGGER.debug("db json:::"+json);
        JsonObject configprop =  new JsonObject(json);
        pm.deployModuleFromZip(System.getProperty("user.dir")
                + File.separator + "modules" + File.separator
                + "agents-0.0.1-SNAPSHOT-mod.zip", configprop, 1,
                new AsyncResultHandler<String>() {
                    public void handle(AsyncResult<String> asyncResult) {
                        LOGGER.debug("Deployment agnet ID dddd");
                        if (asyncResult.succeeded()) {
                            LOGGER.debug("Deployment agnet ID is "
                                    + asyncResult.result());
                        } else {
                            LOGGER.debug("Deployment agnet  ID is null "
                                    + asyncResult.result());
                            asyncResult.cause().printStackTrace();
                        }
                    }
                }); 
        agf.close();

控制台错误如下:

代码语言:javascript
复制
java.lang.IllegalArgumentException: 'other' has different root
    at sun.nio.fs.WindowsPath.relativize(WindowsPath.java:392)
    at sun.nio.fs.WindowsPath.relativize(WindowsPath.java:44)
    at org.vertx.java.platform.impl.DefaultPlatformManager.setPathResolver(DefaultPlatformManager.java:1128)
    at org.vertx.java.platform.impl.DefaultPlatformManager.access$2000(DefaultPlatformManager.java:55)
    at org.vertx.java.platform.impl.DefaultPlatformManager$18.run(DefaultPlatformManager.java:1276)
    at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:171)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:353)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:366)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:745)

在这方面的任何帮助都将受到感谢。

EN

回答 1

Stack Overflow用户

发布于 2015-04-14 17:32:30

我找到了我的案例的解决方案。

对于vertx项目,项目中会有mod.json文件。它应该有以下json。

代码语言:javascript
复制
{
  "main": "com.company.agent.Manager",
  "preserve-cwd": true
}

"preserve-cwd": true提供帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29604972

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档