kobalt-intellij-plugin icon indicating copy to clipboard operation
kobalt-intellij-plugin copied to clipboard

Cannot open a Kobalt due to UnknownSdkType cannot be cast to JavaSdkType error

Open johanhaleby opened this issue 7 years ago • 3 comments
trafficstars

I'm trying to open an existing Kobalt project by just doing File->New->Project From Existing Sources, pointing to the Kobalt project and then trying to create/open it. But I run into this issue:

image

Is there anything I can do to resolve this?

johanhaleby avatar Sep 07 '18 09:09 johanhaleby

Removing the intellij-haskell plugin and the SDK it installed seemed to fix the problem. However I'd like to use both Haskell and Kobalt from Intellij so I'd prefer a better workaround/fix :)

johanhaleby avatar Sep 07 '18 10:09 johanhaleby

Hi @johanhaleby thabk you for publishing such issue. Could you please attach the log with all exception trace for the mentioned problem?

dmitry-zhuravlev avatar Sep 07 '18 15:09 dmitry-zhuravlev

I got two different errors, first this when just both intellij-haskell AND the Haskell SDK was enabled:

2018-09-07 11:49:31,062 [10871135]   WARN - nal.AbstractExternalSystemTask - intellij.haskell.sdk.HaskellSdkType cannot be cast to com.intellij.openapi.projectRoots.JavaSdkType 
java.lang.ClassCastException: intellij.haskell.sdk.HaskellSdkType cannot be cast to com.intellij.openapi.projectRoots.JavaSdkType
	at com.beust.kobalt.intellij.manager.KobaltManager$getExecutionSettingsProvider$1.fun(KobaltManager.kt:147)
	at com.beust.kobalt.intellij.manager.KobaltManager$getExecutionSettingsProvider$1.fun(KobaltManager.kt:52)
	at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.getExecutionSettings(ExternalSystemApiUtil.java:735)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.a(ExternalSystemFacadeManager.java:201)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.a(ExternalSystemFacadeManager.java:177)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doInvoke(ExternalSystemFacadeManager.java:132)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager$MyHandler.invoke(ExternalSystemFacadeManager.java:269)
	at com.sun.proxy.$Proxy233.getResolver(Unknown Source)
	at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:84)
	at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
	at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:149)
	at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:569)
	at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:665)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:736)
	at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:434)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:574)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

and this when the intellij-haskell plugin was disabled but its SDK was still present in Intellij:

2018-09-07 11:52:07,687 [ 112212]   WARN - nal.AbstractExternalSystemTask - com.intellij.openapi.projectRoots.impl.UnknownSdkType cannot be cast to com.intellij.openapi.projectRoots.JavaSdkType 
java.lang.ClassCastException: com.intellij.openapi.projectRoots.impl.UnknownSdkType cannot be cast to com.intellij.openapi.projectRoots.JavaSdkType
	at com.beust.kobalt.intellij.manager.KobaltManager$getExecutionSettingsProvider$1.fun(KobaltManager.kt:147)
	at com.beust.kobalt.intellij.manager.KobaltManager$getExecutionSettingsProvider$1.fun(KobaltManager.kt:52)
	at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.getExecutionSettings(ExternalSystemApiUtil.java:735)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.a(ExternalSystemFacadeManager.java:201)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.a(ExternalSystemFacadeManager.java:177)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doInvoke(ExternalSystemFacadeManager.java:132)
	at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager$MyHandler.invoke(ExternalSystemFacadeManager.java:269)
	at com.sun.proxy.$Proxy205.getResolver(Unknown Source)
	at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:84)
	at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
	at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:149)
	at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:569)
	at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:665)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:736)
	at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:434)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:574)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

johanhaleby avatar Sep 07 '18 17:09 johanhaleby