Hi all,

To add governance related configurations we have added a governance.xml
[1]. This governance.xml is bundled in our
org.wso2.carbon.registry.extensions.server.feature [2]. If any product uses
org.wso2.carbon.governance.common bundle
(org.wso2.carbon.governance.common.GovernanceConfigurationService) they
need to pack the governance.xml to their distributions as follows in their
distributions bin.xml. We have done in our product-greg distributions
bin.xml [3] in our product.

        <file>

<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/governance.xml</source>

<outputDirectory>${pom.artifactId}-${build.version}/repository/conf</outputDirectory>
            <filtered>true</filtered>
            <fileMode>644</fileMode>
        </file>

If this is not bundled to the pack you will encounter an error similar to

[2015-08-13 08:39:15,981] ERROR
{org.wso2.carbon.governance.common.internal.GovernanceConfigurationServiceActivator}
-  Cannot start Governance common bundle
org.wso2.carbon.governance.common.GovernanceConfigurationException: Cannot
read file wso2greg-5.0.0-SNAPSHOT/repository/conf/governance.xml
    at
org.wso2.carbon.governance.common.utils.GovernanceUtils.getGovernanceConfiguration(GovernanceUtils.java:74)
    at
org.wso2.carbon.governance.common.internal.GovernanceConfigurationServiceActivator.start(GovernanceConfigurationServiceActivator.java:36)
    at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
    at java.security.AccessController.doPrivileged(Native Method)
    at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
    at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
    at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
    at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
    at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
    at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
    at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.io.FileNotFoundException:
wso2greg-5.0.0-SNAPSHOT/repository/conf/governance.xml (No such file or
directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at
org.wso2.carbon.governance.common.utils.GovernanceUtils.getGovernanceConfiguration(GovernanceUtils.java:67)
    ... 16 more


[1] -
https://github.com/wso2/carbon-governance/blob/master/features/extensions/org.wso2.carbon.registry.extensions.server.feature/resources/conf/governance.xml
[2] -
https://github.com/wso2/carbon-governance/blob/master/features/extensions/org.wso2.carbon.registry.extensions.server.feature/resources/p2.inf#L20
[3] -
https://github.com/wso2/product-greg/blob/master/modules/distribution/src/main/assembly/bin.xml#L978

Thanks

Prasanna Dangalla
Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware

cell: +94 777 55 80 30 | +94 718 11 27 51
twitter: @prasa77
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to