Ejb jar for Jboss PER environment - ant

I am trying to read the attributes from a properties file into a field in ejb-jar.xml via ANT.
I have one properties file PER environment which contains an IP address which must be written into ejb-jar.xml when ANT is building the ear.
How would I accomplish that ?

please refer https://ant.apache.org/manual/Tasks/replace.html
check this : if you have someDirectory/cofiguration.properties in which you have IP configuration as per your environments and in that property file ipAddress.key is the key and want to replace with the value of it.
ejbIPAddress will be replaced by ipAddress.key value of someDirectory/cofiguration.properties

Related

how to make MuleSoft webconsumer connector fields get dynamic values

Invalid wsdl location.
The property key is not being read.
Steps that I've done so far
1. create dev.properties file
2. inside dev. properties file
Web Service configuration
ccms.web.location=http://[host_name]:[port]/CreateSegmentDEV/CreateSegmentServiceimpl?WSDL
I put the ${ccms.web.location} in wsdl location
Got error ${ccms.web.location} should be a valid URL or in a file classpath. Please see screenshot that I will upload.
I expected that no error but there is error, invalid wsdl location.
The property key is not being read.
Did you configure the configuration properties in the global elements and specifiy the property file (dev)?

Jmeter : Reading variable from csv and pass it into another varaible

I want to read a variable from CSV and use that value into another variable.
Example:
I have a variable as:
${url}: wwww.$(value_from_csv}.com
and secondary url ${url}/xyz
In my Jmeter script, ${value_from_csv} is not passed.
What I am missing?
Observed that CSV Dataset Config values are not passed (not available) to any of the Config Elements irrespective of the order of the components (Config Elements) in JMeter Test Plan (checked with User Defined Config & MongoDB Source Config), though passed to Samplers.
so, suggested the OP to define the value in jmeter.properties instead of a CSV file, so we can access user.host in MongoDB Source Config.
Steps:
Add user.host=address in jmeter.properties
Restart Jmeter
Add ${__P(user.host,)} in Server Address List field in MongoDB Source Config
Note: In case of running JMeter script from Jenkins, property will be picked by the script, from jmeter.properites file.
MongoDB Source Config is initialized before any JMeter Variables so the only way to make it dynamic is using JMeter Properties instead.
You can set a JMeter Property in 2 ways:
Define it in user.properties file like:
server.address.1=some.ip.or.hostname.1
server.address.2=some.ip.or.hostname.2
Pass the properties via -J command-line arguments like:
jmeter -Jserver.address.1=some.ip.or.hostname.1 -Jserver.address.2=some.ip.or.hostname.2 ....
See Apache JMeter Properties Customization Guide for more information on using JMeter Properties

In DropWizard, can we have a default YAML configuration file?

We are using DropWizard v0.8.1 and we're wondering if we can have a YAML files with default values that will then get overridden by the specific environment file (such as dev.xml).
Spring boot works this way, where the application.yml file act as a template for default values and then application-dev.yml will override duplicate properties.
We don't want to duplicate all the repetitive properties and only want to update in one file the defaults.
You can write your own ConfigurationProvider that combines 2 InputStreams and use yaml merge directives
You can use a configuration management tool, such as Ansible, to manage your configurations files.
Set up a template .yml file, and substitute the variables per environment as needed.

Inject environment variables plugin is passing value as "12345"

I am using "Inject environment variables" Jenkins plugin to pass values to child jobs. Property file name is config.Today_date(eg. config.0403) and it has two parameters in it 1. change list(eg. 175444) 2. today's date(eg. 04032014). In child job Properties file path is config.${Today_date}($Today_date is predefined parameter in parent job).
First issue is: it error out saying config."Today_date" do not exist. I went to location and found property file is there and realized that child job is searching properties file as config."Today_date"(config."0403")and actual name of file is config.today_date
Second issue is: if i put property file name as config.0403(today_date) in Properties file path, Then it successfully locate the file but where ever it use parameters from this file, it use them as "0403" & "175444"
Please advise how i can solve "" issue at both locations.
Thanks !!

Using ANT with multiple XSD and single XJB

I have a custom external XJB file that has the schema name within it as follows :
jxb:bindings schemaLocation="completeCheck.xsd" node="/xs:schema"
Just wondering, is there a way to substitute the schema name at runtime within the XJB file using ANT(using ANT XJC) OR have a xjb binding file written such that I do not have to hardcode the schema name in it. Basically, I am trying to see if I can use a single xjb file for multiple XSDs.
Currently, I have the same xjb file all over the place with a different hardcoded schema name referred all over the place in build.xml. Any pointers are highly appreciated. I am using JAXB 2.x
Make a template from your xjb file by replacing the value of your schemaLocation attribute with some sort of marker (e.g. !!!) and save it using some other name/extension. Define a macro with an attribute such as schema-name that will use ant's replace to change the marker in the template file with your schema name and save that as the binding file to be subsequently used by xjc.
Normally, in the latest versions of XJC, you can use schema component designator. More info here :
https://jaxb.java.net/nonav/2.2.1/docs/vendorCustomizations.html#scd and https://jaxb.java.net/guide/Using_SCD_for_customizations.html

Resources