-
1. Re: Find deploy date from web application
panuv Sep 28, 2005 12:31 PM (in response to mr.shiny)One approach is to have a JSP-page that reads and displays the build-number (incl. possibly a timestamp) from a text-file, which is created by the build/deploy-script.
-panuv -
2. Re: Find deploy date from web application
mr.shiny Sep 28, 2005 1:13 PM (in response to mr.shiny)"panuv" wrote:
One approach is to have a JSP-page that reads and displays the build-number (incl. possibly a timestamp) from a text-file, which is created by the build/deploy-script.
-panuv
Yes, my application does this already, but sometimes we need to roll-back a build, or a deployment may be delayed, etc. so the build date is not the same as the deploy date. Currently we write the build number and date into the web.xml but once the ear is made the build process is done and deployment is done at a later time (and the same ear will be deployed to multiple servers, i.e. the test servers and multiple production servers). What I need is the date/time that that ear was put into the server's deploy directory. -
3. Re: Find deploy date from web application
panuv Sep 28, 2005 2:03 PM (in response to mr.shiny)Note that if you restart JBOSS, it would need to redeploy the ear, and I guess it would need keep track of if the exact same ear eas already previously deployed. You might need to compile JBOSS from source & modify the source to record all deployments with time-stamps.
More simply consider doing all your deploying (not just 'building') with a script that writes all deployments in a file, or a database.
-panuv -
4. Re: Find deploy date from web application
mr.shiny Sep 28, 2005 2:30 PM (in response to mr.shiny)"panuv" wrote:
Note that if you restart JBOSS, it would need to redeploy the ear, and I guess it would need keep track of if the exact same ear eas already previously deployed. You might need to compile JBOSS from source & modify the source to record all deployments with time-stamps.
Well, yes, technically JBoss deploys everything when it starts. Which is why I was planning on using the timestamp of the ear itself as the deployment date; that timestamp is updated when the file is written, or, if the ear is expanded in the deploy/ directory, when the files in that directory are written. So if there is some API in JBoss that i can call from a web-app to ask JBoss "what is the URL of the ear that I am deployed in" then I can just open the file and get the timestamp. My app doesn't need to work on any other app-server at this time so an app-server specific feature is just fine."panuv" wrote:
More simply consider doing all your deploying (not just 'building') with a script that writes all deployments in a file, or a database.
Yeah, I thought of that but I don't control the deployment script so I'd like to leave that solution as a last resort.
Thanks,
mr.shiny -
5. Re: Find deploy date from web application
raja05 Oct 1, 2005 2:35 PM (in response to mr.shiny)You can possibly use JMX. I dont have a running site right now, but it looks like MainDeployer(with a JMX name of jboss.system:service=MainDeployer) has a method called getDeployment(URL deployURL) and returns a DeploymentInfo object. DeploymentInfo has information about when the deployment was done last in addition to a lot of other properties. Look up the source or the API for more on DeploymentInfo
-
6. Re: Find deploy date from web application
mr.shiny Oct 3, 2005 8:22 AM (in response to mr.shiny)"raja05" wrote:
You can possibly use JMX. I dont have a running site right now, but it looks like MainDeployer(with a JMX name of jboss.system:service=MainDeployer) has a method called getDeployment(URL deployURL) and returns a DeploymentInfo object. DeploymentInfo has information about when the deployment was done last in addition to a lot of other properties. Look up the source or the API for more on DeploymentInfo
But then I'd still need to know the URL of the app that my code is deployed in; also wouldn't JBoss just report the last time it deployed the app, which is different from when I put the app into the deploy directory? The thing is, we restart our application servers more often than we deploy applicaitons, and I need to know when the application was physically deployed as opposed to when JBoss loaded the code into the JVM. But thanks for the suggestion anyway, I'll keep the JMX stuff in mind if there is anything else I need to look up.
-mr.shiny