This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 831482 - Define system properties service MBean in JBoss
Define system properties service MBean in JBoss
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Maintainability (Show other bugs)
1.6
Unspecified Unspecified
unspecified Severity medium
: ---
: 1.6.1
Assigned To: Patrick Huang
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 02:07 EDT by Patrick Huang
Modified: 2012-07-03 01:27 EDT (History)
2 users (show)

See Also:
Fixed In Version: 1.6.1-SNAPSHOT (20120628-0014)
Doc Type: Bug Fix
Doc Text:
Cause properties-services.xml don't play nice in jboss 5.1. If this gets loaded after zanata.war we won't have the necessary system properties available. Consequence At the moment we have to define properties in pom.xml and set it at build time which makes deployment to different environment not flexible. Result jboss service will always be loaded before zanata war so the properties are guaranteed to be available.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-03 01:27:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Patrick Huang 2012-06-13 02:07:53 EDT
Description of problem:
We need to have a unified way of defining system properties for Zanata.


How reproducible:
n/a

Steps to Reproduce:
n/a
  
Actual results:
Hibernate search and Java melody writes files to a location defined at build time which is not flexible when deploy to different environment.

Expected results:
Add properties-service MBean into conf/jboss-service.xml so that we can define system properties for various things on different environment. This requires no re-build.

Additional info:
To define property for hibernate search index base:
- remove hibernate.search.default.indexBase property in zanata-war/src/main/webapp-jboss/WEB-INF/classes/META-INF/persistence.xml
- add following xml snippet into $JBOSS_HOME/server/default/conf/jboss-service.xml
  <mbean code="org.jboss.varia.property.SystemPropertiesService"
      name="jboss:type=Service,name=MySystemProperties">
     <attribute name="Properties">
        javamelody.storage-directory=/var/lib/zanata/stats
        hibernate.search.default.indexBase=/var/lib/zanata/index
     </attribute>
   </mbean>
- make sure jboss user has write permission to above defined directories

Clean up no longer needed code/stuff:
- remove property env.hibernate.indexBase in zanata-war/pom.xml
- remove properties-services.xml under $JBOSS_HOME/server/default/deploy
- remove zanata-war/src/etc/properties-service-sample.xml
Comment 1 Patrick Huang 2012-06-13 02:09:17 EDT
replace properties-service-sample.xml with
jboss-service-snippet.xml under zanata-war/src/etc will be good.
Comment 2 Patrick Huang 2012-06-13 02:15:08 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
properties-services.xml don't play nice in jboss 5.1. If this gets loaded after zanata.war we won't have the necessary system properties available.

Consequence
At the moment we have to define properties in pom.xml and set it at build time which makes deployment to different environment not flexible.

Result
jboss service will always be loaded before zanata war so the properties are guaranteed to be available.
Comment 3 Patrick Huang 2012-06-13 22:21:12 EDT
committed into master:
https://github.com/zanata/zanata/commit/c6d34feaf13daa3afc53f6cd9ac5df14d73a891b
Comment 4 Sean Flanigan 2012-06-27 01:50:39 EDT
I think this affect the documentation too - part of the installation process now requires that you put the Hibernate Search and JavaMelody system properties into your JBoss instance.
Comment 5 Ding-Yi Chen 2012-06-28 04:01:04 EDT
VERIFIED with Zanata version 1.6.1-SNAPSHOT (20120628-0014)
Zanata version 1.7-SNAPSHOT (20120626-0025)

Note You need to log in before you can comment on or make changes to this bug.