microsoft/vscode-lombok

unexpected substitution of javaagent settings

nedlosster opened this issue · 1 comments

The recent change from plugin ID GabrielBB.vscode-lombok to vscjava.vscode-lombok seems to produce problems.
Up to this point, everything worked.

Now i have error:

'Language Support for Java (Syntax Server) server encountered error and will shut down: undefined

{
  message: 'Language Support for Java (Syntax Server) server encountered error and will shut down: undefined, Error: write EPIPE',
  level: 'error',
  timestamp: '2022-07-06 08:46:06.151'
}
{
  message: '[Error - 8:46:06 AM] Connection to server is erroring. Shutting down server.',
  level: 'info',
  timestamp: '2022-07-06 08:46:06.152'
}
{
  message: 'Picked up JAVA_TOOL_OPTIONS: -XX:+IgnoreUnrecognizedVMOptions -XX:+PortableSharedCache -XX:+IdleTuningGcOnIdle -Xshareclasses:
name=openj9_system_scc,cacheDir=/opt/java/.scc,readonly,nonFatal\n' +
    'Failed to find Premain-Class manifest attribute in /home/app/.m2/repository/org/projectlombok/lombok-mapstruct-binding/0.2.0/lombok-m
apstruct-binding-0.2.0.jar\n',
  level: 'info',
  timestamp: '2022-07-06 08:00:01.584'
}

my settings.json:

{
    "java.configuration.updateBuildConfiguration": "automatic",
    "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -javaagent:\"/home/app/.vscode-server/extensions/vscjava.vscode-lombok-1.0.1/server/lombok.jar\"",
    "java.jdt.ls.lombokSupport.enabled": true
}

In the logs I see that the javaagent setting is different:

{
  message: 'Starting Java server with: /home/app/.vscode-server/extensions/redhat.java-1.8.0-linux-x64/jre/17.0.3-linux-x86_64/bin/java --
add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.n
io.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.l
s.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:Adapt
iveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -javaagent:/home/app/.m2/repository/org/projectlombok/lombok-ma
pstruct-binding/0.2.0/lombok-mapstruct-binding-0.2.0.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/app/.vscode-server/data/Us
er/workspaceStorage/0340accbc9f51cfdd79fb9fa0dd6c7c0-1/redhat.java -jar /home/app/homeapp/.vscode-server/extensions/redhat.java-1.8.0-linu
x-x64/server/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar -configuration /home/app/.vscode-server/data/User/globalStora
ge/redhat.java/1.8.0/config_linux -data /home/app/.vscode-server/data/User/workspaceStorage/0340accbc9f51cfdd79fb9fa0dd6c7c0-1/redhat.java
/jdt_ws',
  level: 'info',
  timestamp: '2022-07-06 08:00:01.691'
}

javaagent:/home/app/.m2/repository/org/projectlombok/lombok-ma
pstruct-binding/0.2.0/lombok-mapstruct-binding-0.2.0.jar

when i set

"java.jdt.ls.lombokSupport.enabled": false

substitution does not occur and Syntax Server started correctly.
but without lombok support, the project is not compiled in vscode

Version: 1.68.1
Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630
Date: 2022-06-15T02:58:26.441Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.16.15-051615-generic

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.6.6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.mcn</groupId>
	<artifactId>wstmpl2</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>wstmpl2</name>
	<description>Demo project for Spring Boot</description>
	<properties>
		<java.version>17</java.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
		<dependency>
			<groupId>org.springdoc</groupId>
			<artifactId>springdoc-openapi-ui</artifactId>
			<version>1.6.8</version>
        </dependency>
		  <dependency>
        <groupId>org.springdoc</groupId>
          <artifactId>springdoc-openapi-webmvc-core</artifactId>
          <version>1.6.8</version>
        </dependency>
		<dependency>
			<groupId>org.liquibase</groupId>
			<artifactId>liquibase-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>42.3.4</version>
		</dependency>
		<dependency>
			<groupId>org.mapstruct</groupId>
			<artifactId>mapstruct</artifactId>
			<version>1.4.2.Final</version>
        </dependency>
		<dependency>
			<groupId>org.mapstruct</groupId>
			<artifactId>mapstruct-processor</artifactId>
			<version>1.4.2.Final</version>
        </dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok-mapstruct-binding</artifactId>
			<version>0.2.0</version>
        </dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
			<version>1.18.22</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>
							<groupId>org.projectlombok</groupId>
							<artifactId>lombok</artifactId>
						</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>

The developer container is created from maven:3.8.5-ibm-semeru-17-focal

Why is there a substitution of settings javaagent?

#73 - Perhaps this is somehow a solution to this problem.
upd: I Installed the extension from pull #73. According to pullrequest , the last lombok was dowloaded.

but problem persists.

I found the reason.
This is an error in the vscode-java 1.8.0 extension.
vscode-java 1.7.0 works correctly.
there's even an edit already, but it will be available in 1.9.0

redhat-developer/vscode-java@86c572d - this commit fixes it