gpt4 book ai didi

java - WSO2 GReg 5.1.0 - 使用 API 查询进行搜索不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 13:00:09 24 4
gpt4 key购买 nike

我正在尝试使用 GovernanceUtils 类并调用文档 'Searching using a Query' 中建议的方法 findGovernanceArtifacts(String query,Registryregistry, String mediaType) 来搜索治理工件。 .

当我这样做时,我将得到一个 NullPointerException 和以下堆栈跟踪。如果我在 GovernanceArtifactManagerGenericArtifactManager 上使用任何其他建议的方法调用,也会发生同样的情况。

java.lang.NullPointerException
at org.wso2.carbon.user.core.authorization.AuthorizationKey.checkAttributesAreEqual(AuthorizationKey.java:117)
at org.wso2.carbon.user.core.authorization.AuthorizationKey.equals(AuthorizationKey.java:62)
at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:1023)
at org.wso2.carbon.caching.impl.CacheImpl.containsKey(CacheImpl.java:256)
at org.wso2.carbon.user.core.authorization.AuthorizationCache.isUserAuthorized(AuthorizationCache.java:150)
at org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager.isUserAuthorized(JDBCAuthorizationManager.java:160)
at org.wso2.carbon.registry.core.jdbc.realm.RegistryAuthorizationManager.isUserAuthorized(RegistryAuthorizationManager.java:195)
at org.wso2.carbon.registry.indexing.service.ContentBasedSearchService.isAuthorized(ContentBasedSearchService.java:297)
at org.wso2.carbon.registry.indexing.service.ContentBasedSearchService.searchContentInternal(ContentBasedSearchService.java:257)
at org.wso2.carbon.registry.indexing.service.ContentBasedSearchService.searchByAttribute(ContentBasedSearchService.java:279)
at org.wso2.carbon.registry.indexing.internal.IndexingServiceComponent$AttributeSearchServiceImpl.search(IndexingServiceComponent.java:164)
at org.wso2.carbon.registry.indexing.internal.IndexingServiceComponent$AttributeSearchServiceImpl.search(IndexingServiceComponent.java:158)

有什么想法吗?

最佳答案

您是否先加载了治理工件?

GovernanceUtils.loadGovernanceArtifacts((UserRegistry) gov);

请在此处查看示例实现 https://github.com/wso2/product-greg/blob/master/modules/samples/ws-client/src/org/wso2/carbon/registry/ws/client/sample/SampleWSRegistrySearchClient.java

关于java - WSO2 GReg 5.1.0 - 使用 API 查询进行搜索不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35009921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com