Skip to content

Throwing nosuchmethod error #43

@ghost

Description

I am writing own minecraft server and currently writing unit tests for my protocol implementation. The best way to be sure that all is fine use external library. Here my unit test:

    public void testPing() {
        MinecraftProtocol protocol = new MinecraftProtocol(ProtocolMode.STATUS);
        Client client = new Client("localhost", 25565, protocol, new TcpSessionFactory());
        client.getSession().setFlag(
                ProtocolConstants.SERVER_INFO_HANDLER_KEY, (ServerInfoHandler) (session, info) -> {
            assertEquals("Test", info.getDescription().getFullText());
            assertEquals("1.7.4", info.getVersionInfo().getVersionName());
            assertEquals(5, info.getVersionInfo().getProtocolVersion());
            assertEquals(2, info.getPlayerInfo().getOnlinePlayers());
            assertEquals(10, info.getPlayerInfo().getMaxPlayers());
        });

        client.getSession().connect();
    }

Exception:

java.lang.NoSuchMethodError: io.netty.bootstrap.Bootstrap.channel(Ljava/lang/Class;)Lio/netty/bootstrap/Bootstrap;
    at org.spacehq.packetlib.tcp.TcpSessionFactory.createClientSession(TcpSessionFactory.java:37)
    at org.spacehq.packetlib.Client.<init>(Client.java:19)
    at ru.ensemplix.server.ping.TestPing.testPing(TestPing.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)

Library was added to my project by your maven repository. Would be very thankful for fixing this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions