You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "lqscript (via GitHub)" <gi...@apache.org> on 2025/05/09 03:59:46 UTC
[I] [Bug] Application-level service discovery fails when IDL `package` and `java_package` differ [dubbo]
lqscript opened a new issue, #15365:
URL: https://github.com/apache/dubbo/issues/15365
### Pre-check
- [x] I am sure that all the content I provide is in English.
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
Dubbo Java 3.3.1
JDK 17
Nacos 2.5.1
### Steps to reproduce this issue
[Application-level service discovery fails when IDL `package` and `java_package` differ](https://github.com/lqscript/dubbo-samples/tree/master/1-basic/dubbo-samples-spring-boot-idl)
org.apache.dubbo.rpc.RpcException: No provider available from registry RegistryDirectory(registry: 127.0.0.1:8848)-Directory(invokers: 0[], validInvokers: 0[], invokersToReconnect: 0[]) for service org.apache.dubbo.springboot.demo.idl.Greeter on consumer 10.94.201.88 use dubbo version 3.3.1, please check status of providers(disabled, not registered or in blocklist).
at org.apache.dubbo.registry.integration.DynamicDirectory.doList(DynamicDirectory.java:204) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.rpc.cluster.directory.AbstractDirectory.list(AbstractDirectory.java:232) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.list(AbstractClusterInvoker.java:452) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:355) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.rpc.cluster.router.RouterSnapshotFilter.invoke(RouterSnapshotFilter.java:46) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:109) ~[dubbo-3.3.1.jar:3.3.1]
at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.3.1.jar:3.3.1]
### What you expected to happen
The consumer should successfully discover and connect to the service provider, as the `java_package` option is intended to control the Java package for generated code, and Dubbo's service discovery should correctly use SERVICE_NAME instead of JAVA_SERVICE_NAME
### Anything else
_No response_
### Are you willing to submit a pull request to fix on your own?
- [ ] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] Application-level service discovery fails when IDL `package` and `java_package` differ [dubbo]
Posted by "heliang666s (via GitHub)" <gi...@apache.org>.
heliang666s commented on issue #15365:
URL: https://github.com/apache/dubbo/issues/15365#issuecomment-2869119062
Thanks for the feedback!@lqscript
When the IDL package and the java_package are different, the service name actually used by the provider and the consumer is inconsistent, leading to service discovery failure.
In short, the problem is that the service is registered with one name, while service discovery uses another name. I will fix this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] Application-level service discovery fails when IDL `package` and `java_package` differ [dubbo]
Posted by "LenoMinkus (via GitHub)" <gi...@apache.org>.
LenoMinkus commented on issue #15365:
URL: https://github.com/apache/dubbo/issues/15365#issuecomment-3074196944
Title: Generated protobuf sources not picked up by Maven build
Body (English):
> **Summary**
> When using the current `dubbo-maven-plugin` to compile `.proto` files, the generated Java sources are placed under
> `target/generated-sources/protobuf/java`, but Maven only scans the standard `src/main/java` directory during `package`.
> As a result, the generated classes are not included in the final JAR unless an extra step is taken.
> **Suggestion**
> 1. Extract `.proto` files into a dedicated Maven module.
> 2. Let the `dubbo-maven-plugin` generate sources in that module.
> 3. Consume the generated stubs from other modules via a normal Maven dependency.
> **Fix**
> Add the following dependency and plugin so Maven automatically adds the generated folder to the compile classpath:
```xml
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-triple</artifactId>
<version>${dubbo.version}</version>
</dependency>
<!-- protobuf core -->
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-maven-plugin</artifactId>
<version>${dubbo.version}</version> <!-- 3.3.0及以上版本 -->
<configuration>
<!-- 参考下文可配置参数 -->
<outputDir>${project.build.directory}/generated-sources/protobuf/java</outputDir>
<protoSourceDir>${basedir}/src/main/proto</protoSourceDir>
<!--proto编译器组件-->
<!--protobuf-java的版本-->
<protocVersion>${protobuf.version}</protocVersion>
<!--代码生成类型 可填tri或者tri_reactor 服务定义-->
<dubboGenerateType>tri</dubboGenerateType>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<!-- 添加os-maven-plugin用于自动检测系统类型 -->
<dependencies>
<dependency>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<!-- 与 dubbo-maven-plugin 的 outputDir 保持一致 -->
<source>${project.build.directory}/generated-sources/protobuf/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.xolstice.maven.plugins</groupId>-->
<!-- <artifactId>protobuf-maven-plugin</artifactId>-->
<!-- <version>0.6.1</version>-->
<!-- <configuration>-->
<!-- <protocArtifact>com.google.protobuf:protoc:3.19.4:exe:${os.detected.classifier}</protocArtifact>-->
<!-- <protocPlugins>-->
<!-- <protocPlugin>-->
<!-- <id>dubbo</id>-->
<!-- <groupId>org.apache.dubbo</groupId>-->
<!-- <artifactId>dubbo-compiler</artifactId>-->
<!-- <version>0.0.4.1-SNAPSHOT</version>-->
<!-- <mainClass>org.apache.dubbo.gen.tri.Dubbo3TripleGenerator</mainClass>-->
<!-- </protocPlugin>-->
<!-- </protocPlugins>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>compile</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</build>
> **Environment**
> - Dubbo version: 3.3.0
> - Maven: 3.9.x
> - JDK: 17
some photos
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] Application-level service discovery fails when IDL `package` and `java_package` differ [dubbo]
Posted by "lqscript (via GitHub)" <gi...@apache.org>.
lqscript commented on issue #15365:
URL: https://github.com/apache/dubbo/issues/15365#issuecomment-2875750494
> In short, the problem is that the service is registered with one name, while service discovery uses another name. I will fix this.
Thank you for confirming the fix!
Could you please provide an estimated timeline for when this fix might be available?
Specifically, is it targeted for the upcoming 3.3.5 release? If so, do you have an approximate release date for version 3.3.5?
Thanks for your help!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org