简体   繁体   English

WSO2 IS(预打包)作为 API-M 错误的密钥管理器

[英]WSO2 IS(pre-packaged) as Key Manager to API-M error

The pre-packaged Identity Server cannot mount _system/config as specified in registry.xml:预打包的 Identity Server 无法按照 registry.xml 中的指定挂载 _system/config:

<mount path="/_system/config" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/config</targetPath>
</mount>

After configuring and initial start-up (sh wso2server -Dsetup) I get:配置和初始启动(sh wso2server -Dsetup)后,我得到:

ERROR {org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent} -  Unable to create fixed remote mounts. {org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent}
org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException: Resource does not exist at path /_system/governance

Then I configured API-M , started up , successfully creates both mounts.然后我配置了 API-M ,启动了,成功创建了两个挂载。

Restarted IS and get :重新启动 IS 并获得:

INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} -  Connected to mount at govregistry in 2ms {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService}
ERROR {org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent} -  Unable to create fixed remote mounts. {org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent}
org.wso2.carbon.registry.core.exceptions.RegistryException: An exception occurred while executing handler chain. null
    at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.delete(HandlerManager.java:2649)
    at org.wso2.carbon.registry.core.jdbc.handlers.UserDefinedHandlerManager.delete(UserDefinedHandlerManager.java:215)
    at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.delete(HandlerLifecycleManager.java:452)
    at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.delete(EmbeddedRegistry.java:843)
    at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.delete(CacheBackedRegistry.java:512)
    at org.wso2.carbon.registry.core.session.UserRegistry.deleteInternal(UserRegistry.java:870)
    at org.wso2.carbon.registry.core.session.UserRegistry.access$1100(UserRegistry.java:60)
    at org.wso2.carbon.registry.core.session.UserRegistry$12.run(UserRegistry.java:845)
    at org.wso2.carbon.registry.core.session.UserRegistry$12.run(UserRegistry.java:842)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.wso2.carbon.registry.core.session.UserRegistry.delete(UserRegistry.java:842)
    at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.setupMounts(RegistryCoreServiceComponent.java:343)
    at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.buildRegistryService(RegistryCoreServiceComponent.java:572)
    at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.activate(RegistryCoreServiceComponent.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
    at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
    at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
    at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:70)
    at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
    at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NullPointerException
    at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.delete(MountHandler.java:492)
    at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.delete(HandlerManager.java:2627)
    ... 50 more

The registry view in IS console shows that governance is successfully mounted. IS 控制台中的注册表视图显示已成功安装治理。

Should the IS config registry be shared/mounted? IS 配置注册表应该共享/挂载吗? If so please advise or update the documentation.如果是这样,请告知或更新文档。

Also is this correct in registry.xml as per the doc ?:根据文档,registry.xml 中的这是否也正确?:

<remoteInstance url="https://localhost">    
        <id>gov</id>
        <dbConfig>govregistry</dbConfig>
        <cacheId>root@jdbc:mysql://10.20.30.42:3306/registrydb</cacheId>
        <readOnly>false</readOnly>
        <enableCache>true</enableCache>
        <registryRoot>/</registryRoot>
</remoteInstance>

Should that be my local IP address and also the db previously created is registry not registrydb那应该是我的本地 IP 地址,而且之前创建的数据库是 registry 而不是 registrydb

is/repository/conf/registry.xml是/repository/conf/registry.xml

<dbConfig name="wso2registry">

        <dataSource>jdbc/WSO2CarbonDB</dataSource>

    </dbConfig>


    <dbConfig name="govregistry">
        <dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>

<remoteInstance url="https://localhost">    
        <id>gov</id>
        <dbConfig>govregistry</dbConfig>
        <cacheId>root@jdbc:mysql://10.20.30.42:3306/registrydb</cacheId>
        <readOnly>false</readOnly>
        <enableCache>true</enableCache>
        <registryRoot>/</registryRoot>
</remoteInstance>

<mount path="/_system/governance" overwrite="true">
        <instanceId>gov</instanceId>
        <targetPath>/_system/governance</targetPath>
</mount>

<mount path="/_system/config" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/config</targetPath>
</mount>

API-M/repository/conf/registry.xml : API-M/repository/conf/registry.xml :

 <dbConfig name="wso2registry">

        <dataSource>jdbc/WSO2CarbonDB</dataSource>

    </dbConfig>

<dbConfig name="govregistry">
       <dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>

<remoteInstance url="https://localhost">    
       <id>gov</id>
       <dbConfig>govregistry</dbConfig>
       <cacheId>root@jdbc:mysql://10.20.30.42:3306/registrydb</cacheId>
       <readOnly>false</readOnly>
       <enableCache>true</enableCache>
       <registryRoot>/</registryRoot>
</remoteInstance>

<mount path="/_system/governance" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/governance</targetPath>
</mount>

<mount path="/_system/config" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/config</targetPath>
</mount>

I have followed ( https://docs.wso2.com/display/CLUSTER420/Configuring+the+Pre-Packaged+Identity+Server+5.0.0+with+API+Manager+1.9.0 )我遵循了( https://docs.wso2.com/display/CLUSTER420/Configuring+the+Pre-Packaged+Identity+Server+5.0.0+with+API+Manager+1.9.0

In fact there is problem with mount governance space.事实上,mount 治理空间存在问题。 Governance space in Identity Server has already been mounted after define the from mentioned IdS as KeyManager guide.在将上述 IdS 定义为 KeyManager 指南后,Identity Server 中的治理空间已经安装。

The config space isn`t configured correctly, because in registry.xml the 'conf' mount is after the 'governance'.配置空间没有正确配置,因为在 registry.xml 中,'conf' 挂载在 'governance' 之后。 When 'conf' part will be moved before 'governance' the error will stil appear, but 'config' will appear as remote space in registry browser in wso2 web console.当 'conf' 部分将在 'governance' 之前移动时,错误仍会出现,但 'config' 将在 wso2 Web 控制台的注册表浏览器中显示为远程空间。

Below is mentioned registry.xml mounting order:下面提到了 registry.xml 安装顺序:

<mount path="/_system/config" overwrite="true">
   <instanceId>gov</instanceId>
   <targetPath>/_system/config</targetPath>
</mount>

<mount path="/_system/governance" overwrite="true">
   <instanceId>gov</instanceId>
   <targetPath>/_system/governance</targetPath>
</mount>

Seems like an issues with reistry configuration.似乎是 reistry 配置的问题。 Please make sure your registry.xml configurations are correct.请确保您的 registry.xml 配置正确。 Please clean the database and restart the both servers.请清理数据库并重新启动两台服务器。

IS Side:是边:

<dbConfig name="govregistry">
        <dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>

<remoteInstance url="https://localhost">    
        <id>gov</id>
        <dbConfig>govregistry</dbConfig>
        <cacheId>root@jdbc:mysql://10.20.30.42:3306/registrydb</cacheId>
        <readOnly>false</readOnly>
        <enableCache>true</enableCache>
        <registryRoot>/</registryRoot>
</remoteInstance>

<mount path="/_system/governance" overwrite="true">
        <instanceId>gov</instanceId>
        <targetPath>/_system/governance</targetPath>
</mount>

<mount path="/_system/config" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/config</targetPath>
</mount>

APIM Side : APIM 端:

<dbConfig name="govregistry">
       <dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>

<remoteInstance url="https://localhost">    
       <id>gov</id>
       <dbConfig>govregistry</dbConfig>
       <cacheId>root@jdbc:mysql://10.20.30.42:3306/registrydb</cacheId>
       <readOnly>false</readOnly>
       <enableCache>true</enableCache>
       <registryRoot>/</registryRoot>
</remoteInstance>

<mount path="/_system/governance" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/governance</targetPath>
</mount>

<mount path="/_system/config" overwrite="true">
       <instanceId>gov</instanceId>
       <targetPath>/_system/config</targetPath>
</mount>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM