Backport of #2757 hotfix to 12.2 branch
diff --git a/java/java.lsp.server/build.xml b/java/java.lsp.server/build.xml
index 48e9311..50bfb11 100644
--- a/java/java.lsp.server/build.xml
+++ b/java/java.lsp.server/build.xml
@@ -129,7 +129,11 @@
 
         <zip destfile="${build.dir}/apache-netbeans-java-${vsix.version}.vsix" basedir="${build.dir}/vscode-mandatory/" update="true" />
     </target>
-    <target name="test-vscode-ext" description="Tests the Visual Studio Code extension built by 'build-vscode-ext' target.">
+    <target name="test-lsp-server" description="Tests the LSP server behavior">
+        <ant dir="nbcode" target="test" inheritall="false" inheritrefs="false" />
+    </target>
+
+    <target name="test-vscode-ext" depends="test-lsp-server" description="Tests the Visual Studio Code extension built by 'build-vscode-ext' target.">
         <exec executable="npm" failonerror="true" dir="vscode">
             <arg value="--allow-same-version"/>
             <arg value="run" />
diff --git a/java/java.lsp.server/nbcode/integration/manifest.mf b/java/java.lsp.server/nbcode/integration/manifest.mf
index 5e5cf71..a2a134c 100644
--- a/java/java.lsp.server/nbcode/integration/manifest.mf
+++ b/java/java.lsp.server/nbcode/integration/manifest.mf
@@ -1,6 +1,7 @@
 Manifest-Version: 1.0
 AutoUpdate-Show-In-Client: false
 OpenIDE-Module: org.netbeans.modules.nbcode.integration
+OpenIDE-Module-Layer: org/netbeans/modules/nbcode/integration/layer.xml
 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nbcode/integration/Bundle.properties
 OpenIDE-Module-Specification-Version: 1.0
 OpenIDE-Module-Recommends: cnb.org.netbeans.modules.gradle.java
diff --git a/java/java.lsp.server/nbcode/integration/nbproject/project.xml b/java/java.lsp.server/nbcode/integration/nbproject/project.xml
index 78bfd93..35877ca 100644
--- a/java/java.lsp.server/nbcode/integration/nbproject/project.xml
+++ b/java/java.lsp.server/nbcode/integration/nbproject/project.xml
@@ -91,7 +91,24 @@
                         <specification-version>8.44</specification-version>
                     </run-dependency>
                 </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.updatecenters</code-name-base>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.51</specification-version>
+                    </run-dependency>
+                </dependency>
             </module-dependencies>
+            <test-dependencies>
+                <test-type>
+                    <name>unit</name>
+                    <test-dependency>
+                        <code-name-base>org.netbeans.modules.nbjunit</code-name-base>
+                        <compile-dependency/>
+                        <recursive/>
+                    </test-dependency>
+                </test-type>
+            </test-dependencies>
             <public-packages/>
         </data>
     </configuration>
diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
new file mode 100644
index 0000000..a1a03ee
--- /dev/null
+++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
+<filesystem>
+    <folder name="Services">
+        <folder name="AutoupdateType">
+            <file name="82pluginportal-update-provider.instance_hidden"/>
+            <file name="distribution-update-provider.instance_hidden"/>
+            <file name="pluginportal-update-provider.instance_hidden"/>
+        </folder>
+    </folder>
+</filesystem>
diff --git a/java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifyJustOneUpdateCenterTest.java b/java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifyJustOneUpdateCenterTest.java
new file mode 100644
index 0000000..d176098
--- /dev/null
+++ b/java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifyJustOneUpdateCenterTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.nbcode.integration;
+
+import java.util.Arrays;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+
+public class VerifyJustOneUpdateCenterTest extends NbTestCase {
+
+    public VerifyJustOneUpdateCenterTest(String name) {
+        super(name);
+    }
+
+    public static junit.framework.Test suite() {
+        return NbModuleSuite.createConfiguration(VerifyJustOneUpdateCenterTest.class).
+            gui(true).
+            suite();
+    }
+
+    public void testUpdateCenters() {
+        FileObject services = FileUtil.getConfigRoot().getFileObject("Services");
+        assertNotNull("Services found", services);
+        FileObject au = services.getFileObject("AutoupdateType");
+        assertNotNull("AutoUpdate folder found", au);
+        FileObject[] arr = au.getChildren();
+        assertEquals("Just one AutoUpdate center registration: " + Arrays.toString(arr), 1, arr.length);
+        assertEquals("3rdparty.instance", arr[0].getNameExt());
+    }
+}
diff --git a/java/java.lsp.server/nbcode/nbproject/platform.properties b/java/java.lsp.server/nbcode/nbproject/platform.properties
index 7ea8766..fe263d4 100644
--- a/java/java.lsp.server/nbcode/nbproject/platform.properties
+++ b/java/java.lsp.server/nbcode/nbproject/platform.properties
@@ -22,6 +22,7 @@
     ${nbplatform.active.dir}/java:\
     ${nbplatform.active.dir}/nb:\
     ${nbplatform.active.dir}/platform:\
+    ${nbplatform.active.dir}/harness:\
     ${nbplatform.active.dir}/webcommon
 disabled.modules=\
     bcpg,\
@@ -82,6 +83,8 @@
     org.netbeans.libs.jsr223,\
     org.netbeans.libs.jstestdriver,\
     org.netbeans.libs.jvyamlb,\
+    org.netbeans.libs.nbi.ant,\
+    org.netbeans.libs.nbi.engine,\
     org.netbeans.libs.plist,\
     org.netbeans.libs.smack,\
     org.netbeans.libs.springframework,\
@@ -94,6 +97,7 @@
     org.netbeans.modules.ant.grammar,\
     org.netbeans.modules.ant.hints,\
     org.netbeans.modules.ant.kit,\
+    org.netbeans.modules.apisupport.harness,\
     org.netbeans.modules.applemenu,\
     org.netbeans.modules.autoupdate.pluginimporter,\
     org.netbeans.modules.beans,\
@@ -237,6 +241,8 @@
     org.netbeans.modules.javawebstart,\
     org.netbeans.modules.jellytools.ide,\
     org.netbeans.modules.jellytools.java,\
+    org.netbeans.modules.jellytools.platform,\
+    org.netbeans.modules.jemmy,\
     org.netbeans.modules.jshell.support,\
     org.netbeans.modules.junit,\
     org.netbeans.modules.junit.ant,\
diff --git a/java/java.lsp.server/vscode/src/extension.ts b/java/java.lsp.server/vscode/src/extension.ts
index c3a78f3..dff602e 100644
--- a/java/java.lsp.server/vscode/src/extension.ts
+++ b/java/java.lsp.server/vscode/src/extension.ts
@@ -307,7 +307,7 @@
             if (isOut) {
                 stdOut += text;
             }
-            if (stdOut.match(/org.netbeans.modules.java.lsp.server.*Enabled/)) {
+            if (stdOut.match(/org.netbeans.modules.java.lsp.server/)) {
                 resolve(text);
                 stdOut = null;
             }