[英]Access WSO2IS XACML policy with API created in WSO2 API manager. Unable to access XACML policy
[英]Unable to publish XACML policy in wso2 application manager and throwing NoSuchMethodError exception
我按照以下鏈接提供的步驟在wso2應用程序管理器中創建策略並發布
在創建XACML策略並嘗試將其發布到PDP后,出現以下錯誤
[2014-09-15 15:52:53,007] ERROR - ApplicationDispatcher Servlet.service() for servlet bridgeservlet threw exception
java.lang.NoSuchMethodError: org.wso2.carbon.identity.entitlement.stub.EntitlementPolicyAdminServiceStub.publishPolicies([Ljava
g;Ljava/lang/String;ZI)V
at org.wso2.carbon.identity.entitlement.ui.client.EntitlementPolicyAdminServiceClient.publish(EntitlementPolicyAdminSer
at org.apache.jsp.entitlement.publish_002dfinish_jsp._jspService(org.apache.jsp.entitlement.publish_002dfinish_jsp:133)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
我想將XACML策略集成到WSO2 APIM中。 下面是我要在wso2 api管理器中發布的XACML策略。
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="TestPolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">foo</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Rule Effect="Permit" RuleId="Rule-1">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">GET</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Condition>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of">
<Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">test</AttributeValue>
<AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Apply>
</Condition>
</Rule>
<Rule Effect="Deny" RuleId="Deny-Rule"/>
</Policy>
這不是XACML策略的錯誤。 根據錯誤,它清楚地指出java.lang.NoSuchMethodError: org.wso2.carbon.identity.entitlement.stub.EntitlementPolicyAdminServiceStub.publishPolicies([Ljavag;Ljava/lang/String;ZI)V
因此,這是您調用的Web服務API的問題。 這意味着很可能Web服務API中的API發生了更改,並且某些組件仍在調用較舊的API。 在將XACML功能安裝到API管理器中之后,可能已經安裝了一些較舊版本的XACML功能。 但是,您能否檢查系統中是否存在以下jar文件的兩個版本。
<APIM_HOME>/repository/components/plugin
目錄並搜索名稱。 org.wso2.carbon.identity.entitlement.stub
如果有兩個jar文件,請刪除一個jar文件(例如舊版本)
請在bundle.info
文件中刪除該jar文件的OSGI條目,該文件可以在<APIM_HOME>repository/components/default/configuration/org.eclipse.equinox.simpleconfigurator
目錄中找到
重新啟動服務器,然后嘗試操作。
如果不起作用,請刪除其他jar文件並添加較舊的jar文件,並記住將新刪除的條目添加到上述在step3中提到的文件中
這不是解決此問題的正確方法。 我想,最好的是,您可以通過為所使用的APIM版本找到正確的P2存儲庫來重新安裝XACML功能。 你可以在這里找到
這是由於安裝了錯誤的XACML和XACML介體功能版本。 請使用管理控制台再次卸載功能,然后重新安裝正確的版本。
示例:如果您使用的是WSO2 APIM 1.7
是您應該選擇的正確版本。 您可以使用此表找到它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.