-
1. Re: Q: Adding Cli Command to Deployment Module
jamezp Sep 9, 2014 8:01 PM (in response to insanitydesign)You're missing the required value attribute for the add operation on system properties. The command should be something like /system-property=com.insanitydesign.test:add(value="some value")
--
James R. Perkins
-
2. Re: Q: Adding Cli Command to Deployment Module
insanitydesign Sep 10, 2014 8:04 AM (in response to jamezp)Hi James
Thanks for the feedback. I actually also did it with
cmdCtx.handleSafe("/system-property=com.insanitydesign.test:add(value=true)"); //not-working
and it was the same. I just tested and
/system-property=com.insanitydesign.test:add
is actually working directly through the CLI command line (sounds weird ^^). So that is unfortunately not the problem that popped up here.
Thanks
-
3. Re: Q: Adding Cli Command to Deployment Module
jamezp Sep 10, 2014 7:39 PM (in response to insanitydesign)What is the error message you're getting? Does the property already exist when you attempt to add it?
--
James R. Perkins
-
4. Re: Q: Adding Cli Command to Deployment Module
insanitydesign Sep 11, 2014 2:47 AM (in response to jamezp)Hi there
The error I get is that it cannot connect. I tried with an already existing property in the config and without, just to be sure.
The exact error message is:
org.jboss.as.cli.CommandLineException: The controller is not available at 127.0.0.1:9990
Because of that I already thought the Wildfly is not reachable but through jboss-cli directly I can access and the read commands work. I am a little unsure really where to look at based on that.
I tried to set it to localhost, to 127.0.0.1 directly, do my systems name but always the same. From the logs I can see that it is booted there.
Code wise I tried to keep it straight by just having
cmdCtx.connectController();
cmdCtx.handle("/subsystem=logging:read-operation-names");
cmdCtx.handleSafe("/system-property=com.insanitydesign.test:read-resource");
cmdCtx.handleSafe("/system-property=com.insanitydesign.test:add");
As you can see I tried several. Read operations work, read resources work and then it fails back on
cmdCtx.connectController();
actually. Do read operations not need a connection? Or does the connection break after an operation it cannot compute? Do I have to flag the connection accordingly?
Thanks
-
5. Re: Q: Adding Cli Command to Deployment Module
insanitydesign Sep 11, 2014 8:15 AM (in response to insanitydesign)Ok, I tried it now separated from a deployment and not inside a module and there it works. The same code triggers and fires normally.
Now I am more confused
-
6. Re: Q: Adding Cli Command to Deployment Module
jamezp Sep 11, 2014 11:44 AM (in response to insanitydesign)Are you trying to modify the system properties during the deployment process? If so that will not work. You can use tools like the wildfly-maven-plugin to configure a server before you deploy, but the server must be running.
--
James R. Perkins
-
7. Re: Q: Adding Cli Command to Deployment Module
insanitydesign Sep 11, 2014 12:14 PM (in response to jamezp)Hi there
Yes, that was my original intend and I somehow already thought that. Unfortunate but ok.
But I have a question: If the server is already fully running and the deployment is added into a running server, should it work then or only during startup deployment is not working?
Maven does not help me a lot there as I would like to alter multiple live servers, where I have no direct access to to fire such. Why I wanted to have a module running to do that for me. But it seems this is then something not possible.
Thanks