<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: Windows 10 企业版(10.0.17134)</li>
<li>Java version: 1.8.0_211</li>
<li>Operating System Lang:zh-cn</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Do setup things,including run some dubbo servic(use the dubbo-samples),run a zookeeper service.A java app as a container to run the OSGi (hereinafter referred to as <strong>OSGiHost</strong>,and i use the equinox which eclipse use it too).</li>
<li>Code a bndproject(we can use the eclipse plugin:bndtools to make it, and the bundle we make that we referred to as <strong>Bundle</strong> ), make <strong>OSGiHost</strong> can load the <strong>Bundle</strong></li>
<li>Code the Bundle with some generic service code can work in a general java project,and put libs referred on the bnd-classpath too(like curator-client-4.0.1.jar,curator-framework-4.0.1.jar,curator-recipes-4.0.1.jar,dubbo-2.7.3.jar,guava-20.0.jar,javassist-3.20.0-GA.jar,zookeeper-3.4.13.jar,while the versions are corresponding to the dubbo-samples's master branch version:754e937b1b0942d7a1dd76705daaf670854801fd on github, for dubbo.jar is not packed in a bundle-style like most Apache jars do,i have no choice)<br>
4.Use the new version <strong>Bundle</strong> with a dubbo generic service feature,load it in <strong>OSGiHost</strong>,use the new feature.</li>
</ol>
<p dir="auto">1.准备一些DubboService工程（直接使用dubbo-samples工程），起一个zookeeper集群服务，一个OSGi环境的eclipse project，或者直接使用eclipse的Run Configureations中的OSGi Framework来配置一个OSGi环境.下文称这个环境为<strong>OSGiHost</strong>,我使用的是eclipse的实现:equinox.</p>
<p dir="auto">2.创建一个bndproject生成bundle(使用eclipse的插件bndtools),生成的bundle下文称 <strong>Bundle</strong>.确保<strong>OSGiHost</strong>能够加载<strong>Bundle</strong></p>
<p dir="auto">3.往bundle工程中加入一些dubbo泛化调用代码，这些代码已经在普通的java 工程中调用通过，并且将依赖的jar包置于Bundle-ClassPath中（包有curator-client-4.0.1.jar,curator-framework-4.0.1.jar,curator-recipes-4.0.1.jar,dubbo-2.7.3.jar,guava-20.0.jar,javassist-3.20.0-GA.jar,zookeeper-3.4.13.jar，这是从dubbo-samples工程的master分支的754e937b1b0942d7a1dd76705daaf670854801fd版本生成的maven工程的maven依赖库中找到的包），这样做的方式是无法像绝大多数Apache的jar包那样以bundle方式加载它:dubbo-xxx.jar(未提供满足OSGi规范的manifest.mf)</p>
<p dir="auto">4.<strong>OSGiHost</strong>加载新的加入了泛化特性的<strong>Bundle</strong>,并使用这个特性。</p>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto"><strong>OSGiHost</strong> can call dubbo service by <strong>Bundle</strong><br>
<strong>OSGiHost</strong>可以通过<strong>Bundle</strong>调用dubbo服务</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Get some exception,<br>
After read few source code,i think ,it may occured beacause the configuration at inner path of dubbo-2.7.2.jar:\META-INF\dubbo\internal\org.apache.dubbo.common.extension.ExtensionFactory,it told dubbo to use org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory as a 'adaptive',and of course,in the OSGi loader doesn't load the configuration, or make it visible in old way.</p>
<p dir="auto">发生了异常,<br>
通过阅读相关处代码，我猜测有一种可能是dubbo.ajr中的配置\META-INF\dubbo\internal\org.apache.dubbo.common.extension.ExtensionFactory没有被dubbo读取到，无论是loader未加载，还是不处于过去的位置。使得其配置adaptive=org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory没有生效，进而使用了默认的ExtensionFactory.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.corp.osgihost.osgi.OSGiUtil.doFunctionCall(OSGiUtil.java:241)
	at com.corp.osgihost.task.TaskRunner.process(TaskRunner.java:277)
	at com.corp.osgihost.task.TaskRunner.run(TaskRunner.java:198)
	at com.corp.osgihost.event.TaskHandler.doTaskJobInner(TaskHandler.java:172)
	at com.corp.osgihost.event.TaskHandler.doGUITask(TaskHandler.java:162)
	at com.corp.osgihost.event.TaskHandler.doGUITaskJob(TaskHandler.java:113)
	at com.corp.osgihost.event.TaskHandler.processTask(TaskHandler.java:72)
	at com.corp.osgihost.event.TaskHandler$$FastClassBySpringCGLIB$$5d8c0873.invoke(&lt;generated&gt;)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
	at com.corp.osgihost.bundle.dubbotest.DubboServiceFactory.genericInvoke(DubboServiceFactory.java:56)
	at com.corp.osgihost.bundle.dubbotest.DubboServiceFactory.genericInvoke(DubboServiceFactory.java:51)
	at com.corp.osgihost.bundle.dubbotest.DubboTestImpl.stepRPCDubboTest(DubboTestImpl.java:270)
	at com.corp.osgihost.bundle.dubbotest.DubboTestImpl.doTestProcess(DubboTestImpl.java:375)
	at com.corp.osgihost.bundle.dubbotest.DubboTestImpl.step(DubboTestImpl.java:707)
	... 27 more
Caused by: java.lang.IllegalStateException: Failed to create adaptive instance: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.common.extension.ExtensionFactory, cause: No adaptive method exist on extension org.apache.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:486)
	at org.apache.dubbo.common.extension.ExtensionLoader.&lt;init&gt;(ExtensionLoader.java:106)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:128)
	at org.apache.dubbo.config.ReferenceConfig.&lt;clinit&gt;(ReferenceConfig.java:101)
	... 32 more
Caused by: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.common.extension.ExtensionFactory, cause: No adaptive method exist on extension org.apache.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:847)
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:482)
	... 35 more
Caused by: java.lang.IllegalStateException: No adaptive method exist on extension org.apache.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
	at org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator.generate(AdaptiveClassCodeGenerator.java:89)
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:860)
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:856)
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:845)
	... 36 more"><pre class="notranslate"><code class="notranslate">java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.corp.osgihost.osgi.OSGiUtil.doFunctionCall(OSGiUtil.java:241)
	at com.corp.osgihost.task.TaskRunner.process(TaskRunner.java:277)
	at com.corp.osgihost.task.TaskRunner.run(TaskRunner.java:198)
	at com.corp.osgihost.event.TaskHandler.doTaskJobInner(TaskHandler.java:172)
	at com.corp.osgihost.event.TaskHandler.doGUITask(TaskHandler.java:162)
	at com.corp.osgihost.event.TaskHandler.doGUITaskJob(TaskHandler.java:113)
	at com.corp.osgihost.event.TaskHandler.processTask(TaskHandler.java:72)
	at com.corp.osgihost.event.TaskHandler$$FastClassBySpringCGLIB$$5d8c0873.invoke(&lt;generated&gt;)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
	at com.corp.osgihost.bundle.dubbotest.DubboServiceFactory.genericInvoke(DubboServiceFactory.java:56)
	at com.corp.osgihost.bundle.dubbotest.DubboServiceFactory.genericInvoke(DubboServiceFactory.java:51)
	at com.corp.osgihost.bundle.dubbotest.DubboTestImpl.stepRPCDubboTest(DubboTestImpl.java:270)
	at com.corp.osgihost.bundle.dubbotest.DubboTestImpl.doTestProcess(DubboTestImpl.java:375)
	at com.corp.osgihost.bundle.dubbotest.DubboTestImpl.step(DubboTestImpl.java:707)
	... 27 more
Caused by: java.lang.IllegalStateException: Failed to create adaptive instance: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.common.extension.ExtensionFactory, cause: No adaptive method exist on extension org.apache.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:486)
	at org.apache.dubbo.common.extension.ExtensionLoader.&lt;init&gt;(ExtensionLoader.java:106)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:128)
	at org.apache.dubbo.config.ReferenceConfig.&lt;clinit&gt;(ReferenceConfig.java:101)
	... 32 more
Caused by: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.common.extension.ExtensionFactory, cause: No adaptive method exist on extension org.apache.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:847)
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:482)
	... 35 more
Caused by: java.lang.IllegalStateException: No adaptive method exist on extension org.apache.dubbo.common.extension.ExtensionFactory, refuse to create the adaptive class!
	at org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator.generate(AdaptiveClassCodeGenerator.java:89)
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:860)
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:856)
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:845)
	... 36 more
</code></pre></div>