Hello. I'm running the following code under the avro 1.2.0 release and
jdk 1.6.0_10.
public interface ISink
{
public void send( String msg );
}
public class Sink implements ISink
{
public void send( String msg )
{
}
}
public void test()
{
SocketServer server =
new SocketServer(new SpecificResponder(
ISink.class, new Sink()), new InetSocketAddress(3333));
SocketTransceiver client =
new SocketTransceiver(new InetSocketAddress(server.getPort()));
ISink proxy = (ISink)SpecificRequestor.getClient(ISink.class,
client);
for (int i = 0; i < 1000; i++ )
{
proxy.send("testing");
}
client.close();
server.close();
}
First I was getting errors until I learned of paranamer.
I thought I read in the doc, that no pre-processing would be necessary?
I'm fine with having to run paranamer, but want to be sure that it is
required?
Now after processing with paranamer I get the following error trying to
run...
Exception in thread "main" java.lang.NullPointerException
at
org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:259)
at
org.apache.avro.reflect.ReflectData.createFieldSchema(ReflectData.java:3
03)
at
org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:291)
at
org.apache.avro.reflect.ReflectData.createFieldSchema(ReflectData.java:3
03)
at
org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:291)
at
org.apache.avro.reflect.ReflectData.getMessage(ReflectData.java:339)
at
org.apache.avro.reflect.ReflectData.getProtocol(ReflectData.java:318)
at
org.apache.avro.reflect.ReflectResponder.<init>(ReflectResponder.java:45
)
at
org.apache.avro.reflect.ReflectResponder.<init>(ReflectResponder.java:41
)
//
org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:259)
} else if (type instanceof Class) {
Class c = (Class)type;
String name = c.getSimpleName();
>> String space = c.getPackage().getName();
if (c.getEnclosingClass() != null) // nested class
space = c.getEnclosingClass().getName() + "$";
String fullName = c.getName();
Schema schema = names.get(fullName);
if (schema == null) {
Stepping though the debugger, the type appears to be "class [C", with
the name "value". I assume that is the "value" char[] in the String
msg.
Should a Class of type "class [C", return a package of null?
If so, any idea what I'm doing incorrectly?
Thank you.
Marko.
.