How to override mule config file name in Mule Studio? - mule

MuleStudio or its plugin for eclipse uses mule-config.xml file by default. Is there an option to override the file name?

There are two options.
Right click on the Mule Project and go to
Run As --> Run COnfigurations
Then Select Java Application. Then right click and select New
Add your config file name as shown in the picture and run it.
Create a mule-deploy.properties and keep it in the src/main/app folder.
Add the configuration resource entry to it. This will be helpful when you package and deploy mule application onto a mule standalone server.
config.resources=my-mule-config.xml
Refer to the following link for more detials on Mule in Eclipse.
Creating a Mule project in Eclipse
Hope this helps.

you can rename the file by right clicking on it and select refactor or select the file and click F2 to rename it and then run the application as Mule run configurations.

Related

One properties configuration file for Multi Apps on Mule ESB runtime

Today I have the same properties configurated on mule-app.properties file for each Apps. Like this:
All Apps (+ that 5) are running on the same Mule ESB runtime (CE).
For example, when It is necessary to change a host or password, I need to change the properties file of the all apps.
I would like to have just one properties file on Mule ESB runtime shared by all apps.
Is there a form to make this?
Thanks!
You can create a new Mule project and call it "shared". Now, in this project, you can create a file src/main/resources/config.properties and there put all the settings you need.
To have these settings in your current project, just add the project "shared" in the "Projects" tab of the "Java Build Path". Then in the main file of your current project, write
< context: property-placeholder location="config.properties" />
Use a Spring Property Placeholder and read a single file from the filesystem:
<context:property-placeholder location="file:/path/to/myConfigFile.properties" />
https://docs.mulesoft.com/mule-user-guide/v/3.6/configuring-properties#properties-files

Change logging in the Mule

I have a Mule project that I want to run from AnypointStudio. It uses the default log4j2.xml, but I want to change that.
According to the documentation (http://www.mulesoft.org/documentation/display/current/Logging+in+Mule), it is posible to put another log4j2.xml file on the classpath, but that does not work.
In the "run configuration" of Anypoint I added a classpath. In that classpath folder I added another log4j2.xml file, but that is ignored by the Mule, although it sees another file in that folder.
How do I add an log4j2.xml file?
Put your log4j2.xml config in src/test/resources, that way it won't be packaged in the app but will be available in Studio, when you launch the app.

Add class to build path using Mule Studio

I'm using Anypoint Studio with Mule Server 3.5.0 CE.
I have a custom transformer named CustomAsyncTransformer which is defined in the class AsyncTransformer.
Within one of my Mule flows:
<custom-transformer name="CustomAsyncTransformer" class="ca.mpac.esb.component.webservice.AsyncTransformer">
</custom-transformer>
This causes the following message to be displayed:
Unable to find type 'ca.mpac.esb.component.webservice.AsyncTransformer' on build path of project TEST-PROJECT
However, AsyncTransformer.class has been added to the build path; it is located in src/main/app which is designated as a source folder. I've also tried adding it directly to the build path, creating a new source folder, and adding it to other source folders. Still no change.
What am I doing wrong? How can I add this class to the build path?
Java source code should be in src/main/java. So your approach to add add a new source folder is correct, just use src/main/java so your Maven build will pick it up too.
Studio should pick the class from it. If it's not the case, it's maybe a bug? Or maybe something else: to find out show a screenshot of your application directory layout.

Mule Deployment properties file

I have seen some strange behaviour in Mule Application. I created a sample mule project(created flows) and opened mule-deploy.properties file "config.resources" value is empty.
But the same above mentioned key value is getting updated with "configuration xml file name" when i run my mule project.
Is this the behaviour or any updates need to be done.
Can some clarify?
Regards
Vikram
There are some known issues/features around mule-deploy.properties and Mule Studio.
Currently it is expected that when running your project from Mule Studio that mule-deploy.properties-config.resources is automatically populated with all your configuration files.
There are some open issues on this here: https://www.mulesoft.org/jira/browse/STUDIO-3297 that you can vote on.
Once you run the mule application it will automatically updated with the configuration file by default if you have only one main configuration file.But If you are using more configuration files in your application you should manually add all the filenames to the config.properties key separated by comma before run the application.

making jar file of a test project in selenium web driver

I have created a test suite (making a main file and calling other test cases that I like to run) .Now is it possible to make a jar file of test suite that i have made so that just by clicking on the jar i can forcefully start the test .Also is it possible to create c config value outside jar.I am using java programming language.
Help plz.
If you are using eclipse as an ide you can create a jar file very easily.
Right click on project.
Go To Export.
Select Jar or Runnable Jar as per your use click on next.
Specify the main file name.
Click on Finish.
Before doing above steps. i mean
Right click on project.
Go To Export.
.
.
.
.....on Finish
Clean the project to avoid “duplicate entry” error when exporting Java project to JAR with Eclipse.
Enable Auto Refresh in Preferences - General - Workspace - Refresh Automatically (called Refresh using native hooks or polling in newer builds)
Or Just right click on the project and click Refresh.
to avoid “resource is out of sync with the filesystem” error.
Right click on project.
Go To Export.
Select Jar or Runnable Jar as per your use click on next.
Specify the main file name.
Click on Finish.