0

我正在尝试按照以下指南http://wso2.org/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances让 BAM 指向共享注册表。

两者的版本:BAM 2.2.0 greg 4.5.3 Platform CentOS 6.3 JAVA 1.6

两者都指向同一个 MySQL 服务器。

所以配置是 3 VM: 1 BAM 1 GREG 1 MySQl

格雷格

<datasource>
        <name>WSO2_CARBON_DB</name>
        <description>The datasource used for registry and user manager</description>
        <jndiConfig>
            <name>jdbc/WSO2CarbonDB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://wso2mysql.prod.local:3306/odaigreg</url>
                <username>odaigreg</username>
                <password>odaigreg1</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>80</maxActive>
                <maxWait>60000</maxWait>
                <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>

在 BAM 上

   <datasource>
        <name>WSO2_CARBON_DB</name>
        <description>The datasource used for registry and user manager</description>
        <jndiConfig>
            <name>jdbc/WSO2CarbonDB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://wso2mysql.prod.local:3306/odaibam</url>
                <username>odaibam</username>
                <password>odaibam1</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>30</maxActive>
                <maxWait>60000</maxWait>
                <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>

    <datasource>
       <name>WSO2BAM_DATASOURCE</name>
       <description>The datasource used for analyzer data</description>
       <definition type="RDBMS">
           <configuration>
                <url>jdbc:mysql://wso2mysql.prod.local:3306/odaibam</url>
                <username>odaibam</username>
                <password>odaibam1</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>30</maxActive>
                <maxWait>60000</maxWait>
                <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
       </definition>
   </datasource>

并在registry.xml中

<currentDBConfig>wso2registry</currentDBConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>

<dbConfig name="wso2registry">
    <dataSource>jdbc/WSO2CarbonDB</dataSource>
</dbConfig>

 <dbConfig name="governanceRegistry">
     <url>jdbc:mysql://wso2mysql.prod.local:3306/odaigreg</url>
     <username>odaigreg</username>
     <password>odaigreg1</password>
     <driverClassName>com.mysql.jdbc.Driver</driverClassName>
     <maxActive>30</maxActive>
     <maxWait>60000</maxWait>
     <minIdle>5</minIdle>
     <testOnBorrow>true</testOnBorrow>
     <validationQuery>SELECT 1</validationQuery>
     <validationInterval>30000</validationInterval>
</dbConfig>
<remoteInstance url="https://wso2greg.prod.local:9443/registry">
    <id>governanceRegistryInstance</id>
    <dbConfig>governanceRegistry</dbConfig>
    <readOnly>false</readOnly>
    <enableCache>true</enableCache>
    <registryRoot>/</registryRoot>
</remoteInstance>

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

我收到此错误:

    TID: [0] [BAM] [2013-04-30 16:26:01,052]  INFO {org.apache.cassandra.config.DatabaseDescriptor} -  Loading settings from file:/opt/wso2bam-2.2.0/repository/conf/etc/cassandra.yaml {org.apache.
cassandra.config.DatabaseDescriptor}
TID: [0] [BAM] [2013-04-30 16:26:01,146]  INFO {org.wso2.carbon.bam.toolbox.deployer.internal.DataBridgeRecieverServiceComponent} -  Successfully setted data bridge reciever service {org.wso2.
carbon.bam.toolbox.deployer.internal.DataBridgeRecieverServiceComponent}
TID: [0] [BAM] [2013-04-30 16:26:01,153]  INFO {org.wso2.carbon.databridge.core.internal.DataBridgeDS} -  Successfully deployed Agent Server  {org.wso2.carbon.databridge.core.internal.DataBrid
geDS}
TID: [0] [BAM] [2013-04-30 16:26:01,622]  INFO {org.apache.cassandra.config.DatabaseDescriptor} -  DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap {org.apache.cassandra.co
nfig.DatabaseDescriptor}
TID: [0] [BAM] [2013-04-30 16:26:01,622]  INFO {org.apache.cassandra.config.DatabaseDescriptor} -  DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap {org.apache.cassandra.co
nfig.DatabaseDescriptor}
TID: [0] [BAM] [2013-04-30 16:26:01,820]  INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} -  Configured Registry in 222ms {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry
Service}
TID: [0] [BAM] [2013-04-30 16:26:01,939]  INFO {org.apache.cassandra.config.DatabaseDescriptor} -  Global memtable threshold is enabled at 329MB {org.apache.cassandra.config.DatabaseDescriptor
}
TID: [0] [BAM] [2013-04-30 16:26:01,939]  INFO {org.apache.cassandra.config.DatabaseDescriptor} -  Global memtable threshold is enabled at 329MB {org.apache.cassandra.config.DatabaseDescriptor
}
TID: [0] [BAM] [2013-04-30 16:26:01,993] FATAL {org.wso2.carbon.utils.dbcreator.DatabaseCreator} -  Failed to create database tables for registry resource store. null {org.wso2.carbon.utils.db
creator.DatabaseCreator}
java.sql.SQLException
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:253)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:694)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:626)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:182)
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
        at org.wso2.carbon.utils.dbcreator.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:58)
        at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager.createDatabase(JDBCDataAccessManager.java:122)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.configure(EmbeddedRegistryService.java:189)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.<init>(EmbeddedRegistryService.java:99)
        at org.wso2.carbon.registry.core.config.RegistryContext.getEmbeddedRegistryService(RegistryContext.java:644)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.getRegistry(MountHandler.java:221)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.resourceExists(MountHandler.java:322)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.resourceExists(MountHandler.java:302)
        at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.resourceExists(HandlerManager.java:3130)
        at org.wso2.carbon.registry.core.jdbc.handlers.UserDefinedHandlerManager.resourceExists(UserDefinedHandlerManager.java:260)
        at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.resourceExists(HandlerLifecycleManager.java:1293)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.resourceExists(EmbeddedRegistry.java:637)
        at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.resourceExists(CacheBackedRegistry.java:250)
        at org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:630)
        at org.wso2.carbon.registry.core.utils.RegistryUtils.systemResourceShouldBeAdded(RegistryUtils.java:573)
        at org.wso2.carbon.registry.core.utils.RegistryUtils.addServiceStoreCollection(RegistryUtils.java:848)
        at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.buildRegistryService(RegistryCoreServiceComponent.java:582)
        at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.activate(RegistryCoreServiceComponent.java:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:252)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:346)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
        at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:328)
        at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
        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:68)
        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:389)
        at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
        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 java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:245)
        ... 60 more
TID: [0] [BAM] [2013-04-30 16:26:01,996] ERROR {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} -  Error occurred while creating the database {org.wso2.carbon.registry.core.jdbc.Em
beddedRegistryService}
TID: [0] [BAM] [2013-04-30 16:26:01,996] ERROR {org.wso2.carbon.registry.core.config.RegistryContext} -  Couldn't initialize EmbeddedRegistryService. Error occurred while creating the database
 {org.wso2.carbon.registry.core.config.RegistryContext}
org.wso2.carbon.registry.core.exceptions.RegistryException: Error occurred while creating the database
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.configure(EmbeddedRegistryService.java:193)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.<init>(EmbeddedRegistryService.java:99)
        at org.wso2.carbon.registry.core.config.RegistryContext.getEmbeddedRegistryService(RegistryContext.java:644)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.getRegistry(MountHandler.java:221)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.resourceExists(MountHandler.java:322)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.resourceExists(MountHandler.java:302)
        at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.resourceExists(HandlerManager.java:3130)
        at org.wso2.carbon.registry.core.jdbc.handlers.UserDefinedHandlerManager.resourceExists(UserDefinedHandlerManager.java:260)
        at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.resourceExists(HandlerLifecycleManager.java:1293)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.resourceExists(EmbeddedRegistry.java:637)
        at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.resourceExists(CacheBackedRegistry.java:250)
        at org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:630)
        at org.wso2.carbon.registry.core.utils.RegistryUtils.systemResourceShouldBeAdded(RegistryUtils.java:573)
        at org.wso2.carbon.registry.core.utils.RegistryUtils.addServiceStoreCollection(RegistryUtils.java:848)
        at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.buildRegistryService(RegistryCoreServiceComponent.java:582)
        at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.activate(RegistryCoreServiceComponent.java:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:252)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:346)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
        at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:328)
        at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
        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:68)
        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:389)
        at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
        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: org.wso2.carbon.registry.core.exceptions.RegistryException: Error in creating the database
        at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager.createDatabase(JDBCDataAccessManager.java:125)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.configure(EmbeddedRegistryService.java:189)
        ... 52 more
Caused by: java.lang.Exception: Failed to create database tables for registry resource store. null
        at org.wso2.carbon.utils.dbcreator.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:69)
        at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager.createDatabase(JDBCDataAccessManager.java:122)
        ... 53 more
Caused by: java.sql.SQLException
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:253)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:694)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:626)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:182)
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
        at org.wso2.carbon.utils.dbcreator.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:58)
        ... 54 more
Caused by: java.lang.NullPointerException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:245)
        ... 60 more
TID: [0] [BAM] [2013-04-30 16:26:02,002] ERROR {org.wso2.carbon.registry.core.ResourceImpl} -  Unable to test existence of resource {org.wso2.carbon.registry.core.ResourceImpl}
org.wso2.carbon.registry.core.exceptions.RegistryException: Couldn't initialize EmbeddedRegistryService. Error occurred while creating the database
        at org.wso2.carbon.registry.core.config.RegistryContext.getEmbeddedRegistryService(RegistryContext.java:648)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.getRegistry(MountHandler.java:221)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.resourceExists(MountHandler.java:322)
        at org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.resourceExists(MountHandler.java:302)
        at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.resourceExists(HandlerManager.java:3130)
        at org.wso2.carbon.registry.core.jdbc.handlers.UserDefinedHandlerManager.resourceExists(UserDefinedHandlerManager.java:260)
        at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.resourceExists(HandlerLifecycleManager.java:1293)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.resourceExists(EmbeddedRegistry.java:637)
        at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.resourceExists(CacheBackedRegistry.java:250)
        at org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:630)
        at org.wso2.carbon.registry.core.utils.RegistryUtils.systemResourceShouldBeAdded(RegistryUtils.java:573)
        at org.wso2.carbon.registry.core.utils.RegistryUtils.addServiceStoreCollection(RegistryUtils.java:848)
        at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.buildRegistryService(RegistryCoreServiceComponent.java:582)
        at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.activate(RegistryCoreServiceComponent.java:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:252)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
        at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:346)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
        at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
        at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:328)
        at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
        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:68)
        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:389)
        at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
        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: org.wso2.carbon.registry.core.exceptions.RegistryException: Error occurred while creating the database
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.configure(EmbeddedRegistryService.java:193)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.<init>(EmbeddedRegistryService.java:99)
        at org.wso2.carbon.registry.core.config.RegistryContext.getEmbeddedRegistryService(RegistryContext.java:644)
        ... 50 more
Caused by: org.wso2.carbon.registry.core.exceptions.RegistryException: Error in creating the database
        at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager.createDatabase(JDBCDataAccessManager.java:125)
        at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.configure(EmbeddedRegistryService.java:189)
        ... 52 more
Caused by: java.lang.Exception: Failed to create database tables for registry resource store. null
        at org.wso2.carbon.utils.dbcreator.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:69)
        at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager.createDatabase(JDBCDataAccessManager.java:122)
        ... 53 more
Caused by: java.sql.SQLException
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:253)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:694)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:626)
        at 

有什么提示吗?谢谢卢卡

4

1 回答 1

0

该教程有一些过时的配置。您需要关注 http://docs.wso2.org/wiki/display/BAM220/Sharing+Registry+Space+Among+Multiple+Products

获取更新的文档。

您可以从 registry.xml 中删除以下内容并在 BAM 上进行以下更改。

<dbConfig name="governanceRegistry">
     <url>jdbc:mysql://wso2mysql.prod.local:3306/odaigreg</url>
     <username>odaigreg</username>
     <password>odaigreg1</password>
     <driverClassName>com.mysql.jdbc.Driver</driverClassName>
     <maxActive>30</maxActive>
     <maxWait>60000</maxWait>
     <minIdle>5</minIdle>
     <testOnBorrow>true</testOnBorrow>
     <validationQuery>SELECT 1</validationQuery>
     <validationInterval>30000</validationInterval>
</dbConfig>

并更改 dbconfig 。

<remoteInstance url="https://wso2greg.prod.local:9443/registry">
    <id>governanceRegistryInstance</id>
    <dbConfig>wso2registry</dbConfig>
    <readOnly>false</readOnly>
    <enableCache>true</enableCache>
    <registryRoot>/</registryRoot>
</remoteInstance>

如果你还有问题。

此外,您可以使用 H2 数据库(或使用另一个数据库)来存储 BAM 的数据,而无需使用 all in one 这是正确的方法。

要在 BAM 服务器上快速做到这一点,请尝试执行以下操作。

为 WSO2_CARBON_DB (master-datasources.xml) 保留现有的 H2 数据库

<datasource>
            <name>WSO2_CARBON_DB</name>
            <description>The datasource used for registry and user manager</description>
            <jndiConfig>
                <name>jdbc/WSO2CarbonDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>

并重命名 dbconfig 使其使用 WSO2BAM_DATASOURCE (registry.xml)

<dbConfig name="wso2registry">
    <dataSource>jdbc/WSO2BAM_DATASOURCE</dataSource>
</dbConfig>
于 2013-04-30T15:35:19.560 回答