다음과 같이 이슈 및 메타 데이터 저장소 관리자를로드하려고합니다.아티팩트 및 메타 데이터 저장소 관리자가 null입니다.
private IArtifactRepositoryManager getArtifactRepositoryManager() {
IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager)
ServiceHelper.getService(ProvUIActivator.getContext(),
IArtifactRepositoryManager.class.getName());
if(artifactManager == null) {
LOG.error("ArtifactRepositoryManager service nor found");
}
return artifactManager;
}
ServiceHelper는 항상 null을 반환합니다. 저장소 관리자를 얻는 또 다른 방법이 있습니까? Eclipse/RCP 3.7 (Indigo)을 사용하고 있습니다.
전에 Eclipse 3.5에서 번들을 사용했는데이 코드로 모든 것이 잘 작동합니다.
private IMetadataRepositoryManager getMetadataRepositoryManager() {
//Load repository manager
IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) context.getService(
context.getServiceReference(IMetadataRepositoryManager.class.getName()));
return metadataManager;
}