How to specify default glassfish-web.xml? - glassfish

I have a situation where I need to specify some properties in glassfish-web.xml (like
session-properties & cookie-properties) that needs to be applied to all web application that are deployed under that domain.
One option is to create glassfish-web.xml per web-application. This is fine if there are only a few web applications on a domain.
However as these properties are common across all web applications I am wondering if there is a way to specify these configuration at glassfish server domain level (like default-web.xml) that are applied to every web application deployed.

If you are using Glassfish 3+, put the configurations desired in [GF_HOME]/domains/[yourdomain]/config/default-web.xml
Take a look at: https://docs.oracle.com/cd/E19798-01/821-1752/beagc/index.html

Related

How do I use run-modes with context-aware configurations in AEM

We have a multi-tenancy website. We are trying to use social share components where the url needs to be shared. Since we have a dispatcher configured, we are picking up the domain from a context aware configuration. How do we use different domains for environments based on run-modes
I have tried to use different ca-config folder for each environment but this is not ideal.
Sling context aware configurations don't work on run modes. For your current requirement you should be using Externalizer service which works basis sling maps, request origin and OSGI configs based on what method you choose.
https://helpx.adobe.com/in/experience-manager/6-3/sites/developing/using/externalizer.html
https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/javadoc/com/day/cq/commons/Externalizer.html
You can use Day CQ Link Externalizer which is available in the OSGI configurations, http://localhost:4502/system/console/configMgr.
It is an OSGI service that allows you to programmatic-ally transform a resource path into an external and absolute URL. You can configure this configuration for different run modes
You can also use a 2-step approach. 1st you create a Run-Mode dependent OSGi config. 2nd you use the built-in Override via OSGi configuration.
See here: https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html#override-via-osgi-configuration

Handle multiple connector in one mule application using mule domain project

I have an application which consist of two http connector with different host and port. How to handle it with shared resource i.e. mule domain project.
Have a look at https://docs.mulesoft.com/mule-user-guide/v/3.8/shared-resources.
The general idea is simple:
1. Create a domain project (in AnypointStudio: New -> Mule Domain project)
2. Move your connector configuration from the project to the domain project (use cut/paste in XML, not the graphical editor)
3. Reference the domain project from your Mule project (property domain in mule-deploy.properties
And don't forget for deployment: The domain must be deployed before you deploy your project.
#Kishan Kumar Soni, The referenced documentation explains on how use the Shared Resources with mule and is not meant for single connector only. You can move your two http:listener-config into shared resources config(domain-config) file, make sure to have unique name, then reference them in your application(s) as desired. It will work.

IBM MobileFirst - Properties files

I have a MobileFirst APP, calling three web services, when I call these Web services, using an IP (localhost), but when I connect my mobile PC have to use another IP calls, and then have to use other production.
To make it easy and comfortable setup, as I can do in MobileFirst, it is the worklight.properties file?
Greetings and thank you,
That's some crazy English going on there...
If your question is really "can I save the web service IP address (that I am using in my adapter XML file) in a variable in worklight.properties, so that different IPs will be used for my adapters in different environments (DEV, QA, PROD)" - yes.
I believe that in this case JNDI properties will not help, but you could do the following.
You will need to create a different copy of worklight.properties per the environment you want to test at, and in each file add custom properties, for example:
myWebServiceIP=192.168.123.1 (you'll need to change this value per file)
Then in the adapter XML file, use it like this:
<domain>${myWebServiceIP}</domain>

Changing the localhost to a custom url in Jboss

I am trying to create a login module that could use facebook login too . I am using Jboss 7.1 as my server and i run it from inside eclipse and my OS is Ubuntu.
The problem now is that Facebook doesn't seem to accept requests when the url is of type say
http://localhost:8080/myApp/
and expects something of the form http://localhost.test/myApp.
(Testing facebook connect on localhost)
My problem is that I am not aware of how to change the above pattern (from localhost:8080 to say localhost.mysite) in JBOSS server.
Can someone let me know on how this has to be done.
Thanks
You can use the -b parameter to specify the bind address JBoss should use, see:
https://docs.jboss.org/author/display/AS71/Admin+Guide?_sscc=t
This switch should be available in the Eclipse JBoss Tools as well.
I discovered just recently that JBoss 7.x (as well as JBoss EAP 6) does not accept connections from outside if you don't specify the Host/IP-Address via the aforementioned parameter; even responses to web service requests it sends itself are not received.
If you want to change things like the web service endpoint host, port etc. you can do this via standalone.xml. For Web Services or ReST you simply specify subsections whose schema is defined by the XSDs located in the docs/schema folder (jboss-as-webservices_1_1, jboss-as-jaxrs_1_0 respectively ). For convenience (auto-completion, validation) you can put them into an XML catalog and registered the catalog within Eclipse.

Web Service Reference to reportservice20xx.asmx on a distributed application

I have an .Net webapplication which connects to a reporting web service.
In my development studio, I just add an webreference, then specify the path where the reporting server is installed and reportservice2010.asmx is found and ready for use.
But i do not know how to deal with it, after my application is compiled.
When I would like to distribute it on lets say 100 different servers.
The path to reportservice2010.asmx may(and surely will) change.
Of course what will make my application corrupt.
Please help !
When you added the web reference, Visual Studio should also have added a new section to the application's configuration file. That section specifies the environment-specific details of the web reference.
If, for any given target environment, the target address of the web reference changes then you can simply change the URL in the application's configuration file.