in Education by
I am setting up a common standalone-full.xml file for all server environments, and therefore need to have variables for database URL's (and such), instead of hard coding them. One such section in the configuration file might look like this: jdbc:mysql://${SOMENAME_DB_URL} com.mysql.jdbc.Driver mysql 5 15 ${DB_USERNAME} ${DB_PASSWORD} false false false However, upon starting the server with this config file it simply throws an "Unable to resolve expression" error for all such sections. I've tried putting the variables in /etc/environment, as well as in the .jbossclirc file in /bin using set DB_USERNAME=mydbusername, but to no avail. As you can see I'm fumbling a bit in the dark here since I haven't been able to find any proper documentation on how to do this. I'm not even sure if it's actually possible. Any help is greatly appreciated. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
For this, you can use Java system properties instead of environment variables. Pass -D arguments to standalone.sh Let’s see how to pass this -D arguments with an example bin/standalone.sh -DDB_USERNAME=me -DDB_PASSWORD=secret There is one more alternative way where you can define your properties in a properties file and pass this to startup script with -p options Let’s see this with an example bin/standalone.sh -P database.properties

Related questions

0 votes
    My git workspace is dirty, there are some local modifications. When I use the command git pull origin master it ... Ansible git module? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am trying to do a poc of Jenkins pipeline as code. I am using the Github organization folder plugin to ... descriptions for the jobs Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Do I need to use separate Docker containers for my complex web application or I can put all required services in ... in one container? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have deleted a folder containing a running Vagrant box before realizing it was still running. How can I delete ... the Virtualbox VM. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I want to migrate my webapp from Amazon EC2 to ECS. I ECS I have to allocate memory and vCPU for the ... needed for the process? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    What is the difference between Log stash and Kafka? Which one is better and how? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I want to expose multiple ports to the machine’s interface. How to achieve this using a docker container? Please help. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Could someone tell me whether as a non-IT engineer could I shift my career to DevOps? Select the correct answer from above options...
asked Jan 6, 2022 in Education by JackTerrance
0 votes
    Could someone tell me how to start a DevOps career? Select the correct answer from above options...
asked Jan 6, 2022 in Education by JackTerrance
0 votes
    Let's say I have one variable, directory_list, which I define and set in a ruby_block named get_directory_list. Can ... woohoo" end end Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Now that links are deprecated in docker-compose.yml (and were able to use the new networking feature to ... docker-compose.yml? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am successfully able to connect to a remote machine using SSH but when I am launching the agent from Jenkins ... overcome this issue? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am successfully able to connect to a remote machine using SSH but when I am launching the agent from Jenkins ... overcome this issue? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I'm just getting my feet wet with Ansible 2.2 and Devops and I've run into the following problem. I have a ... . How to fix this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am trying to start a local Kubernetes cluster using minikube start and getting the following error. Starting local ... this slow? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
...