ApplicationManager.getApplication().getService(serviceClass) ERROR
com.intellij.platform.instanceContainer.instantiation.InstantiationException: Class 'class com.wang.fast.plugin.build.service.impl.LyAgilePlatformApiClientServiceImpl' does not define any of supported signatures '[()void, (CoroutineScope)void, (Application)void, (ComponentManager)void]'
at com.intellij.platform.instanceContainer.instantiation.InstantiateKt.findConstructor(instantiate.kt:66)
at com.intellij.platform.instanceContainer.instantiation.InstantiateKt.instantiate(instantiate.kt:31)
at com.intellij.serviceContainer.LightServiceInstanceSupport$LightServiceInstanceInitializer.createInstance(LightServiceInstanceSupport.kt:47)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:162)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invokeSuspend(LazyInstanceHolder.kt:160)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:44)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:112)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.initialize(LazyInstanceHolder.kt:145)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.access$initialize(LazyInstanceHolder.kt:13)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.tryInitialize(LazyInstanceHolder.kt:135)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstance(LazyInstanceHolder.kt:95)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext$suspendImpl(LazyInstanceHolder.kt:87)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext(LazyInstanceHolder.kt)
at com.intellij.serviceContainer.ComponentManagerImplKt$getOrCreateInstanceBlocking$3.invokeSuspend(ComponentManagerImpl.kt:1548)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1636)
at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1627)
at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:83)
at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization(ComponentManagerImpl.kt:1627)
at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1547)
at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:754)
at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:698)
at com.wang.fast.plugin.build.util.BeanManagerUtils.getService(BeanManagerUtils.java:9)
at com.wang.fast.plugin.build.window.tools.FastBuildToolWindowForm.<init>(FastBuildToolWindowForm.java:41)
at com.wang.fast.plugin.build.window.FastBuildToolWindow.createToolWindowContent(FastBuildToolWindow.java:14)
at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded(ToolWindowImpl.kt:596)
…
请先登录再写评论。
Hi !
Why can't I find the error when I have a constructor?
@Service
public final class LyAgilePlatformApiClientServiceImpl implements LyAgilePlatformApiClientService {
private static final Logger log = LoggerFactory.getLogger(LyAgilePlatformApiClientServiceImpl.class);
private static final String BASE_URL = "http://192.168.2.173:9090";
private static final String HOST = "192.168.2.173:9090";
private static final String LOGIN_URL = BASE_URL + "/api/auth/login";
private static final String PROJECT_LIST_URL = BASE_URL + "/api/projects";
private static final String BRANCH_LIST_URL = BASE_URL + "/api/projects/%s/branches";
private static final String BUILD_HISTORY_LIST_URL = BASE_URL + "/api/images/queryImageList";
private static final Integer DEFAULT_PAGE_SIZE = 20;
private RestTemplate restTemplate;
private TokenState tokenState;
// (CoroutineScope)void, (Application)void, (ComponentManager)void]
private ComponentManager componentManager;
private Application application;
private CoroutineScope coroutineScope;
public LyAgilePlatformApiClientServiceImpl() {
this.restTemplate = BeanManagerUtils.getService(RestTemplateHolder.class).getRestTemplate();
this.tokenState = BeanManagerUtils.getService(TokenState.class);
}
public LyAgilePlatformApiClientServiceImpl(CoroutineScope coroutineScope) {this.coroutineScope = coroutineScope;}
public LyAgilePlatformApiClientServiceImpl(Application application) {this.application = application;}
public LyAgilePlatformApiClientServiceImpl(ComponentManager componentManager) {this.componentManager = componentManager;}
// ……
}