Deploying Mule Domain Project in Standalone Mule Server - deployment

I have two mule projects each referencing a domain project.
The domain project contains the common HTTP Listener Configuration.
I am trying to deploy the application using the Mule Standalone Server. When I am putting the zip file in the “app” folder under MULE_HOME, I find that the applications are deployed but I cannot retrieve the response using SOAP UI.
It is giving “No listener at the endpoint” as response.
But if I put the zip files in the “domain” ” folder under MULE_HOME, I find that everything is working fine.
Can anyone help me with how this Mule Standalone Server internally works for both types of applications-one whose domain is “default” and another which has a particular domain associated with it?
Also, while deploying the application with the particular domain, I found that the zip file name should be the same as the domain project- test_domain_project(here). Otherwise it gives error. Why is it so?
I am using Mule Enterprise Standalone Server version 3.8.

You can deploy domains in two ways:
Deploying your domain in MULE_HOME/domains folder first, then deploying your app(s) in the MULE_HOME/apps folder. In this case you need to deploy your domain first, then your app(s) (or copy both domains and apps in their corresponding folders when Mule is stopped, on startup Mule will ensure domain is deployed first)
Deploying your domain as a bundle in MULE_HOME/domains. Your apps needs to be "bundled" in your domain, meaning the apps zip packages needs to be included in your domains zip package. Your my-domain.zip file will then contain something like:
|- mule-domain-config.xml
|- apps/
| |- my-app.zip
| |- another-app.zip
|- lib/
I resume what is documented in the Mule Shared Resources doc.
When I am putting the zip file in the “app” folder under MULE_HOME, I
find that the applications are deployed but I cannot retrieve the
response using SOAP UI.
Are you deploying all the zip files (including the domain zip file) under MULE_HOME/apps/ folder? This won't work: you must put your domain zip file under the domains/ folder, and the apps zip file under apps/ folder
But if I put the zip files in the “domain” ” folder under MULE_HOME, I
find that everything is working fine.
You probably are deploying your apps+domain as a bundle (second way I described), so it's working all right ;)
Also, while deploying the application with the particular domain, I
found that the zip file name should be the same as the domain project-
test_domain_project(here). Otherwise it gives error. Why is it so?
I suspect (though it is not documented) that Mule will use the app or domain zip filename as the app/domain name itself, ignoring the name configured in the .xml files. For example, if you create a domain named 'my-banana-domain' but rename the zip file 'my-pear-domain.zip' and deploy it, Mule will create a domain folder 'my-pear-domain' and register a domain named 'my-pear-domain'. However your apps will still have an association with 'my-banana-domain' but Mule will only have a domain named 'my-pear-domain'.
TL;DR Mule uses the domain zip filename as the domain name for associating applications, thus your error.

Related

Packaging SF service into a single file

I am working through how to automate the build and deploy of my Service Fabric app. Currently I'm working on the package step and while it is creating files within the pkg subfolder it is always creating a folder hierarchy of files, not a true package in a single file. I would swear I've seem a .SFPKG file (or something similarly named) that has everything in one file (a zip maybe?). Is there some way to to create such a file with msbuild?
Here's the command line I'm using currently:
msbuild myservice.sfproj "/p:Configuration=Dev;Platform=AnyCPU" /t:Package /consoleloggerparameters:verbosity=minimal /maxcpucount
I'm concerned about not having a single file because it seems inefficient in sending a new package up to my clusters, and it's harder for me to manage a bunch of files on a build automation server.
I believe you read about the .sfpkg at
https://azure.microsoft.com/documentation/articles/service-fabric-get-started-with-a-local-cluster
Note that internally we do not yet support provisioning a .sfpkg file. This is a feature that will be coming in soon (date TBD). Instead, we upload each file in the application package.
Update (SF 6.1 - April 2018)
Since 6.1 it is possible to create a ZIP file (*.sfpkg) and upload it to an external store. Service Fabric executes a GET operation to download the sfpkg application package. For more infos see https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-package-apps#create-an-sfpkg
NOTE: This only works with external provisioning, the Azure image store still doesn't support sfpkg files.

IBM Liberty issue

An architect is having issues bringing Liberty up. Currently, an individual is running a server on his local computer and they want to move it to a shared server. When he tries to deploy a simple “helloworld” it’s failing and he is receiving an error “Context Root Not Found”. He is not sure what to set in server.xml file to have wlp recognize the application. They have ODM 8.5 on the mainframe. He thinks it might help if he saw an example of an EAR or WAR file deployed. Any ideas or suggestions?
Either put your application in the dropins folder, it will be detected and started automatically, or put it in the apps folder and configure in server.xml like this:
<webApplication id="HelloApp" location="HelloApp.war" name="HelloApp"/>
by default context root is application file name without extension, but you can change it by adding contextRoot="mycontext" attribute.

Restricting access to particular URL for sesame server deployed on JBoss (WildFly 8.2)

I have a sesame server running deployed in a WildFly 8.2.0 final container.
How can I restrict access to some particular URLs?
I know I have to edit some XML files (deployment descriptor and some other files) but I don't know which files and where to find them.
I figured it out my self.
Step 1:
Open the openrdf-sesame.war with Total Commander or any file archiver. Go the WEB-INF folder and open the web.xml file.
Edit the web.xml file by adding constraints, roles and the login-config tag as in this example : http://www.rivuli-development.com/further-reading/sesame-cookbook/basic-security-with-http-authentication/
Save the edited file within the archive and redeploy the openrdf-sesame.war file containing the modified web.xml file.
Step 2:
Go to the WildFly folder and enter the bin directory and run the add-user.bat file.
Choose b) Application User and hit Enter.
Enter a username and a password for the new user.
When you are asked "What groups do you want this user to belong to?", type in one of the roles you have created in the web.xml file and hit Enter.
When asked “is this new user going to be used for one AS process to connect to another AS process?” type “yes” and hit Enter.
And that's all.
You now have youre particular URL's restricted.

Generate code from deployed files

I had mistakely deleted my web services code. I don't have any backup of this code. Tried some file recovery tools but it didn't work. I have deployed the project in glass fish 4.0 server and the application works fine from there. So I am thinking is there any way I can generate the codes of that webservice?
Thank you
If you have the application deployed in your glassfish server then it is possible. You can always find your the .class files of original codes (not the one compiled by SEI) inside your domain folder of glassfish. Then you can use some third party tools to generate java codes from the class files. There are to ways that you can deploy your application in the glass fish server:-
By using the glass fish server web GUI and deploy it.
By using exernal IDE like eclipse where you create the glassfish server and deploy it.
For condition 1, goto :-
glassfish\domains\domain1\applications\__internal
where domain1 is your domain name. By default it is the name of your domain
For condition2, goto:-
glassfish4\glassfish\domains\domain1\eclipseApps
where domain1 is your domain name. By default it is the name of your domain
You can find your java codes inside WEB-INF\classes inside your project name.
Hope this helps.

Custom Language Resource file not getting deployed to server

We have an MVC 4 application that has 4 resource files. The default one (Resource.resx), one for Chinese and German (Resource.zn-CH.resx and Resource.de-DE.resx) and then one for a custom language (Resource.en-PI.resx (English-Pirate)) for testing purposes.
Every setting for all of the resource files is exactly the same:
Build Action: Embedded Resource
Copy to Output Directory: Copy Always
Custom Tool: PublicResXFileCodeGenerator
Custom Tool Namespace: Resources
Whenever the application is built locally, in the bin folder we get the folders de-DE, en-PI and zh-CN which all include a dll named (ProjectName).resources.dll.
The problem is whenever this application is deployed to our DEV server the folder for en-PI is ignored and not copied and we have to manually copy that folder over for the en-PI language to work.
We have a build definition that will build the necessary projects to a certain folder and do other things and then copy them over to our DEV server. Everything works perfectly fine for the other 2 languages (de-DE and zh-CN) but the en-PI folder doesn't show up in the bin folder. Is there some setting somewhere that is causing this resource file not to be deployed because it is a custom language?
The way all of these resource files were added followed this example http://odetocode.com/Blogs/scott/archive/2009/07/16/resource-files-and-asp-net-mvc-projects.aspx
Figured it out. Microsoft explains it here under the section Resource Naming Conventions. Because the language is a custom language and has a custom code it doesn't have a name that the common language runtime expects which is why it doesn't get deployed correctly.