bsl-language-server icon indicating copy to clipboard operation
bsl-language-server copied to clipboard

CompletionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diagnostics' defined in class path resource [com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticsConfiguration.class]: Failed to instantia...

Open sentry[bot] opened this issue 5 months ago • 1 comments

Sentry Issue: BSL-LANGUAGE-SERVER-DW

ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
    at com.github._1c_syntax.bsl.languageserver.diagnostics.MagicNumberDiagnostic.configure(MagicNumberDiagnostic.java:72)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticBeanPostProcessor.postProcessAfterInitialization(DiagnosticBeanPostProcessor.java:68)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticObjectProvider.get(DiagnosticObjectProvider.java:36)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticsConfiguration.diagnostics(DiagnosticsConfiguration.java:84)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticsConfiguration$$SpringCGLIB$$0.CGLIB$diagnostics$0(<generated>)
...
(55 additional frame(s) were not displayed)

BeanCreationException: Error creating bean with name 'magicNumberDiagnostic' defined in URL [jar:nested:/C:/Program%20Files/BSL%20Language%20Server/app/bsl-language-server-0.24.2-exec.jar/!BOOT-INF/classes/!/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicNumberDiagnostic.class]: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticObjectProvider.get(DiagnosticObjectProvider.java:36)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticsConfiguration.diagnostics(DiagnosticsConfiguration.java:84)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticsConfiguration$$SpringCGLIB$$0.CGLIB$diagnostics$0(<generated>)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticsConfiguration$$SpringCGLIB$$FastClass$$1.invoke(<generated>)
    at com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.DiagnosticsConfiguration$$SpringCGLIB$$0.diagnostics(<generated>)
...
(51 additional frame(s) were not displayed)

BeanInstantiationException: Failed to instantiate [java.util.List]: Factory method 'diagnostics' threw exception with message: Error creating bean with name 'magicNumberDiagnostic' defined in URL [jar:nested:/C:/Program%20Files/BSL%20Language%20Server/app/bsl-language-server-0.24.2-exec.jar/!BOOT-INF/classes/!/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicNumberDiagnostic.class]: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
    at com.github._1c_syntax.bsl.languageserver.context.computer.DiagnosticComputer$$SpringCGLIB$$0.diagnostics(<generated>)
    at com.github._1c_syntax.bsl.languageserver.context.computer.DiagnosticComputer.internalCompute(DiagnosticComputer.java:67)
    at com.github._1c_syntax.bsl.languageserver.context.computer.DiagnosticComputer.lambda$compute$0(DiagnosticComputer.java:60)
...
(17 additional frame(s) were not displayed)

BeanCreationException: Error creating bean with name 'diagnostics' defined in class path resource [com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticsConfiguration.class]: Failed to instantiate [java.util.List]: Factory method 'diagnostics' threw exception with message: Error creating bean with name 'magicNumberDiagnostic' defined in URL [jar:nested:/C:/Program%20Files/BSL%20Language%20Server/app/bsl-language-server-0.24.2-exec.jar/!BOOT-INF/classes/!/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicNumberDiagnostic.class]: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
    at com.github._1c_syntax.bsl.languageserver.context.computer.DiagnosticComputer$$SpringCGLIB$$0.diagnostics(<generated>)
    at com.github._1c_syntax.bsl.languageserver.context.computer.DiagnosticComputer.internalCompute(DiagnosticComputer.java:67)
    at com.github._1c_syntax.bsl.languageserver.context.computer.DiagnosticComputer.lambda$compute$0(DiagnosticComputer.java:60)
...
(14 additional frame(s) were not displayed)

CompletionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diagnostics' defined in class path resource [com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticsConfiguration.class]: Failed to instantiate [java.util.List]: Factory method 'diagnostics' threw exception with message: Error creating bean with name 'magicNumberDiagnostic' defined in URL [jar:nested:/C:/Program%20Files/BSL%20Language%20Server/app/bsl-language-server-0.24.2-exec.jar/!BOOT-INF/classes/!/com/github/_1c_syntax/bsl/languageserver/diagnostics/MagicNumberDiagnostic.class]: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
    at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
...
(4 additional frame(s) were not displayed)

sentry[bot] avatar Jun 14 '25 07:06 sentry[bot]

Необходимо предусмотреть мягкую обработку ошибок. Если конфигурация диагностик некорректна, нужно вывести об этом предупреждающее сообщение и оставить параметр диагностики (или саму диагностику) несконфигурированной

nixel2007 avatar Jun 14 '25 07:06 nixel2007