-
1. Re: Maintaining properties between deployments of WAR file
jaikiran Aug 17, 2009 12:06 AM (in response to tmcdeploy)You can place them in JBOSS_HOME/server/< servername>/conf folder. That folder is by default available in the classpath.
-
2. Re: Maintaining properties between deployments of WAR file
tmcdeploy Aug 17, 2009 1:13 AM (in response to tmcdeploy)If I put the properties into the conf folder do I then have to register them in the servers-properties.xml file? This is the part my sys admin doesn't like. He reckons that I should somehow be able to include the properties in the deploy folder along with my WAR file and somehow reference the properties from my web app - thus allowing multiple delpoys of the WAR file without the properties being overwritten.
Thanks. -
3. Re: Maintaining properties between deployments of WAR file
jaikiran Aug 17, 2009 1:16 AM (in response to tmcdeploy)If I put the properties into the conf folder do I then have to register them in the servers-properties.xml file?
No, you don't have to do anything other than just placing them in the conf folder. -
4. Re: Maintaining properties between deployments of WAR file
tmcdeploy Aug 17, 2009 1:30 AM (in response to tmcdeploy)thanks for your reply ... How do I retrieve the properties from within my webapp? Do I access them like any other system variable? ie are the properties automatically loaded in the JVM like if I included the properties in the services-properties.xml file. Further can I use a webapp.properties file that has name=value pairs or do I need to use a speical xml file? Sorry for all the questions.
-
6. Re: Maintaining properties between deployments of WAR file
tmcdeploy Aug 17, 2009 9:14 PM (in response to tmcdeploy)is it possible to have this properties file in the deploy directory rather than the conf directory?
-
7. Re: Maintaining properties between deployments of WAR file
jaikiran Aug 18, 2009 12:00 AM (in response to tmcdeploy)You can't place it in the deploy folder. If you want it to be in deploy folder, you will have to package it with your application. Why do you want it there?
-
8. Re: Maintaining properties between deployments of WAR file
tmcdeploy Aug 18, 2009 12:03 AM (in response to tmcdeploy)My sys admin is insistent that it should go there ... however when I do so I get the following error:
2009-08-18 13:57:52,096 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
--- Packages waiting for a deployer ---
org.jboss.deployment.DeploymentInfo@2da85bef { url=file:/D:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/default/deploy/applicationProperties.xml }
deployer: null
status: null
state: INIT_WAITING_DEPLOYER
watch: file:/D:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/default/deploy/applicationProperties.xml
altDD: null
lastDeployed: 1250567872096
lastModified: 1250567872096
mbeans:
Can you point me to any official documentation that says I can't put it there? Thanks. -
9. Re: Maintaining properties between deployments of WAR file
jaikiran Aug 18, 2009 12:18 AM (in response to tmcdeploy)"tmcdeploy" wrote:
My sys admin is insistent that it should go there ... however when I do so I get the following error:
That's because the deploy directory does not allow any files which it doesn't recognize. What is the reason they give you for not allowing the files in the conf folder (which is the right place) but forcing you to use the deploy folder?"tmcdeploy" wrote:
Can you point me to any official documentation that says I can't put it there?
The documentation is here https://www.jboss.org/community/wiki/jbossapplicationserverofficialdocumentationpage but i don't think it will have a section for which files are not allowed in the deploy folder.
If your admins are adamant on using the deploy folder, then you can use the properties-service.xml (which is already available in the deploy folder) to add your properties as System properties. See this guide http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch10.html#ch10.props.sect:<attribute name="Properties"> xyz=some value </attribute>
In your code, you can then access it as:System.getProperty("xyz");