Adding interface to wildfly - configuration

By changing the management and public interface to the host name in standalone.xml , we can allow remote access to wildfly. Want to do this directly without touching the standalone xml file.
Using wildfly cli interactive mode, added the following and it works well.
/interface=localHostName/:add(inet-address= "${jboss.bind.address.management:<hostname of target box>}")
Now, i want to add the same in cli non-interactive mode using the --command/--commands option
Tried this, but getting stuck at the syntax thing,
./jboss-cli.sh --connect command="/interface=localHostName/:add(inet-address="${jboss.bind.address.management:<hostname of target box>}")"
Please let me know the correct syntax of adding an inet-address to wildfly through command option.

actually this should work:
./jboss-cli.sh -c --command="/interface=localHostName:add(inet-address=${jboss.bind.address.management:<hostname of target box>})"
but I also get an error with the variable replacement. I checked it with this command and it worked:
./jboss-cli.sh -c --command="/interface=localHostName:add(inet-address=<hostname of target box>)"
I also had a glance at the jboss-cli.xml configuration file but the resolve-parameter-values property was already set to false so I don't know why the CLI is trying to replace this property.
The question is if you really need this property. I think you won't since you are setting it to the same property as the management-interface. So passing this property at startup will change both interfaces' inet-address values. I'm also setting the address using a CLI script and also omit the property since this interface's inet-address binding won't be changed for productional setup.

Related

yii2: model relations error can't find another class in ubuntu server 16.04

I have upload my YII2 project to ubuntu 16.04.
My source is no problem when run on localhost on my computer, but when I run it on the server ubuntu 16.04 with network, it has a problem.
The model source can't find another relation model
public function getLokasiAwal()
{
return $this->hasOne(KotaBandara::className(), ['id_kota' => 'lokasi_awal']);
}
and i have error
Class 'backend\models\TypeNonstaf' not found
I have found the solution, I added the following code:
use backend\models\Kotabandara;
On top in model file but, in my source in localhost,
I do not need to add that code
Can someone explain that issue??
As #rob006 pointed out, it appears that you had been working/running your app on a Windows local file system, which is case-preserving, but not case-sensitive.
When you first call upon a namespaced class directly or via the use operator, it passes this full class name as $className into yii\BaseYii\autoload::($className) (Yii2's global class autoloading handler), which in turn attempts to include the corresponding class file, if found.
So, on your Windows local machine, when you use backend\models\KotaBandara, it will find and include any file associated with the corresponding path alias in a case-insensitive manner, thus it will find any of:
#backend/models/KotaBandara.php
#backend/models/Kotabandara.php
#backend/models/kotabandara.php
#backend/models/KoTaBaNdArA.php
There can be only 1 target file with this sequence of paths/characters anyway.
However, when you migrate this code to a Ubuntu system, which is both case-preserving and case-sensitive, there is a distinct difference between KotaBandara.php and kotabandara.php and in fact both files can exist side by side, unlike on Windows.
So, you have to be precise here - on Ubuntu, use backend\models\KotaBandara will trigger the autoloader to find only the file whose path AND case matches, i.e. KotaBandara.php. If you named the file kotabandara.php, it will be found on Windows, but not on Ubuntu!

Selenium Grid: set chrome *binary* path

Note: I am not asking about setting the path of the chromedriver.
I want to run a Selenium node with a specific version of Chromium as opposed to the default Chrome installed on the system. The webdriver doc says I would need to pass a ChromeOptions object, but this is obviosuly impossible to do on the command line.
I've tried manually adding a JSON that represents ChromeOptions to the command line (like below), but it does not have any effect.
java.exe -jar selenium-server-standalone-2.47.1.jar -role node -hub http://localhost:4444/grid/register -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=5,chromeOptions={binary:./chromium/chrome.exe} -Dwebdriver.chrome.driver=chromedriver.exe
(I've tried all different ways of quoting the JSON, but it is simply not used.)
What has not been made clear in the bug filed for this nor the documentation is that a new capability key "chrome_binary" has been added to specifically support this. See commit 41a9d29.
This key can be used in the -browser argument used to start a node and the node will build the ChromeOption for you.

<virtualport type='openvswitch'/> is NOT recognized

In order to make my vm use the openvswitch interface I have to add the following lines to a vm xml config file:
I edit the file, anyway while the first line is corrctly saved, the second one is not. It simply disappears, so I think the virtualport tag is not recognized...but this leads to an error when I start the virtual machine.
it requires libvirt 0.10.0+ to use <virtualport type='openvswitch'/>. check your libvirt version first.

How do I package a log4j configuration file in a NetBeans Platorm application?

Packaging a log4j configuration file in a NetBeans Platform application apparently requires some thinking through. This is what I tried...
I put log4j.xml in src/main/resources/my/package/log4j.xml of some_netbeans_module. The package is a public module package (i.e. classes from this package are used from other packages). I rebuilt the module and confirmed that the file does, in fact, get packaged into the module.
In my classes I get an instance of the logger the way I always do:
static final Logger log = Logger.getLogger(ThisClass.class);
Every NetBeans Platform application has a my_app.conf file which makes it possible to set certain properties. This is where I set log4j.conf:
log4j.configuration="/my/package/log4j.xml"
Now, when I run the application, I see the following output:
[INFO] /home/me/my_app/application/target/my_app/bin/../etc/my_app.conf: 5:
log4j.configuration=/my/package/log4j.xml: not found
What is wrong with the above configuration?
In the my_app.conf file if you append the log4j.configuration property to the default_options property, like so:
default_options="...<other options> -J-Dlog4j.configuration=my/package/log4j.xml"
then this option will get passed to the JVM. Notice that the log4j property has -J-D appended to it. The -J is used by NetBeans to delineate JVM properties and the -D is used by the JVM to delineate a system property.
Also you can/should drop the quotes and the initial / as the quotes are not necessary and NetBeans will complain if you have the initial /
The other way to do this, and the way that I prefer since it doesn't require editing the .conf file, is to put the log4j.xml file into the default package. If you have other requirements that prevents you from doing this then remember that you must put the log4j.configuration property in the app's platform.properties file while your in dev mode and running the app inside of the IDE. Like so:
run.args.extra=-J-Dlog4j.configuration=my/package/log4j.xml
Edit: For questions regarding NetBeans Platform you might have better luck posting to the NetBeans Platform Users forum.

SQL Server Agent Adding a Parameter for a CmdExec

I want to add a parameter to a step that runs an operating system (CmdExec) in SQL Server Agent. I have searched everywhere and asked my coworkers and none of them had tried it before. I have attached a picture of the screen. I was thinking that I might be able to add the parameter (file path) after the .exe statement, but wasn't sure.
I thought the following might work:
Executable Path Parameter Path
C:\MyProgram\MyApp.exe E:\AppInfo\Client\Config.txt
This is on a production server and I didn't want to break anything if this isn't correct.
Thanks!
Yes You can use parameters, so your command would be:
C:\MyProgram\MyApp.exe E:\AppInfo\Client\Config.txt
If there is a space in the name don't forget to use quotes as specified in tip in screenshot:
"C:\My Program\MyApp.exe" "E:\App Info\Client\Config.txt"
Since You want to try it on production server, consider testing your configuration and software on test environment first. If You doubt that this will work, You can set job to execute only this single step to make sure it will work as expected.