title: Protocol Buffers Invalid embedded descriptor problem
body: <p>I'm having some problems at runtime with some of my generated protocol buffer classes.</p>
  
  <p>My project layout is as follows:  </p>
  
  <pre>
  module/
    protobuf-api/
      proto/
        com/foo/api/Service.proto
        com/foo/shared/Shared.proto
        org/bar/api/Message1.proto
        org/bar/api/Message2.proto
  </pre>
  
  <p>The Service.proto file depends on Shared.proto and some of the Message*.proto files. From the protobuf-api directory, I run the following command to compile:<br>
  <code>find . -name *.proto -exec protoc --java_out=java -I=proto {} \;</code></p>
  
  <p>When I attempt to run my Service, I get the following exception: </p>
  
  <pre>
  java.lang.ExceptionInInitializerError
      at com.linkedin.history.api.protobuf.HistoryServiceProtos$HistoryServiceQuery.(HistoryServiceProtos.java:544)
      at com.linkedin.history.api.serializer.HistoryServiceSerializer.serialize(HistoryServiceSerializer.java:47)
       at test.history.serializer.TestSerializer.testHistoryServiceQuery(TestSerializer.java:38)
      at test.fwk.util.core.BaseTestSuiteCore.run(BaseTestSuiteCore.java:304)
       at test.fwk.util.core.BaseTestSuiteConf.run(BaseTestSuiteConf.java:186)
      at test.fwk.lispring.BaseTestSuite.run(BaseTestSuite.java:232)
      at test.fwk.lispring.BaseTestSuite.callAppropriateRun(BaseTestSuite.java:265)
      at test.fwk.util.core.BaseTestSuiteCore.run(BaseTestSuiteCore.java:199)
  Caused by: java.lang.IllegalArgumentException: Invalid embedded descriptor for "com/linkedin/history/api/protobuf/HistoryService.proto".
       at com.google.protobuf.Descriptors$FileDescriptor.internalBuildGeneratedFileFrom(Descriptors.java:268)
       at com.linkedin.history.api.protobuf.HistoryServiceProtos.(HistoryServiceProtos.java:1794)
  Caused by: com.google.protobuf.Descriptors$DescriptorValidationException: com/linkedin/history/api/protobuf/HistoryService.proto: Dependencies passed to FileDescriptor.buildFrom() don't match those listed in the FileDescriptorProto.
       at com.google.protobuf.Descriptors$FileDescriptor.buildFrom(Descriptors.java:221)
       at com.google.protobuf.Descriptors$FileDescriptor.internalBuildGeneratedFileFrom(Descriptors.java:266)
  </pre>
  
  <p>I've read the post <a href="http://groups.google.com/group/protobuf/browse_thread/thread/c0bd926a8f5ba6f5/a03ac6747e07c494?lnk=raot" rel="nofollow noreferrer">here</a> but I think I'm doing everything correctly. Any suggestions on why I'm having the initializer errors? I'm compiling everything with the same -I flag.</p>