简体   繁体   English

找不到 Java netty io/netty/channel/EventLoopGroup

[英]Java netty io/netty/channel/EventLoopGroup not found

I get an exception我得到一个例外

Caused by: java.lang.ClassNotFoundException: io.netty.channel.EventLoopGroup引起:java.lang.ClassNotFoundException:io.netty.channel.EventLoopGroup

when trying to start my server from runnable jar file, it works fine in IDE, but not in jar version.当尝试从可运行的 jar 文件启动我的服务器时,它在 IDE 中运行良好,但在 jar 版本中运行不正常。 I don't understand why this is happening.我不明白为什么会这样。 What is missing here ?这里缺少什么? I use intellij and maven.我使用intellij和maven。

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>Tcp-Server-listener-application</groupId>
<artifactId>TCPSLA</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Listener</name>

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>4.1.29.Final</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>de.saxsys</groupId>
        <artifactId>mvvmfx</artifactId>
        <version>1.7.0</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.5</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.6.4</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cassandra</groupId>
        <artifactId>cassandra-all</artifactId>
        <version>0.8.1</version>

        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
        </exclusions>

    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>Source.Main</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.18</version>
            <executions>
                <execution>
                    <id>integration-tests</id>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

While I can offer no explanation as to why it compiles, as did mine, but fails at runtime, I can offer a solution that worked for me:虽然我无法解释它为什么编译,就像我的一样,但在运行时失败,但我可以提供一个对我有用的解决方案:

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>5.0.0.Alpha2</version>
</dependency>

Apparently, '4.1.29.Final' does not include EventLoopGroup显然,'4.1.29.Final' 不包括 EventLoopGroup

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Netty中通过多个渠道使用EventLoopGroup - Using EventLoopGroup in Netty with Multiple Channels java.lang.NoSuchMethodError: io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/DefaultChannelId; - java.lang.NoSuchMethodError: io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/DefaultChannelId; 如何在Reactor Netty中处理io.netty.channel.ConnectTimeoutException - How to handle in Reactor Netty an io.netty.channel.ConnectTimeoutException Netty中的阻塞IO(OIO)UDT通道 - Blocking IO (OIO) UDT Channel in Netty 引起原因:java.lang.RuntimeException:java.io.NotSerializableException:io.netty.channel.DefaultChannelHandlerContext - Caused by: java.lang.RuntimeException: java.io.NotSerializableException: io.netty.channel.DefaultChannelHandlerContext Java Netty 跨通道通信失败 - Java Netty Cross channel communication failed 当我尝试使用 closeFuture() 关闭 io.netty.channel.Channel 时,Netty 应用程序挂起 - Netty app hangs when I try to close a io.netty.channel.Channel using closeFuture() Netty,java.io.StreamCorruptedException:不支持的版本:0 - Netty, java.io.StreamCorruptedException: Unsupported version: 0 e = java.lang.IllegalArgumentException:找不到匹配的字段:类org.jboss.netty.channel.DefaultChannelFuture的同步 - e=java.lang.IllegalArgumentException: No matching field found: sync for class org.jboss.netty.channel.DefaultChannelFuture Netty 4.0.19。io.netty.channel.ChannelOutboundBuffer $ Entry的最终内存泄漏 - Netty 4.0.19.Final Memory Leak with io.netty.channel.ChannelOutboundBuffer$Entry
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM