Read logging.properties of JUL automatically - java.util.logging

Is it possible to make my webapp to recognize the logging.properties with no modifications in my side?

Under Tomcat, you can setup a WatchedResource to point to your logging.properties and it will reload the web application if it is updated. You'll have to do testing to make sure the reloads don't trigger any classloader memory leaks.
You can use JMX to modify logger levels while the application is running. Or you have to resort to writing custom code using the WatchService to monitor the logging.properties file and call LogManager.readConfiguration.

Related

ColdFusion 11 console doesn't use Windows service wrapper to start app server

I have a ColdFusion11 environment with two app servers defined. The default cfusion server was created with a Windows system service wrapper to go along with it; the second app server, for some reason, was not.
The SC tool was later used to create a Windows service wrapper for the second app server; however, when the 2nd app server is controlled within the cfusion Enterprise Manager instance, it does not use the Windows Service wrapper to control it. Is there a configuration file I can amend that will instruct CF to invoke the Windows service wrapper to control this second service? This is particularly important as this 2nd server instance has a logon identity that must be used at startup, but if the server is restarted within the CF console, the identity is obviously not used.
In effect, I need to tell the cfusion enterprise manager to use the Windows service wrapper to control the 2nd app server instance, not to just control it directly. I'm assuming there is a configuration setting buried deep within the bowels of CF that would allow me to specify this.
I've tried searching the XML configuration files, looking for a non-obvious setting within them that might point to a startup configuration parameter, but so far have found nothing. Something must control how a secondary app server is managed, so I thought I'd ask here for some insight.
For the sake of anyone else who might encounter this situation, I've discovered the answer. It has nothing to do with changing the configuration of the application server itself.
When the ColdFusion11 administrator console is told to start an instance of another application server within the Enterprise Manager, it first queries the Windows Service Control database for a defined service of the exact name "ColdFusion 11 Application Server [AppServerName]" (without the brackets). If it finds such a service, CF automatically invokes the service wrapper and starts it. Absent that, a direct invocation of the CF instance commences.
The solution to the issue for an app server created without a Windows service wrapper is, when the 'sc' utility is invoked to create the service, to provide a service name that exactly matches the format above.

Jetty - Un-deploy specific application

I have a single instance of Jetty that runs 5 web-applications.
I want to un-deploy one of this application, my first thought was to delete the context from: $JETTY_HOME/contexts, it works but it's not clearing the whole application (I saw that some scheduled tasks are still running).
So, I need another way to un-deploy the application, or some kind of a clean-up after removing the context.
Thanks in advance.
Deleting the war file or associated context XML file is generally enough to clear the context. You can also run .stop() from JMX if you have that module enabled in your Jetty instance.
In regards to Quartz, Jetty itself does not interact with scheduled jobs. This can be handled by the webapp itself signaling Quartz that it is exiting. Alternatively you can implement a ServletContextListener to instantiate the Quartz jobs which will handle the removal of contexts gracefully.
Related: Can you undeploy applications from JETTY?

How to use infinispan as a remote session repository for Cipango Servlet engine?

I need to use infinispan in a remote node for keeping session states. how can I use it with Cipango? I know that jetty can use it, but what about Cipango? do
I need additional configuration in Cipango?
I have seen some classes in Cipango source code with the name of Cipango-replication, what should I do with them? I'm not seeing this module in pom.xml of Cipango source code? how to add this module if it's necessary.
I also know that I would use a HotRod client in my servlet engine to read/write session states from/to Infinispan, but I have no Idea where to start it with Cipango?

Programmatically query deployed Jetty 8 applications

Is there a way I can query the list of deployed applications in a Jetty 8 server in code? For instance, can I inject the DeploymentManager and query it?
From a handler, you should have a reference to the Server object so you should be able to dig around for it from there, or just pass in reference to it when you create it and are knitting things together. Handlers are simple to write and wire up. Look at the StatisticsHandler usage as an example if you like.
From a servlet that is not really appropriate since there is a webapp classloader and webapps are classloader isolated for a reason.

Target IIS Worker Processes on Request

Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on the Client, from the Admin, to flush our cache of the options for that specific account.
Recently we started giving our Client application >1 Worker Processes, thus causing the cache of options to only be cleared on 1 of the currently running Worker Processes.
So, I obviously have other avenues of fixing this problem (however input is appreciated), but my question is: is there any way to target/iterate through each Worker Processes via a web request?
I'm making some assumptions here for this answer....
I'm assuming the client app is using one of the .NET caching classes to store your application's options?
When you say 'flush' do you mean flush them back to a configuration file or db table?
Because the cache objects and data won't be shared between processes you need a mechanism to signal to the code running on the other worker process that it needs to re-read it's options into its cache or force the process to restart (which is not exactly convenient and most likely undesirable).
If you don't have access to the client source to modify to either watch the options config file or DB table (say using a SqlCacheDependency) I think you're kinda stuck with this behaviour.
I have full access to admin and client, by cache, I mean .net's Cache object. By flush I mean removing the item from the Cache object.
I'm aware that both worker processes don't share the cache data. That's sort of my conundrum)
The system is the way it is to remove the need to hit sql every new-session that comes in. So I'm trying to find a solution that can just tell each worker process that the cache needs to be cleared w/o getting sql involved.