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

Quarkus 1.5 grpc extension breaks infinispan client extension #9975

Closed
sean-scott-lr opened this issue Jun 12, 2020 · 5 comments
Closed

Quarkus 1.5 grpc extension breaks infinispan client extension #9975

sean-scott-lr opened this issue Jun 12, 2020 · 5 comments
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@sean-scott-lr
Copy link

sean-scott-lr commented Jun 12, 2020

Describe the bug
When using both the quarkus-grpc extension and the quarkus-infinispan extension, you will receive a No marshaller registered for Java type error

Expected behavior
The error does not occur

Actual behavior
When an item is put into, or retrieved from a cache, you receive an IllegalArgument exception that the proto marshaller isn't registered for the class

To Reproduce
Steps to reproduce the behavior:

  1. Create a new quarkus project with the infinispan client dependency
  2. Follow the infinispan client quick start guide... use the annotations approach described ( Author, Book, BookContextInitializer )
  3. Start an infinispan server and configure the connection properties in the application.properties file
  4. Utilize the cache
@Path("/hello")
public class ExampleResource {

    @Inject
    RemoteCacheManager remoteCacheManager;

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        Book b = new Book("a","b",5, Set.of(new Author("Sean","Scott")));
        getCache().put("hi",b);
        getCache().get("hi");
        return "hello";
    }

    public RemoteCache<String,Book> getCache(){
        return remoteCacheManager.administration().getOrCreateCache("myCache","*-cache");
    }

}
  1. Notice that the endpoint has no errors : http://localhost:8080/hello
  2. Add this dependency to your project ( and the protoc compiler dependencies described in the quarkus-grpc Quickstart )
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-grpc</artifactId>
    </dependency>
  1. Hit the endpoint again... notice this stack trace:
java.lang.IllegalArgumentException: No marshaller registered for Java type org.acme.Book
	at org.infinispan.protostream.impl.SerializationContextImpl.getMarshallerDelegate(SerializationContextImpl.java:279)
	at org.infinispan.protostream.WrappedMessage.writeMessage(WrappedMessage.java:240)
	at org.infinispan.protostream.ProtobufUtil.toWrappedByteArray(ProtobufUtil.java:181)
	at org.infinispan.protostream.ProtobufUtil.toWrappedByteArray(ProtobufUtil.java:176)
	at org.infinispan.commons.marshall.ProtoStreamMarshaller.objectToBuffer(ProtoStreamMarshaller.java:69)
	at org.infinispan.commons.marshall.AbstractMarshaller.objectToByteBuffer(AbstractMarshaller.java:70)
	at org.infinispan.client.hotrod.marshall.MarshallerUtil.obj2bytes(MarshallerUtil.java:99)
	at org.infinispan.client.hotrod.DataFormat.valueToBytes(DataFormat.java:98)
	at org.infinispan.client.hotrod.impl.RemoteCacheImpl.valueToBytes(RemoteCacheImpl.java:560)
	at org.infinispan.client.hotrod.impl.RemoteCacheImpl.putAsync(RemoteCacheImpl.java:375)
	at org.infinispan.client.hotrod.impl.InvalidatedNearRemoteCache.putAsync(InvalidatedNearRemoteCache.java:60)
	at org.infinispan.client.hotrod.impl.RemoteCacheImpl.put(RemoteCacheImpl.java:344)
	at org.infinispan.client.hotrod.impl.RemoteCacheSupport.put(RemoteCacheSupport.java:89)
	at org.acme.ExampleResource.hello(ExampleResource.java:24)

Configuration

# Add your application.properties here, if applicable.
quarkus.infinispan-client.near-cache-max-entries=1000
quarkus.infinispan-client.server-list=localhost:41222
quarkus.infinispan-client.client-intelligence=BASIC

Screenshots
(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

  • Output of uname -a or ver:
    Darwin USMACEA090SSCOT 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
  • Output of java -version:

➜ code-with-quarkus-2 java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)

  • GraalVM version (if different from Java):
  • Quarkus version or git rev:

1.5.1.Final

  • Build tool (ie. output of mvnw --version or gradlew --version):
    Apache Maven 3.6.3

Additional context
(Add any other context about the problem here.)

@sean-scott-lr sean-scott-lr added the kind/bug Something isn't working label Jun 12, 2020
@sean-scott-lr
Copy link
Author

sean-scott-lr commented Jun 12, 2020

Screen Shot 2020-06-12 at 10 52 52 AM
Just inifinispan-client.... NO grpc changes to pom.xml:

@sean-scott-lr
Copy link
Author

Screen Shot 2020-06-12 at 10 50 20 AM
After adding GRPC related changes to pom.xml

@sean-scott-lr
Copy link
Author

Ok, after seeing this problem yesterday and today... in both our app and the reproducer project. The problem has just stopped occurring in both projects. Stay tuned in case I figure out why.

@sean-scott-lr
Copy link
Author

mvn clean compile package verify
Seems to reliably reproduce the bug. I have also seen it with mvn package, mvn compile quarkus:dev and just mvn quarkus:dev . It seems once it gets into the broken state, it stays that way.

@sean-scott-lr
Copy link
Author

This issue is reproducible with just infinispan. Closing this into #9980

@gsmet gsmet added the triage/duplicate This issue or pull request already exists label Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants