Sorry for the possibly bad title but it is exactly as it says. I am new to Netty and this is my second attempt at a networked solution to what I am trying to do. The first solution straight java.nio UDP works but is inefficient and slower than I can stand.
I keep getting an error on start up and cannot find the solution. The error tells me that there is no such field Rendezvous in the class io.netty.channel.udt.nio.NioUdtProvider. From the javadocs it seems that this specifies what the thread does. Am I missing a jar? What happened? Can I get any pointers on how to solve this?
I am using Netty 4.0.0.1 CR1. It is the only release I found with that works with the examples. I also have barchart-udt-core-2.2.0, and jsch in my classpath.
The problem is occurring in my server's main class (not named main). At the following line.
final ThreadFactory connectionFactory=new UtilThreadFactory("connect");
final ThreadFactory acceptFactory=new UtilThreadFactory("accept");
final NioEventLoopGroup acceptGroup = new NioEventLoopGroup(1,acceptFactory,NioUdtProvider.MESSAGE_PROVIDER);
final NioEventLoopGroup connectGroup=new NioEventLoopGroup(1,connectionFactory,NioUdtProvider.MESSAGE_PROVIDER);
More specifically, the error occurs in the last two lines.
I receive the following error code when working with both the MsgEchoServer example and my NettyServer.
Nov 07, 2013 5:07:53 PM netty.NettyServer main
INFO: init
Exception in thread "main" java.lang.NoSuchFieldError: RENDEZVOUS
at io.netty.channel.udt.nio.NioUdtProvider.<clinit>(NioUdtProvider.java:68)
at netty.NettyServer.run(NettyServer.java:103)
at netty.NettyServer.main(NettyServer.java:191)
I have tried to find a netty 4x jar that contains these definitions, specifically a full Netty release but get the same or different errors.
My UtilThreadFactory code is below and is pretty much the same as from http://grepcode.com/file/repo1.maven.org/maven2/io.netty/netty-example/4.0.0.CR1/io/netty/example/udt/echo/message/MsgEchoServer.java?av=f
Thanks
UtilThread
package Netty;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
public class UtilThreadFactory implements ThreadFactory{
private static final AtomicInteger counter=new AtomicInteger();
private final String name;
public UtilThreadFactory(final String name)
{
this.name=name;
}
public Thread newThread(final Runnable runnable)
{
return new Thread(runnable,name+'-'+counter.getAndIncrement());
}
}
*UPDATE* I upgraded like requested and get the exact same error. I am now running Netty 4.0.12 with the jars 4.0.12 and 4.0.12-FINAL in my path. The same error occurs whether I have one or other jars and I cleared my eclipse cache. The same problem happens in STS spring tools. Any help is appreciated. Thanks
Thanks for all of the help. I found the culprit after moving all of the jars to my classpath and reading through their contents. Something was missing from the udt-core as apparently I had a few older versions. I really wish wildfly/the netty guys would document this a little better. I downloaded the udt-core jar and this solved the problem. The latest jars are difficult to find. They are at http://repo1.maven.org/maven2/com/barchart/udt/