Skip to content

Consider options to handle protobuf-java library mismatches between client and hosting applications #131

@jkebinger

Description

@jkebinger

We can see errors like

Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class cloud.prefab.domain.Prefab$StringList tried to access method 'com.google.protobuf.LazyStringArrayList com.google.protobuf.LazyStringArrayList.emptyList()' (cloud.prefab.domain.Prefab$StringList and com.google.protobuf.LazyStringArrayList are in unnamed module of loader 'app') [in thread "Thread-3"]
	at cloud.prefab.domain.Prefab$StringList.<init>(Prefab.java:6215) ~[app.jar:?]
	at cloud.prefab.domain.Prefab$StringList.<clinit>(Prefab.java:6719) ~[app.jar:?]

if the hosting application containing the prefab-java client has a different protobuf-java version than the client's proto code was generated with.

It would be nice to take action so that this isn't something we need to manage carefully over time. Maven shading/relocation is one obvious option to research -- notably we need to learn if that'll have any impact on our internal java api code that manages these same protos, sourced from the client relative to other protobuf-java users like all of the google cloud libraries.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions