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.

Bean collision when both netty and netty-shaded exist in classpath

See original GitHub issue
The bean 'nettyServerBuilder', defined in class path resource
[org/lognet/springboot/grpc/autoconfigure/ShadedNettyConfiguration.class], could not be registered.
A bean with that name has already been defined in class path resource 
[org/lognet/springboot/grpc/autoconfigure/PureNettyConfiguration.class] and overriding is disabled.

We happen to get both io.grpc:grpc-netty and io.grpc:grpc-netty-shaded as transitive dependencies. nettyServerBuilder gets created for each of those deps in the configuration classes listed above. Can we add a @ConditionalOnMissingBean on either of them? I’m not sure if one is better to use over the other.

I tried to use the following code to disable the configuration, but apparently this only works on auto-configuration classes:

@SpringBootApplication(exclude = {PureNettyConfiguration.class})

I don’t seem to be able to use a component scan exclude filter either. I guess because the auto-configuration imports both configurations directly, e.g.

@ComponentScan(
    excludeFilters = {
      @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = PureNettyConfiguration.class)
    })

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jvmletcommented, Jun 2, 2021

FYI, please use 4.5.2

0reactions
dimi-nkcommented, Jun 2, 2021

thanks @jvmlet, 4.5.1 seemed broken for some reason 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble-Shooting | grpc-spring-boot-starter - GitHub Pages
There is no (compatible) netty TLS implementation available on the classpath. The Solution. Either switch from grpc-netty to grpc-netty-shaded or add a ...
Read more >
dhuaqiao/grpc-spring-boot-starter - Gitee
Exposed on internal network IP as well with predefined port 6767 . In case you have both shaded and pure netty libraries in...
Read more >
Spring Boot Starter Module for GRPC Framework - Morioh
Both libraries' presence on classpath is also supported with grpc.netty-server.on-collision-prefer-shaded-netty property. If you are using Spring Boot ...
Read more >
Management & Monitoring - Micronaut Documentation
Micronaut GCP 4.2.0 updates to grpc-auth 1.45.1 and grpc-netty-shaded . ... result in both implementations in the runtime classpath of your application.
Read more >
Apache HBase ™ Reference Guide
Finally, remove existing configuration for hbase.tmp.dir and ... This advanced quickstart adds two more nodes to your cluster.
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