0

我是和 wso2 的新手。我试过这个帖子。但是在 Tomcat 7.0.10 中部署 MediCom.war 并登录到medi_home.jspvia后出现以下错误/localhost/MediCom/WebContent/index.jsp

An error occurred at line: 6 in the generated java file
Only a type can be imported. org.xacmlinfo.xacml.pep.agent.PEPAgent resolves to a package

An error occurred at line: 7 in the generated java file
Only a type can be imported. com.medi.sample.webapp.client.PEPClient resolves to a package

An error occurred at line: 13 in the jsp file: /WebContent/medi_home.jsp
PEPClient cannot be resolved to a type
10: 
11:     String[] staticActionsInPage = new String[] {"create", "read", "update", "delete"};
12:     
13:     PEPClient client = new PEPClient();
14:     List<String> allowedActions = client.getAllowedResources(userName, staticActionsInPage);

提前致谢!

4

1 回答 1

1

看来您只下载了 web 项目,而没有下载其他依赖项目。

有两种方法可以消除此错误。

1)转到此网址:https ://svn.wso2.org/repos/wso2/people/asela/xacml/pep/simple-agent/target/

下载 jar 文件并添加到您的项目中,它包含您要查找的此 PEPAgent 类的文件。

实际上,PEP 是 XACML 架构中的组件之一,它将强制您的应用程序使用 XACMl 获得身份服务器的授权。

您使用的示例中使用的 PEP 是整个不同的项目,您可以在这里找到整个项目: https ://svn.wso2.org/repos/wso2/people/asela/xacml/pep/simple-agent 如果你去通过类和代码你会得到更多的理解。

在此链接中: https ://svn.wso2.org/repos/wso2/people/asela/xacml/sample/healthcare/

您会发现在您的 webapp 示例中使用的其他项目。它们都是 maven 项目,因此您可以根据需要在主项目中添加依赖项。

祝你好运

于 2014-12-24T15:09:08.567 回答