question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[protobuf] . can't resolve inner types

See original GitHub issue

When messages are defined as below, the parser failed to resolve t1.i1 type.

package mypackage;

message t1 {
        message i1 {
                optional uint32 x = 1;
                optional uint32 y = 2;
        }
}

message t2 {
        optional t1.i1 z = 1;
}

Error

Exception in thread "main" java.lang.IllegalArgumentException: Unknown protobuf field type 't1.i1' for field 'z' of MessageType 't2' (known enum types: ; known message types: t1, t2)
	at com.fasterxml.jackson.dataformat.protobuf.schema.TypeResolver._resolve(TypeResolver.java:141)
	at com.fasterxml.jackson.dataformat.protobuf.schema.TypeResolver.resolve(TypeResolver.java:93)
	at com.fasterxml.jackson.dataformat.protobuf.schema.NativeProtobufSchema.forType(NativeProtobufSchema.java:67)
	at com.fasterxml.jackson.dataformat.protobuf.schema.ProtobufSchemaLoader.load(ProtobufSchemaLoader.java:51)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cowtowncodercommented, Dec 5, 2018

@knoguchi I was hoping to fix this along with #140, as I now understand the issue finally (it has been a while but I got back to here). Scoped resolution works with latest fixes but only in certain orders of traversal; I’ll have to rewrite code a bit. Should get done for 2.10.0 however, need to get 2.9.8 out first.

0reactions
knoguchicommented, May 16, 2017

I just noticed FieldElement or DataType.NamedType class does not have methods that returns qualified name or type unlike TypeElement class that has .qualifiedName(). So we still need type resolution for the fields.

Looks like the Wire, the successor of the ProtoParser, was created for the very reason.

I hope someday ProtoParser will be replaced for Wire in this project. For now, I decided to use other solutions. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Guide (proto3) | Protocol Buffers - Google Developers
Defining A Message Type; Scalar Value Types; Default Values; Enumerations; Using Other Message Types; Nested Types; Updating A Message Type; Unknown Fields ...
Read more >
Protobuf message in inner package cannot be imported
I'm trying to generate Java code for a proto message that has a reference to another message in a deeper package. When generating...
Read more >
Null nested messages · Issue #35 · protobuf-net ... - GitHub
This makes ProtoStuff look into the Schema and find that field 11 is of type Location and it starts handling the nested message....
Read more >
protobufjs - npm
protobuf.js is a pure JavaScript implementation with TypeScript support for node.js and the browser. It's easy to use, blazingly fast and works ...
Read more >
Package com.google.protobuf | Java client library
Protobuf library provides support to pack/unpack Any values in the form of utility ... Extended type Inner type Extension Use registry.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found