MashaTelyatnikova / protobuf-socket-rpc

Automatically exported from code.google.com/p/protobuf-socket-rpc
MIT License
0 stars 0 forks source link

Exception in thread "main" java.lang.ExceptionInInitializerError #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

file: service.proto
---------
import "rpc.proto";

option java_package = "com.common.service";
option java_outer_classname = "ServiceProtos";

service HelloService {
  rpc say (Request) returns (Response);
}
--------- 
main method :
---------
public static void main(String[] args) {
        ServerRpcConnectionFactory rpcConnectionFactory = SocketRpcConnectionFactories.createServerRpcConnectionFactory(12345);
        RpcServer rpcServer = new RpcServer(rpcConnectionFactory, Executors.newFixedThreadPool(10), false);     
        rpcServer.registerService( ServiceProtos.HelloService.newReflectiveService(new HelloServiceImpl()));    
        rpcServer.run();
    }
---------
HelloServiceImpl:
----------
public class HelloServiceImpl implements ServiceProtos.HelloService.Interface {
    @Override
    public void say(RpcController controller, Request request, RpcCallback<Response> done) {
        int i=0;
        i=1;    
    }
}

What is the expected output? What do you see instead?
EXPECTED: A server is running on localhost and listening to the port 12345.

NOT EXPECTED: Exception raised with the method called 
rpcServer.registerService(...).
Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.common.service.ServiceProtos$HelloService.getDescriptor(ServiceProtos.java:106)
    at com.common.service.ServiceProtos$HelloService.getDescriptorForType(ServiceProtos.java:110)
    at com.googlecode.protobuf.socketrpc.RpcForwarder.registerService(RpcForwarder.java:61)
    at com.googlecode.protobuf.socketrpc.RpcServer.registerService(RpcServer.java:90)
    at protocolbuf.server.MainServer.main(MainServer.java:26)
Caused by: java.lang.IllegalArgumentException: Invalid embedded descriptor for 
"service.proto".
    at com.google.protobuf.Descriptors$FileDescriptor.internalBuildGeneratedFileFrom(Descriptors.java:286)
    at com.common.service.ServiceProtos.<clinit>(ServiceProtos.java:254)
    ... 5 more
Caused by: com.google.protobuf.Descriptors$DescriptorValidationException: 
HelloService.say: ".Request" is not defined.
    at com.google.protobuf.Descriptors$DescriptorPool.lookupSymbol(Descriptors.java:1693)
    at com.google.protobuf.Descriptors$MethodDescriptor.crossLink(Descriptors.java:1469)
    at com.google.protobuf.Descriptors$MethodDescriptor.access$2200(Descriptors.java:1407)
    at com.google.protobuf.Descriptors$ServiceDescriptor.crossLink(Descriptors.java:1388)
    at com.google.protobuf.Descriptors$ServiceDescriptor.access$600(Descriptors.java:1317)
    at com.google.protobuf.Descriptors$FileDescriptor.crossLink(Descriptors.java:371)
    at com.google.protobuf.Descriptors$FileDescriptor.buildFrom(Descriptors.java:237)
    at com.google.protobuf.Descriptors$FileDescriptor.internalBuildGeneratedFileFrom(Descriptors.java:284)
    ... 6 more

What version of the product are you using? On what operating system?
latest from the SVN

Please provide any additional information below.
nothing

Original issue reported on code.google.com by corentin...@gmail.com on 6 Oct 2010 at 7:41