Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassCastException when a Java interface file is available in the workspace #475

Closed
2 tasks
rafaeltuelho opened this issue Nov 18, 2020 · 6 comments
Closed
2 tasks
Milestone

Comments

@rafaeltuelho
Copy link

Issue information

Define issue title short and most specific to the problem.

Tag each new issue with relevant LABELS (Bug, Improvement, etc.).

BUG report

Environment

  • Language Support for Apache Camel version: "v0.0.28"
  • OS:
    • Linux (RHEL, Fedora, Ubuntu, ...)
    • Windows
    • [ x ] macOS

Description of wrong behavior

  • ...

Exact steps to reproduce issue

  1. ...
  2. ...
  3. ...

TASK definition

Description

java.util.concurrent.CompletionException: java.lang.ClassCastException: class org.jboss.forge.roaster.model.impl.JavaInterfaceImpl cannot be cast to class org.jboss.forge.roaster.model.source.JavaClassSource (org.jboss.forge.roaster.model.impl.JavaInterfaceImpl and org.jboss.forge.roaster.model.source.JavaClassSource are in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @5c7fa833)

Expected behaviour

  • ...

Screenshot (optional)

Nov 16, 2020 3:02:31 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.ClassCastException: class org.jboss.forge.roaster.model.impl.JavaInterfaceImpl cannot be cast to class org.jboss.forge.roaster.model.source.JavaClassSource (org.jboss.forge.roaster.model.impl.JavaInterfaceImpl and org.jboss.forge.roaster.model.source.JavaClassSource are in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @5c7fa833)
java.util.concurrent.CompletionException: java.lang.ClassCastException: class org.jboss.forge.roaster.model.impl.JavaInterfaceImpl cannot be cast to class org.jboss.forge.roaster.model.source.JavaClassSource (org.jboss.forge.roaster.model.impl.JavaInterfaceImpl and org.jboss.forge.roaster.model.source.JavaClassSource are in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @5c7fa833)
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.lang.ClassCastException: class org.jboss.forge.roaster.model.impl.JavaInterfaceImpl cannot be cast to class org.jboss.forge.roaster.model.source.JavaClassSource (org.jboss.forge.roaster.model.impl.JavaInterfaceImpl and org.jboss.forge.roaster.model.source.JavaClassSource are in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @5c7fa833)
	at com.github.cameltooling.lsp.internal.documentsymbol.DocumentSymbolJavaProcessor.getSymbolInformations(DocumentSymbolJavaProcessor.java:41)
	at com.github.cameltooling.lsp.internal.documentsymbol.DocumentSymbolProcessor.lambda$getDocumentSymbols$0(DocumentSymbolProcessor.java:42)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	... 6 more
@apupier
Copy link
Member

apupier commented Nov 18, 2020

@rafaeltuelho thanks for the report. Do you have any steps to reproduce? A specific file with which it occurs for instance?

@rafaeltuelho
Copy link
Author

@apupier This seems to happen on a non-camel Java Project.
I'm not working with Camel at the moment. But when I open a Maven Java project I start to see annoying errors coming from Apache Camel Extension on my VSCode.
Not sure If it's reproducible. I can share the whole log message if you will.

@apupier
Copy link
Member

apupier commented Nov 18, 2020

I can share the whole log message if you will.

yes, please

@apupier
Copy link
Member

apupier commented Nov 18, 2020

I can share the whole log message if you will.

yes, please

hum ok, no need. I understood the issue. Will provide a fix soon

@apupier apupier changed the title java.lang.ClassCastException java.lang.ClassCastException when a Java interface file is available in the workspace Nov 18, 2020
@apupier
Copy link
Member

apupier commented Nov 20, 2020

@rafaeltuelho awaiting for the next release, you can pick a snapshot containing the fix: https://download.jboss.org/jbosstools/vscode/snapshots/vscode-apache-camel/vscode-apache-camel-0.0.29-49.vsix

(no planned date for next release, unfortunately current days priorities are fighting to migrate to another CI)

@apupier apupier added this to the 0.0.29 milestone Nov 20, 2020
@apupier apupier closed this as completed Nov 20, 2020
@apupier
Copy link
Member

apupier commented Dec 3, 2020

fix is available on released version 0.0.29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants