external configuration on classpath per application in jboss - java

i'm completely noob with jboss administration. i want to have a few applications (wars) on jboss. each of them should have external configuration - file or better directory, available on classpath. and of course one application must not see configuration of other application. they must have completely different classpath. is it possible to do that? how?

You can configure your server profile to pick up applications from several external folders( https://community.jboss.org/wiki/HowToDeployMyApplicationInAnExternalDirectoryInJBoss-5?_sscc=t ) and then just set permission for each of that folder

Related

In Spring web app deployed to tomcat server, catalina.properties file is automatically loaded and detected by spring. HOW?

When developing a spring based web app (and deploying to tomcat), we can put our configuration in several places. One of them is catalina.properties. I would like to know how catalina.properties file is made available to spring app. Is it tomcat who does this or spring who loads catalina.properties file? How spring knows from where to load configurations.
Tomcat automatically makes any properties configured in catalina.properties available as system properties. Spring's Environment uses a number of different sources for the properties that it contains. One of those sources is the JVM's system properties. As a result, the properties specified in catalina.properties are available via Spring's Environment.

Use weblogic admin console to manage custom configuration files?

Is there any way I create or upload a configuration file to weblogic server. The configuration file will be used by a java application deployed on the weblogic server. But I can use weblogic server admin console to update this configuration file and don't have to have someone go to the server and find this file and update it in an text editor.
Is this possible? If so, how can I do this.
You want Deployment Plans for your app. They allow you to customise an EAR or WAR's internal settings.
Bear in mind that early versions of WLS 11g had a bug where specifying a deployment plan at the same time as uploading an app didn't work through the console, and you had to upload, then apply the deployment plan in a separate step (or use WLST or a maven plugin to do it)

How to reconfigure log4j of a war file from another war file deployed in same tomcat

I have two war files WARA and WARB deployed in a tomcat, both use same log4j properties file. How to reset the log4j configurations in both war files through another stand alone application deployed in same tomcat without disturbing WARA and WARB? Is it possible to do?
If polling is an option you can use PropertyConfigurator.configureAndWatch().
More here.
If you need to do it manually the process is bit longer. On a high level its as follows.
Configure JMX for your application server / servlet container.
Write an MBean to trigger full reconfiguration.
Register the MBean in WARA and WARB.
Connect to the MBean server from the other webapp.
Invoke the MBean in WARA and WARB.
If you can provide more details on what software stack your are using I may be able to provide specific details on how to do the above.
not the best way , but make a jar file that contains properties file ,and place it tomcat lib folder ,all applications use same propertyfiles.

Put authentication/login configuration inside PROJECT

I implemented a custom login module I want to use with the JBoss AS 6. I followed some tutorial guidelines on the internet, namely http://x-techteam.blogspot.com/2007/04/jboss-custom-login-module-simple.html.
They write about configuring ${JBOSS_HOME}/server/default/conf/login-config.xml and deploy a JAR with the custom login module, but I don't like the idea of changing a configuration within the JBoss folder.
I really would like to have ALL configurations within my WAR file. The EE application I write will be sent to some customers and they should not have to worry about configuring some security contexts or roles via XML.
So my question is:
Can I have a local login-config.xml within my war that will be picked up by JBoss?
Can the custom login module class remain within my war, without having to deploy it to some JBoss folder?
Thank you in advance.
Use dynamic security domains:
link

How do I push an update to a war file to clients?

Assuming my clients are running my J2EE WAR application on their intranet, and I have an update for them... how do I push the updated war file to them?
I'd like it to be automatic and require no human interaction on the client's side.
Can this be done?
Any help would be appreciated.
Tomcat (if this is your target container...) offers a manager interface that will allow you to deploy/start/stop applications.
I have used both ant and maven tasks to great effect in deploying wars remotely all while being built-in to the build process.
Depending on your deployment process, this may not work for you, but for dev & qa: highly recommended.
Edit: of course apache has to be configured for this type of access to be allowed.
See: Deployer how-to
Glassfish has documentation on deployment here.
Ant tasks are also available here.
Glassfish uses Tomcat internally, but the Tomcat Manager is not available as it is a separate application.
If the glassfish admin console can be accessed, it can be used to upload and deploy war files.
I'm not sure if you're comfortable giving them access to your source code repository...even in read-only mode.
If you are, then you could script up something in ANT to check out the latest version of the source code (using CVS task) and then build the .war file (using WAR task).
The only trick would be automatically deploying it once the war has been built. Tomcat will automatically deploy applications copied into a certain directory. For Websphere, see this question and this question.
For other J2EE servers I don't know how it would be done.

Categories

Resources