Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-15584

[fiware-stackoverflow] RuntimeException after adding MongoDB policy provider extension

    Details

      Description

      Created question in FIWARE Q/A platform on 18-03-2019 at 14:03
      Please, ANSWER this question AT https://stackoverflow.com/questions/55222019/runtimeexception-after-adding-mongodb-policy-provider-extension

      Question:
      RuntimeException after adding MongoDB policy provider extension

      Description:
      I have made my own MongoDBPolicyProvider and I have integrated it into Authzforce server, but I'm unable to start the webapp (docker image fiware/authzforce-ce-server, release-8.1.0) because of this exception:

      java.lang.RuntimeException: Invalid PDP configuration of domain 'YAT-5z9ZEemGyAJCrBEAAg' in file '/opt/authzforce-ce-server/data/domains/YAT-5z9ZEemGyAJCrBEAAg/pdp.xml': refPolicyProvider is not an instance of class org.ow2.authzforce.pap.dao.flatfile.xmlns.StaticFlatFileDAORefPolicyProvider as expected.

      I think that somehow it is still trying to retrieve policies from a StaticFlatFileDAORefPolicyProvider policy provider.

      The extension's .jar is visible in server's classpath.
      Here is my pdp configuration file:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <pdp
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://authzforce.github.io/core/xmlns/pdp/6.0"
      xmlns:oa="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
      version="6.0.0" enableXPath="false" strictAttributeIssuerMatch="false" maxVariableRefDepth="10" maxPolicyRefDepth="10">
      <refPolicyProvider
      id="refPolicyProvider"
      xmlns:ext="PRP/mongoDB"
      xsi:type="ext:MongoDBBasedPolicyProviderDescriptor"
      serverHost="localhost" serverPort="27017" dbName="PRP" collectionName="policies" />
      <rootPolicyProvider id="rootPolicyProvider" xsi:type="StaticRefBasedRootPolicyProvider">
      <policyRef>root-rbac-policyset</policyRef>
      </rootPolicyProvider>
      </pdp>

      This is the MongoDBBasedPolicyProviderDescriptor:

      @XmlAccessorType(XmlAccessType.FIELD)
      @XmlType(name = "MongoDBBasedPolicyProviderDescriptor")
      @Getter
      @Setter
      @NoArgsConstructor
      @AllArgsConstructor
      public class MongoDBBasedPolicyProviderDescriptor extends AbstractPolicyProvider

      { @XmlAttribute(name = "serverHost", required = true) protected String serverHost; @XmlAttribute(name = "serverPort", required = true) protected int serverPort; @XmlAttribute(name = "dbName", required = true) protected String dbName; @XmlAttribute(name = "collectionName", required = true) protected String collectionName; }

      I have done the process of integrating the PRP twice now, but I haven't been successful yet. I would appreciate any help in this direction.

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        cdangerville Cyril Dangerville made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        fla Fernando Lopez made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        fla Fernando Lopez made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ] AuthZForce [ 10887 ]
        aalonsog Alvaro Alonso made changes -
        Assignee Alvaro Alonso [ aalonsog ] Cyril Dangerville [ cyril.dangerville ]
        jmcantera Jose Manuel Cantera made changes -
        Assignee Jose Manuel Cantera [ jmcantera ] Alvaro Alonso [ aalonsog ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 18-03-2019 at 14:03
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55222019/runtimeexception-after-adding-mongodb-policy-provider-extension


        +Question:+
        RuntimeException after adding MongoDB policy provider extension

        +Description:+
        I have made my own MongoDBPolicyProvider and I have integrated it into Authzforce server, but I'm unable to start the webapp (docker image fiware/authzforce-ce-server, release-8.1.0) because of this exception:

        java.lang.RuntimeException: Invalid PDP configuration of domain 'YAT-5z9ZEemGyAJCrBEAAg' in file '/opt/authzforce-ce-server/data/domains/YAT-5z9ZEemGyAJCrBEAAg/pdp.xml': refPolicyProvider is not an instance of class org.ow2.authzforce.pap.dao.flatfile.xmlns.StaticFlatFileDAORefPolicyProvider as expected.


        I think that somehow it is still trying to retrieve policies from a StaticFlatFileDAORefPolicyProvider policy provider.


        The extension's .jar is visible in server's classpath.
        Here is my pdp configuration file:


        &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
        &lt;pdp
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://authzforce.github.io/core/xmlns/pdp/6.0"
            xmlns:oa="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
            version="6.0.0" enableXPath="false" strictAttributeIssuerMatch="false" maxVariableRefDepth="10" maxPolicyRefDepth="10"&gt;
            &lt;refPolicyProvider
                id="refPolicyProvider"
                xmlns:ext="PRP/mongoDB"
                xsi:type="ext:MongoDBBasedPolicyProviderDescriptor"
                serverHost="localhost" serverPort="27017" dbName="PRP" collectionName="policies" /&gt;
            &lt;rootPolicyProvider id="rootPolicyProvider" xsi:type="StaticRefBasedRootPolicyProvider"&gt;
               &lt;policyRef&gt;root-rbac-policyset&lt;/policyRef&gt;
            &lt;/rootPolicyProvider&gt;
        &lt;/pdp&gt;



        This is the MongoDBBasedPolicyProviderDescriptor:


        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "MongoDBBasedPolicyProviderDescriptor")
        @Getter
        @Setter
        @NoArgsConstructor
        @AllArgsConstructor
        public class MongoDBBasedPolicyProviderDescriptor extends AbstractPolicyProvider
        {
            @XmlAttribute(name = "serverHost", required = true)
            protected String serverHost;
            @XmlAttribute(name = "serverPort", required = true)
            protected int serverPort;
            @XmlAttribute(name = "dbName", required = true)
            protected String dbName;
            @XmlAttribute(name = "collectionName", required = true)
            protected String collectionName;
        }


        I have done the process of integrating the PRP twice now, but I haven't been successful yet. I would appreciate any help in this direction.
        Created question in FIWARE Q/A platform on 18-03-2019 at 14:03
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55222019/runtimeexception-after-adding-mongodb-policy-provider-extension


        +Question:+
        RuntimeException after adding MongoDB policy provider extension

        +Description:+
        I have made my own MongoDBPolicyProvider and I have integrated it into Authzforce server, but I'm unable to start the webapp (docker image fiware/authzforce-ce-server, release-8.1.0) because of this exception:

        java.lang.RuntimeException: Invalid PDP configuration of domain 'YAT-5z9ZEemGyAJCrBEAAg' in file '/opt/authzforce-ce-server/data/domains/YAT-5z9ZEemGyAJCrBEAAg/pdp.xml': refPolicyProvider is not an instance of class org.ow2.authzforce.pap.dao.flatfile.xmlns.StaticFlatFileDAORefPolicyProvider as expected.


        I think that somehow it is still trying to retrieve policies from a StaticFlatFileDAORefPolicyProvider policy provider.


        The extension's .jar is visible in server's classpath.
        Here is my pdp configuration file:


        &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
        &lt;pdp
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://authzforce.github.io/core/xmlns/pdp/6.0"
            xmlns:oa="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
            version="6.0.0" enableXPath="false" strictAttributeIssuerMatch="false" maxVariableRefDepth="10" maxPolicyRefDepth="10"&gt;
            &lt;refPolicyProvider
                id="refPolicyProvider"
                xmlns:ext="PRP/mongoDB"
                xsi:type="ext:MongoDBBasedPolicyProviderDescriptor"
                serverHost="localhost" serverPort="27017" dbName="PRP" collectionName="policies" /&gt;
            &lt;rootPolicyProvider id="rootPolicyProvider" xsi:type="StaticRefBasedRootPolicyProvider"&gt;
               &lt;policyRef&gt;root-rbac-policyset&lt;/policyRef&gt;
            &lt;/rootPolicyProvider&gt;
        &lt;/pdp&gt;



        This is the MongoDBBasedPolicyProviderDescriptor:


        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "MongoDBBasedPolicyProviderDescriptor")
        @Getter
        @Setter
        @NoArgsConstructor
        @AllArgsConstructor
        public class MongoDBBasedPolicyProviderDescriptor extends AbstractPolicyProvider
        {
            @XmlAttribute(name = "serverHost", required = true)
            protected String serverHost;
            @XmlAttribute(name = "serverPort", required = true)
            protected int serverPort;
            @XmlAttribute(name = "dbName", required = true)
            protected String dbName;
            @XmlAttribute(name = "collectionName", required = true)
            protected String collectionName;
        }


        I have done the process of integrating the PRP twice now, but I haven't been successful yet. I would appreciate any help in this direction.
        fla Fernando Lopez made changes -
        Assignee Jose Manuel Cantera [ jmcantera ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            cdangerville Cyril Dangerville
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: