首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ServiceManager#getService返回空

ServiceManager#getService返回空
EN

Stack Overflow用户
提问于 2016-06-25 07:16:31
回答 1查看 947关注 0票数 1

我有一个应用程序服务在plugin.xml中声明为

代码语言:javascript
复制
<extensions defaultExtensionNs="com.intellij">
    <applicationService serviceImplementation="MyService"/>
</extensions>

但是下面的测试失败

代码语言:javascript
复制
public class MyServiceTest extends LightCodeInsightFixtureTestCase {
  public void test() throws Exception {
    MyService service = ServiceManager.getService(MyService.class);
    assertNotNull(service);
  }
}

我尝试在DefaultPicoContainer#registerComponent(ComponentAdapter)中放置带有条件的断点,但它从未触发。日志中没有错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-27 14:44:47

这个插件被忽略了,因为~\.IdeaIC12\system\plugins-sandbox\plugins中有另一个插件,plugin.xml中有相同的<name>

检查IdeaPluginDescriptorImpl[] at PluginManager#initializePlugins,以检查您的插件是否正在加载。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38026029

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档