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

Cannot open large project (keycloak) #2660

Open
hmlnarik opened this issue Sep 2, 2022 · 4 comments
Open

Cannot open large project (keycloak) #2660

hmlnarik opened this issue Sep 2, 2022 · 4 comments

Comments

@hmlnarik
Copy link

hmlnarik commented Sep 2, 2022

Type: Bug

Thank you for the great work on the Java support for VS Code.

Sadly large projects seem to struggle with "Connection to server got closed. Server will not be restarted." issue.

Steps to reproduce:

  1. Checkout https://github.com/keycloak/keycloak
  2. Open this project in VS Code

Related information:
Perhaps the following exception is related:

[Error - 2:00:57 PM] Sep 2, 2022, 2:00:57 PM Exception thrown by Java annotation processor io.fabric8.crd.generator.apt.CustomResourceAnnotationProcessor@26a90b40
java.lang.IllegalArgumentException: Found a cyclic reference involving the field subGroups of type org.keycloak.representations.idm.GroupRepresentation
java.lang.Exception: java.lang.IllegalArgumentException: Found a cyclic reference involving the field subGroups of type org.keycloak.representations.idm.GroupRepresentation
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:172)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:113)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:172)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:138)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:991)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:450)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:379)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:214)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:311)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:79)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:273)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:199)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1024)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:254)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:400)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:403)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:514)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:462)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:544)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.IllegalArgumentException: Found a cyclic reference involving the field subGroups of type org.keycloak.representations.idm.GroupRepresentation
	at io.fabric8.crd.generator.AbstractJsonSchema.resolveNestedClass(AbstractJsonSchema.java:618)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:599)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:558)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:259)
	at io.fabric8.crd.generator.AbstractJsonSchema.resolveNestedClass(AbstractJsonSchema.java:623)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:599)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:558)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:259)
	at io.fabric8.crd.generator.AbstractJsonSchema.resolveNestedClass(AbstractJsonSchema.java:623)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:599)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:558)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:259)
	at io.fabric8.crd.generator.AbstractJsonSchema.resolveNestedClass(AbstractJsonSchema.java:623)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:599)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:259)
	at io.fabric8.crd.generator.AbstractJsonSchema.resolveNestedClass(AbstractJsonSchema.java:623)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:599)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFromImpl(AbstractJsonSchema.java:259)
	at io.fabric8.crd.generator.AbstractJsonSchema.internalFrom(AbstractJsonSchema.java:128)
	at io.fabric8.crd.generator.v1beta1.JsonSchema.from(JsonSchema.java:47)
	at io.fabric8.crd.generator.v1beta1.CustomResourceHandler.addDecorators(CustomResourceHandler.java:68)
	at io.fabric8.crd.generator.AbstractCustomResourceHandler.handle(AbstractCustomResourceHandler.java:72)
	at io.fabric8.crd.generator.v1beta1.CustomResourceHandler.handle(CustomResourceHandler.java:99)
	at io.fabric8.crd.generator.CRDGenerator.lambda$detailedGenerate$4(CRDGenerator.java:154)
	at java.base/java.util.HashMap$Values.forEach(Unknown Source)
	at io.fabric8.crd.generator.CRDGenerator.detailedGenerate(CRDGenerator.java:154)
	at io.fabric8.crd.generator.apt.CustomResourceAnnotationProcessor.process(CustomResourceAnnotationProcessor.java:54)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:142)
	... 25 more

The CPU utilization remains over 200% even after the "Server will not be restarted" message.

It would be great if it would be possible to open Keycloak in VSCode.

Extension version: 1.10.0
VS Code version: Code 1.70.2 (e4503b30fc78200f846c62cf8091b76ff5547662, 2022-08-16T05:36:25.715Z)
OS version: Linux x64 5.17.11-300.fc36.x86_64
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (12 x 2875)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 10, 9, 5
Memory (System) 30.99GB (0.74GB free)
Process Argv --unity-launch --crash-reporter-id ef8565c1-6ec2-4c0e-8977-6c25d39f07a9
Screen Reader no
VM 0%
DESKTOP_SESSION plasmax11
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP plasmax11
XDG_SESSION_TYPE x11
@snjeza
Copy link
Contributor

snjeza commented Sep 12, 2022

@hmlnarik You may want to take a look at #2537 (comment)

Perhaps the following exception is related:

This exception is an upstream kubernetes-client issue - See https://github.com/fabric8io/kubernetes-client/blob/v5.12.2/crd-generator/api/src/main/java/io/fabric8/crd/generator/AbstractJsonSchema.java#L618
You can ignore it.

@hmlnarik
Copy link
Author

@snjeza Thank you for the hint.

The workflow I use sadly does not allow me to easily exclude other than non-java files, so including only a few selected modules is not possible for me.

Interestingly enough, the Netbeans Java Language Server opens the whole project in a few minutes without any tweaks in settings, with working symbol lookup, debugging etc. I'd love to use the recommended extensions like vscode-java, but the current behaviour does not allow me to; thus it rather seems to indicate an issue in vscode-java extension which could be investigated and improved?

Feel free to close this issue if it is not the case.

@snjeza
Copy link
Contributor

snjeza commented Sep 26, 2022

@hmlnarik You can try the following:

  • set
"java.jdt.ls.vmargs": "-Dsun.misc.URLClassPath.disableJarChecking=true -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms512m",
"java.import.exclusions": [
        "**/node_modules/**",
        "**/.metadata/**",
        "**/archetype-resources/**",
        "**/META-INF/maven/**",
        "**/themes/**",
    ],

to your settings.json

git clone [email protected]:keycloak/keycloak.git
cd keycloak
./mvnw clean verify
code .

@hmlnarik
Copy link
Author

hmlnarik commented Oct 3, 2022

Thank you for the hint.

After following the suggestion, I am afraid I cannot report success. The IDE keeps reporting Building n% and Building [Done] messages after over 2 6 hours of indexing. When I tried "Go to symbol in Workspace", it returns results only in roughly 50% of cases.

If there is anything else I could try, please let me know.

EDIT: I ran Java: Clean Java Language Server workspace before opening the keycloak project.

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

No branches or pull requests

3 participants