What it is also funny is that my file ADMObjectHandleMessage.proto
looks like this:

package com.qnamic.base.agent;
option java_outer_classname = "ADMObjectHandleMessage";
message ADMObjectHandle {
    optional string host = 1;
    optional string agent = 2;
    optional string path = 3;
    optional int64 admTopCreationTime = 4;
}

And the in descriptor has a whitespace in my ADMObjectHandleMessage
class:

  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String descriptorData =
      "\n\035ADMObjectHandleMessage.proto \022\025com.qna" +
      "mic.base.agent\"X\n\017ADMObjectHandle\022\014\n\004hos" +
      "t\030\001 \001(\t\022\r\n\005agent\030\002 \001(\t\022\014\n
\004path\030\003 \001(\t\022\032\n\022" +
      "admTopCreationTime\030\004 \001(\003B\030B\026ADMObjectHan" +
      "dleMessage";

So what you see here is "ADMObjectHandleMessage.proto " and not
"ADMObjectHandleMessage.proto". My other classes looks fine. The
problem is that I have AbstractADMAdapterMessage.proto using this:
package com.qnamic.planopt.base.query.adapter;
import "ADMObjectHandleMessage.proto";

message AbstractADMAdapter {
    required com.qnamic.base.agent.ADMObjectHandle objectHandle = 1;
    required bool adaptAll = 2;
    required bool fillObjectHandle = 3;
}

The problem is that when the descriptor of the second class gets
initialized I get an Exception in Descriptors.FileDescriptor.buildFrom
() saying:
Dependencies passed to FileDescriptor.buildFrom() don't match those
listed in the FileDescriptorProto.

because the name does not match with each other:
"ADMObjectHandleMessage.proto ".equals("ADMObjectHandleMessage.proto")

What am I doing wrong?

Tai

On 4 Aug., 19:49, Stefan <[email protected]> wrote:
> Are you using Windows by any chance?
>
> On Aug 4, 11:54 am, Tai <[email protected]> wrote:
>
> > I got a strange behaviour when compiling a protofile (e.g.
> > MyClass.proto). The generated java class is then called MyClassProto.
> > All other proto files works fine. As a workaround I have added the
> > following line to the proto file:
>
> > option java_outer_classname = "MyClass";
>
> > Any idea what I am doing wrong?
>
> > Thanks Tai
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to