Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.0+

Operating System version: mac

Java version: 1.8

Steps to reproduce this issue

Assume that there is an interface below：

package org.apache.dubbo.demo;
public interface DemoService {
String sayHello(String name);
}

package org.apache.dubbo.demo.provider;
import org.apache.dubbo.demo.DemoService;
public class DemoAService implements DemoService {
@Override
public String sayHello(String name) {
return "Hello " + name + ", response from provider: " + this.getClass().getSimpleName();
}
}

package org.apache.dubbo.demo.provider;
import org.apache.dubbo.demo.DemoService;
public class DemoBService implements DemoService {
@Override
public String sayHello(String name) {
return "Hello " + name + ", response from provider: " + this.getClass().getSimpleName();
}
}

dubbo-demo-provider.xml:

<!-- service implementation, as same as regular local bean -->
<bean id="demoAService" class="org.apache.dubbo.demo.provider.DemoAService"/>

<!-- declare the service interface to be exported -->
<dubbo:service interface="org.apache.dubbo.demo.DemoService" ref="demoAService" group="demoA"/>

<!-- service implementation, as same as regular local bean -->
<bean id="demoBService" class="org.apache.dubbo.demo.provider.DemoBService"/>

<!-- declare the service interface to be exported -->
<dubbo:service interface="org.apache.dubbo.demo.DemoService" ref="demoBService" group="demoB"/>

Start telnet call service：

incubator-dubbo yeling$ telnet localhost 20880
dubbo>ls
org.apache.dubbo.demo.DemoService
org.apache.dubbo.demo.DemoService
dubbo>invoke org.apache.dubbo.demo.DemoService.sayHello("china")
"Hello china, response from provider: DemoAService"

Always only call the provider DemoAService，There's no way I can invoke to DemoBService.

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.7 and 2.6.5

Operating System version: common linux vm

Java version: 1.8

Steps to reproduce this issue

java process use dubbo 2.7.7 with org.apache package

copy dubbo 2.6.5 to process lib dir

so we have two ExtensionFactory

2.7.7

spring=org.apache.dubbo.config.spring.extension.SpringExtensionFactory

adaptive=org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory

spi=org.apache.dubbo.common.extension.factory.SpiExtensionFactory

2.6.5

spring=com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory

adaptive=com.alibaba.dubbo.common.extension.factory.AdaptiveExtensionFactory

spi=com.alibaba.dubbo.common.extension.factory.SpiExtensionFactory

when class run: org.apache.dubbo.common.extension.ExtensionLoader

line:755~758

for (LoadingStrategy strategy : strategies) {
loadDirectory(extensionClasses, strategy.directory(), type.getName(), strategy.preferExtensionClassLoader(), strategy.overridden(), strategy.excludedPackages());
loadDirectory(extensionClasses, strategy.directory(), type.getName().replace("org.apache", "com.alibaba"), strategy.preferExtensionClassLoader(), strategy.overridden(), strategy.excludedPackages());
}

when the secend loadDirectory run and it will find 2.6.5 META properties and load adaptive=com.alibaba.dubbo.common.extension.factory.AdaptiveExtensionFactory

and the line 877 can not go into ,for the class name of Adaptive are different ,maybe this judgment statement should change like ：

if (clazz.isAnnotationPresent(Adaptive.class) || clazz.isAnnotationPresent(com.alibaba.dubbo.common.extension.Adaptive.class)) {

line:870~899

private void loadClass(Map<String, Class<?>> extensionClasses, java.net.URL resourceURL, Class<?> clazz, String name,
boolean overridden) throws NoSuchMethodException {
if (!type.isAssignableFrom(clazz)) {
throw new IllegalStateException("Error occurred when loading extension class (interface: " +
type + ", class line: " + clazz.getName() + "), class "
+ clazz.getName() + " is not subtype of interface.");
}
if (clazz.isAnnotationPresent(Adaptive.class)) {
cacheAdaptiveClass(clazz, overridden);
} else if (isWrapperClass(clazz)) {
cacheWrapperClass(clazz);
} else {
clazz.getConstructor();
if (StringUtils.isEmpty(name)) {
name = findAnnotationName(clazz);
if (name.length() == 0) {
throw new IllegalStateException("No such extension name for the class " + clazz.getName() + " in the config " + resourceURL);
}
}

String[] names = NAME_SEPARATOR.split(name);
if (ArrayUtils.isNotEmpty(names)) {
cacheActivateClass(clazz, names[0]);
for (String n : names) {
cacheName(clazz, n);
saveInExtensionClass(extensionClasses, clazz, n, overridden);
}
}
}
}