redhat-developer / vscode-server-connector

📦 Connects Visual Studio Code to your server adapters and run, deploy apps !!
Eclipse Public License 2.0
57 stars 26 forks source link

How to start custom "standalone.sh" instead of standart standalone.sh #430

Closed webalexx closed 4 years ago

webalexx commented 4 years ago

Hallo Guis,

i need to start jRebel with auto update on Wildfly. In JRebel's docu is sad:

https://manuals.jrebel.com/jrebel/standalone/launch-from-command-line.html#wildfly-10-x-or-newer-java-8

Open $WILDFLY_HOME/bin.

Create the file standalone-jrebel.sh with the following content:

!/bin/bash

export REBEL_HOME=JRebel root folder. export JAVA_OPTS="-agentpath:$REBEL_HOME/lib/libjrebel64.dylib $JAVA_OPTS" dirname $0/standalone.sh $@ Use this script instead of standalone.sh to run WildFly with JRebel.

Warning

Any further customization to JAVA_OPTS inside the WildFly executable (default standalone.conf.sh) needs to be included in standalone-jrebel.sh for JRebel to function correctly.

Give me please one tip - how can I do it optimal way?

robstryker commented 4 years ago

So, our extension doesn't use the shell scripts. We use the raw java commands.

When you create your server via the UI, whether it's downloading a new instance or creating one out of an installation already on disk, we create some fields you can modify on our server object. After creating your server, you can right-click on it and select edit server. You will see something like the following:

{ "args.override.boolean": "false", "args.program.override.string": "-mp \"/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded/modules\" org.jboss.as.standalone --server-config=standalone.xml", "args.vm.override.string": "\"-Dprogram.name=rsp:wf18\" -server -Xms64m -Xmx512m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true \"-Dorg.jboss.boot.log.file=/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded/standalone/log/boot.log\" \"-Dlogging.configuration=file:/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded/standalone/configuration/logging.properties\" \"-Djboss.home.dir=/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded\" -Dorg.jboss.logmanager.nocolor=true -Djboss.bind.address.management=localhost", "id": "wf18", "id-set": "true", "org.jboss.tools.rsp.server.typeId": "org.jboss.ide.eclipse.as.wildfly.180", "server.home.dir": "/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded", "wildfly.publish.restart.pattern": "\\.class$|\\.jar$" }

Looking at jrebel's suggestions, it seems they want you to add -agentpath:$REBEL_HOME/lib/libjrebel64.dylib to your vm arguments. So, you would modify the following two fields.

First, you need to mark that you are overriding the args. You should edit the args.override.boolean field so it has a value of true instead of false.

Once this is edited, you will need to modify your VM argument list. Right now it has the following:

"args.vm.override.string": "\"-Dprogram.name=rsp:wf18\" -server -Xms64m -Xmx512m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true \"-Dorg.jboss.boot.log.file=/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded/standalone/log/boot.log\" \"-Dlogging.configuration=file:/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded/standalone/configuration/logging.properties\" \"-Djboss.home.dir=/home/rob/apps/jboss/unzipped/wildfly-18.0.0.Final.zip.expanded\" -Dorg.jboss.logmanager.nocolor=true -Djboss.bind.address.management=localhost",

You should insert -agentpath:/your/path/to/jrebel/lib/libjrebel64.dylib in that field after the -server flag. Then, of course, try to save the editor so the changes are persisted back to the RSP.

Best of luck!

webalexx commented 4 years ago

Yes, of course, it's the best way. Thanks a lot!

robstryker commented 4 years ago

Closing as fixed. Please re-open if this doesn't fix your issue!