matthiasblaesing commented on issue #6692:
URL: https://github.com/apache/netbeans/issues/6692#issuecomment-1872609695

   The problem seems to be, that JShell is always initialized in "modular" 
mode. This requires a clean project setup and dependencies that work in modular 
mode. My minimal test setup, that reproduces the issue (@suhaila-5 why did you 
not follow my hint to pin-point the problem?!) is here:
   
   
[mavenproject1.zip](https://github.com/apache/netbeans/files/13799173/mavenproject1.zip)
   
   Running `Execute JShell` there yields: 
   
   ```
   |  Could not initialize JShell: Launching JShell execution engine threw: 
Failed remote launch: java.util.concurrent.ExecutionException: 
com.sun.jdi.connect.VMStartException: VM initialization failed for: 
/home/matthias/bin/jdk-21/bin/java -classpath 
/home/matthias/src/netbeans/nbbuild/netbeans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED -Xdebug 
-Xrunjdwp:transport=dt_socket,address=localhost:33139,suspend=y,includevirtualthreads=n
 org.netbeans.lib.jshell.agent.AgentWorker 36067 @ 
com.sun.jdi.CommandLineLaunch (defaults: home=/home/matthias/bin/jdk-21, 
options=, main=, suspend=true, quote=", vmexec=java, includevirtualthreads=n) 
-- {home=home=/home/matthias/bin/jdk-21, options=o
 ptions=-classpath 
/home/matthias/src/netbeans/nbbuild/netbeans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED, main=main=org.netbeans.lib.jshell.agent.AgentWorker 
36067, suspend=suspend=true, quote=quote=", vmexec=vmexec=java, 
includevirtualthreads=includevirtualthreads=n}
   |    caused by: Failed remote launch: 
java.util.concurrent.ExecutionException: com.sun.jdi.connect.VMStartException: 
VM initialization failed for: /home/matthias/bin/jdk-21/bin/java -classpath 
/home/matthias/src/netbeans/nbbuild/netbeans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED -Xdebug 
-Xrunjdwp:transport=dt_socket,address=localhost:33139,suspend=y,includevirtualthreads=n
 org.netbeans.lib.jshell.agent.AgentWorker 36067 @ 
com.sun.jdi.CommandLineLaunch (defaults: home=/home/matthias/bin/jdk-21, 
options=, main=, suspend=true, quote=", vmexec=java, includevirtualthreads=n) 
-- {home=home=/home/matthias/bin/jdk-21, options=options=-classpath 
/home/matthias/src/netbeans/nbbuild/netb
 
eans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED, main=main=org.netbeans.lib.jshell.agent.AgentWorker 
36067, suspend=suspend=true, quote=quote=", vmexec=vmexec=java, 
includevirtualthreads=includevirtualthreads=n}
   |    caused by: com.sun.jdi.connect.VMStartException: VM initialization 
failed for: /home/matthias/bin/jdk-21/bin/java -classpath 
/home/matthias/src/netbeans/nbbuild/netbeans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED -Xdebug 
-Xrunjdwp:transport=dt_socket,address=localhost:33139,suspend=y,includevirtualthreads=n
 org.netbeans.lib.jshell.agent.AgentWorker 36067
   |    caused by: VM initialization failed for: 
/home/matthias/bin/jdk-21/bin/java -classpath 
/home/matthias/src/netbeans/nbbuild/netbeans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED -Xdebug 
-Xrunjdwp:transport=dt_socket,address=localhost:33139,suspend=y,includevirtualthreads=n
 org.netbeans.lib.jshell.agent.AgentWorker 36067
   ```
   
   Now running the last command manually yields:
   
   ```
   matthias@enterprise:/tmp$ /home/matthias/bin/jdk-21/bin/java -classpath 
/home/matthias/src/netbeans/nbbuild/netbeans/java/modules/ext/nb-mod-jshell-probe.jar:/tmp/mavenproject1/target/classes:/home/matthias/.m2/repository/com/sun/jersey/jersey-client/1.18.1/jersey-client-1.18.1.jar:/home/matthias/.m2/repository/com/sun/jersey/jersey-core/1.18.1/jersey-core-1.18.1.jar
 --add-modules jdk.jshell,jersey.client,jersey.core,mavenproject1 --add-reads 
jdk.jshell=ALL-UNNAMED -Xdebug 
-Xrunjdwp:transport=dt_socket,address=localhost:33139,suspend=y,includevirtualthreads=n
 org.netbeans.lib.jshell.agent.AgentWorker 36067                                
   
   Error occurred during initialization of boot layer
   java.lang.module.FindException: Module jersey.client not found
   matthias@enterprise:/tmp$ 
   ```
   
   `com.sun.jersey:jersey-client:1.18.1` is not modular, so `jersey.client` is 
the "guessed" module name. Seems JShell does not like it.
   
   The real problem from my POV though is, that this project is not modular, so 
should not have been invoked in modular mode.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to