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

how to can exclude grpc-inprocess #1097

Closed
shalk opened this issue Apr 25, 2024 · 0 comments · Fixed by #1102
Closed

how to can exclude grpc-inprocess #1097

shalk opened this issue Apr 25, 2024 · 0 comments · Fixed by #1102
Labels
bug Something does not work as expected

Comments

@shalk
Copy link
Contributor

shalk commented Apr 25, 2024

The context

What do you wish to achieve?

I want to exclude grpc-inprocess in client.

    <dependency>
      <groupId>net.devh</groupId>
      <artifactId>grpc-client-spring-boot-starter</artifactId>
      <version>3.1.0.RELEASE</version>
      <exclusions>
        <exclusion>
          <artifactId>grpc-inprocess</artifactId>
          <groupId>io.grpc</groupId>
        </exclusion>
      </exclusions>
    </dependency>

The bug

What's the problem? What's not working? What do you expect to happen.

when i run my App, it will fail with Exception.

Because the InProcessChannelFactory is hard code into GrpcClientAutoConfiguration.

Stacktrace and logs

Is there a stacktrace or a hint in the logs? (very important)
Screenshots work as well, but don't screenshot your logs.

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.devh.boot.grpc.client.channelfactory.GrpcChannelFactory]: Factory method 'shadedNettyGrpcChannelFactory' threw exception with message: io/grpc/inprocess/InProcessChannelBuilder
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:177)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644)
	... 36 common frames omitted
Caused by: java.lang.NoClassDefFoundError: io/grpc/inprocess/InProcessChannelBuilder
	at net.devh.boot.grpc.client.autoconfigure.GrpcClientAutoConfiguration.shadedNettyGrpcChannelFactory(GrpcClientAutoConfiguration.java:160)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140)
	... 37 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.grpc.inprocess.InProcessChannelBuilder
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 43 common frames omitted

Steps to Reproduce

Steps to reproduce the behavior:

  1. create spring boot App with stub client
  2. exclude grpc-inprocess
  3. run the App

The application's environment

Which versions do you use?

  • Spring (boot):
  • grpc-java:
  • grpc-spring-boot-starter:
  • java: version + architecture (64bit?)
  • Other relevant libraries...

Additional context

  • Did it ever work before?
  • Do you have a demo?
@shalk shalk added the bug Something does not work as expected label Apr 25, 2024
@shalk shalk changed the title usage about grpc-inprocess how to can exclude grpc-inprocess Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant