Bean collision when both netty and netty-shaded exist in classpath
See original GitHub issueThe 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:
- Created 2 years ago
- Comments:6
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

FYI, please use
4.5.2thanks @jvmlet,
4.5.1seemed broken for some reason 🤔