【问题标题】:ClassNotFoundException when start tyrus standalone server启动 tyrus 独立服务器时出现 ClassNotFoundException
【发布时间】:2016-07-09 18:04:18
【问题描述】:

我在server.start() 调用时收到以下错误:

ClassNotFoundException: org.glassfish.tyrus.container.grizzly.server.GrizzlyServerContainer

我也找不到 GrizzlyServerContainer 的 maven 依赖项。

有什么想法吗?这是我的代码:

private WebSocketModulManager() {
        server = new Server("127.0.0.1", 30000, "/lightconsole", null, LightconsoleEndpoint.class);
        try {
            server.start();
        } catch (DeploymentException e) {
            e.printStackTrace();
        } finally {
            server.stop();
        }
    }

Maven Dependecies

【问题讨论】:

    标签: java maven classnotfoundexception grizzly tyrus


    【解决方案1】:

    试试这个依赖:

    <dependency>
        <groupId>org.glassfish.tyrus</groupId>
        <artifactId>tyrus-container-grizzly-server</artifactId>
        <version>1.13</version>
    </dependency>
    

    【讨论】:

    • 是的,我已经这样做了,但看起来 Intellij 不处理我的 pom 文件。所有其他部门都通过 Intellij 项目配置
    • 我从 IntelliJ 依赖管理切换到直接的 maven pom 文件。没有解决所有依赖问题。
    • 如果你有 &lt;scope&gt;test&lt;/scope&gt; 然后从所有 tyrus 依赖项中删除它。我有同样的问题并删除它,问题得到了解决
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-16
    • 1970-01-01
    相关资源
    最近更新 更多