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

Initializing plugin in a mid-sized monorepo takes hours #129

Open
tomasaschan opened this issue Nov 28, 2024 · 16 comments
Open

Initializing plugin in a mid-sized monorepo takes hours #129

tomasaschan opened this issue Nov 28, 2024 · 16 comments

Comments

@tomasaschan
Copy link

We have a monorepo with a couple of hundred subcomponents (as determined by find . -name BUILD.bazel in the monorepo root). Opening a subpath of that monorepo and initializing the plugin has been running for hours and I have no idea how long it's going to take until it completes.

A few steps I've noticed took a lot of time:

  • Provisioning .eclipse projects for each java component
  • Computing Bazel project classpaths for a bunch of stuff; unclear to me what the scope of each of those is, because sometimes it seems like it's doing it for an entire package, and other times for just a single file.

At the step I'm currently at, every so often (a few times per minute?) the Java Build Status view outputs something like {hash} {repo-name}> bazel query //{path-to/subcomponent}:all [Done].

Is it expected that this extension doesn't work well with monorepos? Is it expected that it should take this long? (I thought monorepos was why you used Bazel, so that would surprise me...) How much of this work will be cached, and how much will have to happen every time I open a component in this monorepo? Will it matter if I've opened that exact component before or not?

@tomasaschan tomasaschan changed the title Initializing a mid-sized monorepo takes hours Initializing plugin in a mid-sized monorepo takes hours Nov 28, 2024
@guw
Copy link
Collaborator

guw commented Nov 29, 2024

Yikes, it's likely going to anayze the entire mono-repo. There are a few performance issues with JDTLS that we don't see in Eclipse.

When opened inside a workspace, the extension tries to walk up the tree to discover the workspace root. In the workspace root it looks for a project view in .eclipse/.bazelproject file.

Our primary use case is a mono-repo & monolith. Thus, we usually open VS Code in the Bazel workspace root and use .eclipse/.bazelproject to customize the sync process. You can use directories or targets to limit what is synced into Eclipse/JDTLS & VS Code. Especially in a mono-repo you most likely only want a subset of project to be synced.

Also, can you describe the project layout? Is it more Maven like or more Bazel like?

Bazel like: verify fine grained, eg., BUILD files within Java packages to slice Java packages into smaller libs/units
Maven like: all Java code in a src directory, no nested BUILD files within Java source code

For Maven like projects it may make sense to tweak the .bazelproject file a bit. Here is an example:

# Default Project View Settings for Eclipse & VS Code Users
#
# More info about this file:
#   https://github.com/salesforce/bazel-eclipse/blob/main/docs/common/projectviews.md
#
# Please do not modify this file without consulting the developer experience team.
# The file contains default settings optimized for Eclipse and VS Code and should be
# imported from .eclipse/.bazelproject file only.
#

# collapse all targets into one Java project (for Maven like layouts)
target_provisioning_strategy: project-per-package

# make the naming backwards compatible to the old Maven artifact ids,
# do not use the execution environment but hard-wire the project to runtime JDK
# reduce classpath to direct compile dependencies only (some projects have too many dependencies)
# (but be careful, can cause compile/unit test execution issues)
target_provisioning_settings:
  project_name_separator_char=-
  jre_system_library=current_java_runtime
  classpath_depth=1

# ensure Eclipse has (some) consistent settings for developers
import_preferences:
  tools/eclipse/preferences/eclipse-prefs.epf

# use same project settings everywhere
project_settings:
  tools/eclipse/project_settings/org.eclipse.core.resources.prefs
  tools/eclipse/project_settings/org.eclipse.core.runtime.prefs
  tools/eclipse/project_settings/org.eclipse.jdt.core.prefs
  tools/eclipse/project_settings/org.eclipse.jdt.ui.prefs
  tools/eclipse/project_settings/org.eclipse.ui.editors.prefs

# scan all directories for targets
derive_targets_from_directories: true

# override .bazelrc defaults for synching experience
sync_flags:
  --explicit_java_test_deps   # don't leak Bazel's old test runner deps into projects

# allow Eclipse / VS Code to discover tests by using the test classpath
test_sources:
  **/test/java

Have you tried importing into Eclipse? The output/feedback is usually better there.

@guw
Copy link
Collaborator

guw commented Nov 29, 2024

@tomasaschan Did you use the pre-release version or the latest release version? I noticed we haven't pushed a release to the stable channel in a while.

@tomasaschan
Copy link
Author

@guw I'm using the latest stable. I can try with the preview version, but I'm not tempted at restarting this and potentially throwing away all progress...

The project is more maven-like (most sub-projects are imported from maven "polyrepos") but not everything is Java either. The .bazelproject files in most of the subprojects are outside my control; I don't own those subprojects and cannot really do much about their contents. Here's the (generated on import) .bazelproject file of my own project:

directories:
  # Add the directories you want added as source here
  path/from/monorepo/root/to/my/thing

derive_targets_from_directories: true

test_sources:
  src/test/java

targets:
  # If source code isn't resolving, add additional targets that compile it here
  # (in my file it's empty)

Do you have suggestions on what I should put there?

@guw
Copy link
Collaborator

guw commented Nov 29, 2024

I released 1.4.0 this morning. That's the version you should use. The older one was definitely broken.

Add this:

# collapse all targets into one Java project (for Maven like layouts)
target_provisioning_strategy: project-per-package

# allow Eclipse / VS Code to discover tests by using the test classpath
test_sources:
  **/test/java

The glob pattern for sources is need because folders are matched as a whole from workspace root. In general, everything in the project view file is relative from workspace root.

@tomasaschan
Copy link
Author

I still see the same behaviors with the 1.4.0 plugin version and those additions to my .bazelproject. FWIW, the target_provisioning_strategy node is not syntax highlighted like the others - is that a very recent addition to Bazel itself? (Trying to figure out if my local bazel version would be a contributing factor here...)

@guw
Copy link
Collaborator

guw commented Dec 2, 2024

.bazelproject is not a Bazel thing but comes from the IntelliJ Bazel plug-in. We added a few things to it.
https://github.com/salesforce/bazel-eclipse/blob/main/docs/common/projectviews.md

What Bazel version are you using? 7.4.1?

Did you limit the directories in the .bazelproject?

Is your project building without issues in the command line? The extension is attempting a build, too. Using the Bazel disk cache might speed things up a bit.

@tomasaschan
Copy link
Author

Ah, I see. Yes, 7.4.1:

λ bazel version
Bazelisk version: 
> bazel version
INFO: Invocation ID: 6990bc7a-144a-459d-b664-1a8cac6793ac
Build label: 7.4.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Nov 11 21:24:53 2024 (1731360293)
Build timestamp: 1731360293
Build timestamp as int: 1731360293

And yes, a command-line bazel build :my-package-name finishes in a few seconds, successfully. .bazelproject contains a directories entry with only the current project folder (i.e. the folder where this .bazelproject file lives, which is also the folder i'm opening in VS Code) and no other entries.

It seems the plugin still tries to initialize and do things for every project in the monorepo - it takes many hours and despite having it on in the background at work all day I haven't managed to have it finish once. Every time I close and re-open the project it starts over from scratch and seems to not have anything cached from before... :/

@guw
Copy link
Collaborator

guw commented Dec 2, 2024

In that case I recommend deleting the VS Code data/workspace created by JDTLS and start over.

https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting
Clean the workspace directory

@tomasaschan
Copy link
Author

That seems to have just set it back to start over again.

Not sure how much detail I can share about the repo structure and contents (there's a lot of proprietary info in there...) but I did notice the activation script started with bazel query 'buildfiles(//...) so I ran that just to give a feel for the size of our thing:

λ bazel query 'buildfiles(//...)' | wc -l 
INFO: Invocation ID: a2c5e252-198b-467f-a18c-af7025e3e267
Loading: 0 packages loaded
4242

@guw
Copy link
Collaborator

guw commented Dec 2, 2024

4242

That's ~40% of what I have here. :)

Do you see any progress in the Bazel Console in VS Code? Is there any output? Can you try loading it with Eclipse?

@tomasaschan
Copy link
Author

tomasaschan commented Dec 12, 2024

Hi again! Sorry for the silence here - I had to put this aside for a bit and focus on other stuff...

I have since done two things:

  • enable using preview builds of the plugin
  • clean out all the custom config I set up for myself, and just re-generated the default stuff from the tooling in our monorepo (that works for other people using e.g. IntelliJ)

and now I notice that the plugin seems to load pretty quickly - within a minute or so from opening the window, status says "Java: Ready"! However, despite bazel build :my-project from the command line working without errors, VS Code now fails to resolve all external libraries.

Do I need to set up something more for the plugin to pick up dependencies and make them available in the classpath, compared to what bazel itself needs in order to find them?

image

@guw
Copy link
Collaborator

guw commented Dec 12, 2024

Can you inspect the Java Project view? It should show which Java projects were detected and their classpath. Also, the error log from the Java language server would help for troubleshooting.

@tomasaschan
Copy link
Author

I have stuff like this in the Java language server logs:

[Error - 1:46:53 PM] Dec 12, 2024, 1:46:45 PM FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.eclipse.jdtls [104]
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.eclipse.core
    -> Bundle-SymbolicName: com.salesforce.bazel.eclipse.core; bundle-version="2.0.0.v20241211-1121"; singleton:="true"
       com.salesforce.bazel.eclipse.core [103]
         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241211-1121"
              com.salesforce.bazel.importedsource [101]
                Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
                Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241211-1121"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.sdk
    -> Bundle-SymbolicName: com.salesforce.bazel.sdk; bundle-version="2.0.0.v20241211-1121"; singleton:="true"
       com.salesforce.bazel.sdk [102]
         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241211-1121"

...and I don't have a Java project view at all...!

What other extensions are expected to be installed alongside this one?

@tomasaschan
Copy link
Author

Another example error:

[Error - 3:24:20 PM] Dec 12, 2024, 3:24:20 PM FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.eclipse.jdtls [104]
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.eclipse.core
    -> Bundle-SymbolicName: com.salesforce.bazel.eclipse.core; bundle-version="2.0.0.v20241211-1121"; singleton:="true"
       com.salesforce.bazel.eclipse.core [103]
         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241211-1121"
              com.salesforce.bazel.importedsource [101]
                Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
                Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.sdk
    -> Bundle-SymbolicName: com.salesforce.bazel.sdk; bundle-version="2.0.0.v20241211-1121"; singleton:="true"
       com.salesforce.bazel.sdk [102]
         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241211-1121"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241211-1121"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2105)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:143)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2096)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2036)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1999)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1915)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341)```

@lonhutt
Copy link
Contributor

lonhutt commented Dec 12, 2024

Which version of the extension do you have installed?

@tomasaschan
Copy link
Author

With the version I had this morning, 1.24.112141547,

a new log from just opening the project today
Dec 16, 2024 9:11:06 AM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
Dec 16, 2024 9:11:07 AM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
[Error - 9:11:13 AM] Dec 16, 2024, 9:11:13 AM Failed to load extension bundles 
Load bundle list
org.eclipse.core.runtime.CoreException: Load bundle list
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:173)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:113)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:68)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:284)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:128)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:271)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:201)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Contains: Bundle startup failed reference:file:/home/tomasl/.vscode-server/extensions/sfdc.bazel-vscode-java-1.24.112141547/server/com.salesforce.bazel.sdk.jar
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.sdk [102]
  Unresolved requirement: Import-Package: org.fusesource.jansi; version="2.4.0"
    -> Export-Package: org.fusesource.jansi; bundle-symbolic-name="org.fusesource.jansi"; bundle-version="2.4.1"; version="2.4.1"; uses:="org.fusesource.jansi.io"
       org.fusesource.jansi [99]
         No resolution report for the bundle.  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241214-1539"
       com.salesforce.bazel.importedsource [101]
         Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
         Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
         Unresolved requirement: Import-Package: javax.annotation; version="3.0.2"; resolution:="optional"
           -> Export-Package: javax.annotation; bundle-symbolic-name="org.jsr-305"; bundle-version="3.0.2"; version="3.0.2"; uses:="javax.annotation.meta"
              org.jsr-305 [98]
                No resolution report for the bundle.         Unresolved requirement: Import-Package: com.google.protobuf; version="3.22.0"
           -> Export-Package: com.google.protobuf; bundle-symbolic-name="com.google.protobuf"; bundle-version="3.25.5"; version="3.25.5"
              com.google.protobuf [100]
         Unresolved requirement: Import-Package: javax.annotation.concurrent; version="3.0.2"; resolution:="optional"
           -> Export-Package: javax.annotation.concurrent; bundle-symbolic-name="org.jsr-305"; bundle-version="3.0.2"; version="3.0.2"
  Unresolved requirement: Import-Package: com.google.protobuf; version="3.22.0"
    -> Export-Package: com.google.protobuf; bundle-symbolic-name="com.google.protobuf"; bundle-version="3.25.5"; version="3.25.5"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:463)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundles(BundleUtils.java:308)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:171)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:113)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:68)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:284)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:128)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:271)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:201)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Contains: Bundle startup failed reference:file:/home/tomasl/.vscode-server/extensions/sfdc.bazel-vscode-java-1.24.112141547/server/com.salesforce.bazel.eclipse.core.jar
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.eclipse.core [103]
  Unresolved requirement: Import-Package: com.github.benmanes.caffeine.cache.stats; version="3.1.8"
    -> Export-Package: com.github.benmanes.caffeine.cache.stats; bundle-symbolic-name="com.github.ben-manes.caffeine"; bundle-version="3.1.8"; version="3.1.8"; uses:="com.github.benmanes.caffeine.cache"
       com.github.ben-manes.caffeine [97]
         No resolution report for the bundle.  Unresolved requirement: Import-Package: com.google.protobuf; version="3.22.0"
    -> Export-Package: com.google.protobuf; bundle-symbolic-name="com.google.protobuf"; bundle-version="3.25.5"; version="3.25.5"
       com.google.protobuf [100]
  Unresolved requirement: Import-Package: com.github.benmanes.caffeine.cache; version="3.1.8"
    -> Export-Package: com.github.benmanes.caffeine.cache; bundle-symbolic-name="com.github.ben-manes.caffeine"; bundle-version="3.1.8"; version="3.1.8"; uses:="com.github.benmanes.caffeine.cache.stats"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.sdk
    -> Bundle-SymbolicName: com.salesforce.bazel.sdk; bundle-version="2.0.0.v20241214-1539"; singleton:="true"
       com.salesforce.bazel.sdk [102]
         Unresolved requirement: Import-Package: org.fusesource.jansi; version="2.4.0"
           -> Export-Package: org.fusesource.jansi; bundle-symbolic-name="org.fusesource.jansi"; bundle-version="2.4.1"; version="2.4.1"; uses:="org.fusesource.jansi.io"
              org.fusesource.jansi [99]
                No resolution report for the bundle.         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241214-1539"
              com.salesforce.bazel.importedsource [101]
                Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
                Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
                Unresolved requirement: Import-Package: javax.annotation; version="3.0.2"; resolution:="optional"
                  -> Export-Package: javax.annotation; bundle-symbolic-name="org.jsr-305"; bundle-version="3.0.2"; version="3.0.2"; uses:="javax.annotation.meta"
                     org.jsr-305 [98]
                       No resolution report for the bundle.                Unresolved requirement: Import-Package: com.google.protobuf; version="3.22.0"
                  -> Export-Package: com.google.protobuf; bundle-symbolic-name="com.google.protobuf"; bundle-version="3.25.5"; version="3.25.5"
                Unresolved requirement: Import-Package: javax.annotation.concurrent; version="3.0.2"; resolution:="optional"
                  -> Export-Package: javax.annotation.concurrent; bundle-symbolic-name="org.jsr-305"; bundle-version="3.0.2"; version="3.0.2"
         Unresolved requirement: Import-Package: com.google.protobuf; version="3.22.0"
           -> Export-Package: com.google.protobuf; bundle-symbolic-name="com.google.protobuf"; bundle-version="3.25.5"; version="3.25.5"
  Unresolved requirement: Import-Package: org.fusesource.jansi; version="2.4.0"
    -> Export-Package: org.fusesource.jansi; bundle-symbolic-name="org.fusesource.jansi"; bundle-version="2.4.1"; version="2.4.1"; uses:="org.fusesource.jansi.io"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241214-1539"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:463)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundles(BundleUtils.java:308)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:171)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:113)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:68)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:284)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:128)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:271)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:201)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Contains: Bundle startup failed reference:file:/home/tomasl/.vscode-server/extensions/sfdc.bazel-vscode-java-1.24.112141547/server/com.salesforce.bazel.importedsource.jar
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.importedsource [101]
  Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
  Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
  Unresolved requirement: Import-Package: javax.annotation; version="3.0.2"; resolution:="optional"
    -> Export-Package: javax.annotation; bundle-symbolic-name="org.jsr-305"; bundle-version="3.0.2"; version="3.0.2"; uses:="javax.annotation.meta"
       org.jsr-305 [98]
         No resolution report for the bundle.  Unresolved requirement: Import-Package: com.google.protobuf; version="3.22.0"
    -> Export-Package: com.google.protobuf; bundle-symbolic-name="com.google.protobuf"; bundle-version="3.25.5"; version="3.25.5"
       com.google.protobuf [100]
  Unresolved requirement: Import-Package: javax.annotation.concurrent; version="3.0.2"; resolution:="optional"
    -> Export-Package: javax.annotation.concurrent; bundle-symbolic-name="org.jsr-305"; bundle-version="3.0.2"; version="3.0.2"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:463)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundles(BundleUtils.java:308)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:171)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:113)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:68)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:284)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:128)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:271)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:201)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Contains: Bundle startup failed reference:file:/home/tomasl/.vscode-server/extensions/sfdc.bazel-vscode-java-1.24.112141547/server/com.salesforce.bazel.eclipse.jdtls.jar
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.eclipse.jdtls [104]
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.eclipse.core
    -> Bundle-SymbolicName: com.salesforce.bazel.eclipse.core; bundle-version="2.0.0.v20241214-1539"; singleton:="true"
       com.salesforce.bazel.eclipse.core [103]
         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241214-1539"
              com.salesforce.bazel.importedsource [101]
                Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
                Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=21))"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.sdk
    -> Bundle-SymbolicName: com.salesforce.bazel.sdk; bundle-version="2.0.0.v20241214-1539"; singleton:="true"
       com.salesforce.bazel.sdk [102]
         Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
           -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241214-1539"
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20241214-1539"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:463)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundles(BundleUtils.java:308)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:171)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:113)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:68)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:284)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:128)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:271)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:201)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

All of it seems to stem from org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.sdk [102]. Do I have to install something outside of the plugin itself to make this work?

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

3 participants