Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix protobuf relocation of com.google.rpc classes #507

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

XN137
Copy link
Contributor

@XN137 XN137 commented Jan 10, 2024

in our project (which uses grpc-java and protobuf-java) after we added a dependency on cel-standalone 0.4.3 we started seeing these runtime errors in mostly unrelated tests:

java.lang.NoSuchMethodError: 'com.google.rpc.Status$Builder com.google.rpc.Status$Builder.addDetails(com.google.protobuf.Any)'

in the debugger it was found that com.google.rpc.Status was being loaded from cel-standalone-0.4.3.jar and thus incompatible with the "normally loaded" com.google.protobuf.Any type.

Since the standalone build tries to relocate protobuf i am guessing these com.google classes were unintentionally included:

unzip -l ~/.m2/repository/org/projectnessie/cel/cel-standalone/0.4.3/cel-standalone-0.4.3.jar | grep -v projectnessie
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2023-11-21 16:43   META-INF/
      234  2023-11-21 16:43   META-INF/MANIFEST.MF
        0  2023-11-21 16:43   org/
        0  2023-11-21 16:43   META-INF/maven/
        0  2023-11-21 16:43   META-INF/maven/org.antlr/
        0  2023-11-21 16:43   META-INF/maven/org.antlr/antlr4-runtime/
     3552  2023-09-04 22:10   META-INF/maven/org.antlr/antlr4-runtime/pom.xml
       59  2023-09-04 22:10   META-INF/maven/org.antlr/antlr4-runtime/pom.properties
        0  2023-11-21 16:43   com/
        0  2023-11-21 16:43   com/google/
        0  2023-11-21 16:43   com/google/rpc/
    13252  2023-11-21 16:43   com/google/rpc/HttpHeader.class
(...)
     2589  2023-11-21 16:43   com/google/rpc/Status$1.class
      889  2023-11-21 16:43   com/google/rpc/BadRequestOrBuilder.class
    15910  2023-11-21 16:43   com/google/rpc/HttpRequest.class
    15623  2023-11-21 16:43   com/google/rpc/HttpResponse.class
    13472  2023-11-21 16:43   com/google/rpc/LocalizedMessage.class
     2622  2023-11-21 16:43   com/google/rpc/ErrorInfo$1.class
    22279  2023-11-21 16:43   com/google/rpc/BadRequest$Builder.class
        0  2023-11-21 16:43   com/google/api/
        0  2023-11-21 16:43   com/google/api/expr/
        0  2023-11-21 16:43   com/google/api/expr/v1alpha1/
(...)
      864  2023-11-21 16:43   com/google/api/expr/v1alpha1/Type$AbstractTypeOrBuilder.class
        0  2023-11-21 16:43   google/
        0  2023-11-21 16:43   google/protobuf/
     6154  1985-02-01 00:00   google/protobuf/any.proto
     7728  1985-02-01 00:00   google/protobuf/api.proto
    49985  1985-02-01 00:00   google/protobuf/descriptor.proto
     4892  1985-02-01 00:00   google/protobuf/duration.proto
     2363  1985-02-01 00:00   google/protobuf/empty.proto
     8185  1985-02-01 00:00   google/protobuf/field_mask.proto
     2341  1985-02-01 00:00   google/protobuf/source_context.proto
     3778  1985-02-01 00:00   google/protobuf/struct.proto
     6449  1985-02-01 00:00   google/protobuf/timestamp.proto
     6367  1985-02-01 00:00   google/protobuf/type.proto
     4044  1985-02-01 00:00   google/protobuf/wrappers.proto

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 on this change. protobuf and grpc classes must be stay, otherwise it would not be possible to use CEL with protobuf objects.

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore my previous comment

@XN137 XN137 marked this pull request as ready for review January 10, 2024 15:16
@XN137 XN137 merged commit 3772614 into projectnessie:main Jan 10, 2024
4 checks passed
@XN137 XN137 deleted the fix-protobuf-relocation branch January 10, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants