Does WSO2 support MySQL Master/Slave Cluster? - wso2

I have tried to use MySQL Master/Slave cluster in WSO2 cluster deployment, but failed when startup. Does WSO2 only support MySql Share-Nothing cluster? How does it support MySQL Master/Slave?
My datasource was configured as below:
<datasource>
<name>WSO2REG_LOCAL</name>
<description>The datasource used for registry</description>
<jndiConfig>
<name>jdbc/WSO2REG_LOCAL</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql:replication://wso2dbmaster:3306,wso2dbslave1:3306,wso2dbslave2:3306/WSO2_REG_LOCAL_AM_GW_MGR_1?roundRobinLoadBalance=true;autoReconnect=true;</url>
<username>test</username>
<password>test</password>
<driverClassName>com.mysql.jdbc.ReplicationDriver</driverClassName>
<defaultAutoCommit>false</defaultAutoCommit>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2REG_DB</name>
<description>This shared datasource used for registry</description>
<jndiConfig>
<name>jdbc/WSO2REG_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql:replication://wso2dbmaster:3306,wso2dbslave1:3306,wso2dbslave2:3306/WSO2_REG_DB?roundRobinLoadBalance=true;autoReconnect=true;</url>
<username>test</username>
<password>test</password>
<driverClassName>com.mysql.jdbc.ReplicationDriver</driverClassName>
<defaultAutoCommit>false</defaultAutoCommit>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
registry.xml was configured as below:
<currentDBConfig>wso2registry</currentDBConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
<dbConfig name="wso2registry">
<dataSource>jdbc/WSO2REG_LOCAL</dataSource>
</dbConfig>
<dbConfig name="sharedregistry">
<dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>
<remoteInstance url="https://localhost:9443/registry">
<id>instanceid</id>
<dbConfig>sharedregistry</dbConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
<cacheId>wso2db#jdbc:mysql:replication://wso2dbmaster:3306,wso2dbslave1:3306,wso2dbslave2:3306/WSO2_REG_DB?roundRobinLoadBalance=true;autoReconnect=true;</cacheId>
</remoteInstance>
Exception occurred as below when starting up.
TID: [0] [AM] [2015-03-09 13:30:51,728] 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
....
ID: [0] [AM] [2015-03-09 13:31:03,417] ERROR {org.wso2.carbon.registry.core.dataaccess.TransactionManager} - Failed to rollback transaction. {org.wso2.carbon.registry.core.dataaccess.TransactionManager}
java.sql.SQLException: Total number of available connections are less than the total number of rollbacked or committed connections
at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDatabaseTransaction$ManagedRegistryConnection.rollback(JDBCDatabaseTransaction.java:1284)
at org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCTransactionManager.rollbackTransaction(JDBCTransactionManager.java:120)
at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.rollbackTransaction(EmbeddedRegistry.java:447)
at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:552)
at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:180)
at org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:524)
...

Normally the reason for this error is, you are using the same database for local registry space and governance space.
if you are using the same jdbc/WSO2REG_DB database as local and governance registry spaces. It is wrong by definition. It is not correct to share local registry space between any nodes in a cluster. Ideally, you could use the default H2 database as local registry database (jdbc/WSO2CarbonDB). Basically you need to keep following configuration in registry.xml file by pointing to H2 db. Just found some blog about same error which may be helpful.
<currentDBConfig>wso2registry</currentDBConfig>
<dbConfig name="wso2registry">
<dataSource>jdbc/WSO2CarbonDB</dataSource>
</dbConfig>

Related

AWS Lambda with Apache Kafka Trigger returns "PROBLEM: Lambda internal error. Please contact Lambda customer support."

I am using Spring Cloud Functions with Kafka Binder. My application SpringcloudfuncApplication.class
is pretty straightforward as can be seen below:
#SpringBootApplication
#Log4j2
public class SpringcloudfuncApplication {
public static void main(String[] args) {
SpringApplication.run(SpringcloudfuncApplication.class, args);
}
#Bean
public Function<Message<String>, String> greeter() {
return (input) -> {
log.info("Hello {}", input.getPayload());
return "Hello " + input.getPayload();
};
}
}
I am expecting a incoming StringInput then will return a greeting -> Hello {StringInput}
I have setup a self-managed Apache Kafka/Zookeeper on AWS EC2 instance with public access for testing purposes then updated my application.yml file:
spring:
cloud:
function:
definition: greeter
stream:
kafka:
default:
consumer:
startOffset: earliest
binder:
brokers: ec2-13-212-236-60.ap-southeast-1.compute.amazonaws.com:9092
bindings:
greeter-in-0:
destination: topic-names
greeter-out-0:
destination: topic-greetings
Everything is working fine on my local setup pointing to this AWS EC2 with Kafka/Zookeeper. However, I am not able to make this work when I attempt to create a function in AWS Lambda with my shaded jar then added Apache Kafka for trigger. I have followed this AWS Blog in setting up AWS Lambda with self-hosted Kafka as an Event source.
Take note that doing a AWS Lambda test by sending a string (using hello-world template) my function works. But adding a Kafka trigger gives me below error:
Last processing result: PROBLEM: Lambda internal error. Please contact Lambda customer support.
Maven dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-function-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-aws</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Maven build plugin for shaded JAR:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-thin-layout</artifactId>
<version>${spring-boot-thin-layout.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>aws</shadedClassifierName>
</configuration>
</plugin>
</plugins>
</build>
Thank you in advance! Cheers!
It looks like the main issue is I have used public subnet on my EC2 instance with Apache Kafka/Zookeeper thus I have declared a public DNS on the AWS Lambda trigger - Apache Kafka Bootsrap servers. Now, I got it working by going thru again this reference but instead of using a NAT gateway I have setup a NAT Instance for better costing. I am now getting OK on the processing results.
Apache Kafka: Endpoints: [ip-10-0-1-199.ap-southeast-1.compute.internal:9092] (Enabled)
Details
Batch size: 100
Last processing result: OK
selfManagedEventSource:
Looking into the AWS CloudWatch logs, I am now seeing these logs:
2021-03-02 12:00:45.912 INFO 8 --- [ main] o.s.c.f.a.aws.CustomRuntimeEventLoop : Located function greeter
2021-03-02 12:00:45.918 INFO 8 --- [ main] c.j.s.s.SpringcloudfuncApplication : Hello {
"eventSource": "SelfManagedKafka",
"bootstrapServers": "ip-10-0-1-199.ap-southeast-1.compute.internal:9092",
"records": {
"topic-names-0": [
{
"topic": "topic-names",
"partition": 0,
"offset": 13,
"timestamp": 1614686444377,
"timestampType": "CREATE_TIME",
"value": "SnVuIEtpbmc="
}
]
}
}
And this goes to my next question, my String message produced on the topic is "Jun King" but the message returned to me is a JSON payload with my expected value encoded into Base64. I have tried to decode "SnVuIEtpbmc=" using this Online Base64Decoder which indeed return my actual message "Jun King".
I can process this within the code but would that make my function AWS-aware? and would have to traverse it. Thank you again in advance. Cheers!

Invoke command / Json Format Error during Amazon Web Services (AWS) Lambda Tutorial

I've spent ~6 hours banging my head against an issue encountered in the official tutorial for Amazon Web Services (AWS) Lambda. I'm only using code provided in the tutorial..
I encounter the issue on Step 2.3.2: Test the Lambda Function (Invoke Manually), found on this page:
https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-upload-deployment-pkg.html?shortFooter=true
At this step we're creating an inputfile.txt using code provided by the AWS tutorial - the code simulates an "event" which triggers lambda.
Here's the code that goes into the inputfile.txt (I'm only copying & pasting from the tutorial):
{
"Records":[
{
"eventVersion":"2.0",
"eventSource":"aws:s3",
"awsRegion":"us-west-2",
"eventTime":"1970-01-01T00:00:00.000Z",
"eventName":"ObjectCreated:Put",
"userIdentity":{
"principalId":"AIDAJDPLRKLG7UEXAMPLE"
},
"requestParameters":{
"sourceIPAddress":"127.0.0.1"
},
"responseElements":{
"x-amz-request-id":"C3D13FE58DE4C810",
"x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD"
},
"s3":{
"s3SchemaVersion":"1.0",
"configurationId":"testConfigRule",
"bucket":{
"name":"sourcebucket",
"ownerIdentity":{
"principalId":"A3NL1KOZZKExample"
},
"arn":"arn:aws:s3:::sourcebucket"
},
"object":{
"key":"HappyFace.jpg",
"size":1024,
"eTag":"d41d8cd98f00b204e9800998ecf8427e",
"versionId":"096fKKXTRTtl3on89fVO.nfljtsv6qko"
}
}
}
]
}
Here's the code which activates the inputfile.txt as an "event":
aws lambda invoke \
--invocation-type Event \
--function-name CreateThumbnail7 \
--region us-west-2 \
--payload file:/Users/username/inputfile.txt \
--profile adminuser \
outputfile.txt
and the error message about the invoke command:
An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Unrecognized token 'file': was expecting 'null', 'true', 'false' or NaN
at [Source: [B#4aeacf9d; line: 1, column: 6]
(???)
Any ideas what could be happening / how to fix? Is this about the format of the inputfile.txt?
I've tried everything I can think of.. I must be doing something wrong or there must be an easy fix for the JSON formatting.
For those who find this thread and are struggling with Javascript deployment package step in the Amazon Web Services (AWS) Lamba tutorial, there are three separate issues in the tutorial guidelines which you must address:
1.) Make sure your Java environment is 8, Java10 will throw a number of errors.
2.) #MikePatrick is correct, the path to your inputfile MUST be: file:///Users/username/inputfile.txt
3.) And finally, try using this pom.xml file (note the dependencies), this is the only combo that worked for me:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>doc-examples</groupId>
<artifactId>lambda-java-example</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>lambda-java-example</name>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j2</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.349</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

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:
<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:
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.
Restarted IS and get :
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.
Should the IS config registry be shared/mounted? If so please advise or update the documentation.
Also is this correct in registry.xml as per the doc ?:
<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
is/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 :
<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)
In fact there is problem with mount governance space.
Governance space in Identity Server has already been mounted after define the from mentioned IdS as KeyManager guide.
The config space isn`t configured correctly, because in registry.xml the 'conf' mount is after the '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.
Below is mentioned registry.xml mounting order:
<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. Please make sure your registry.xml configurations are correct. 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 :
<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>

how to set up Data Services Server cluster

Is there a detailed tutorials about how to set up Data Services Server cluster.
I followed the guide http://docs.wso2.org/pages/viewpage.action?pageId=29918203, but it is not specifically for DSS.
And I also have some problems about this guide.
In section "Setting up the database", how many database should we need to create? carbondb, wso2conum_db or wso2conreg_db?
I have only found the process of creating wso2conum_db or wso2conreg_db, but not found the process of creating carbondb.
Shall I need to configure a user management database, a shared registry database and a central database in "ESB_MGR_HOME/repository/conf/datasoruces/master-datasources.xml"?
Clustering data services is similar to clustering Application server http://docs.wso2.org/display/CLUSTER420/Clustering+Application+Server
For database configuration
You only need two databases.
1) wso2conreg_db - which stores the registry data (you can give any name you prefer)
2) wso2conum_db - which stores user management related data.(you can give any name you prefer)
These data sources needs to be defined in master-datasources.xml according to your database credentials as shown below.
Mounting the Registry to ESB nodes (master-datasources.xml)
<datasource>
<name>WSO2_REG_DB</name>
<description>The datasource used for registry</description>
<jndiConfig>
<name>jdbc/WSO2_REG_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://localhost:3306/wso2conreg_db</url>
<username>root</username>
<password>root</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
Configure the user management database master-datasources.xml
<datasource>
<name>WSO2_UM_DB</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2UmDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://localhost:3306/wso2conum_db</url>
<username>root</username>
<password>root</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
Mounting the Registry to ESB nodes - registry.xml
<dbConfig name="remote_registry">
<dataSource>jdbc/WSO2_REG_DB</dataSource>
</dbConfig>
<remoteInstance url="https://localhost:9445/registry">
<id>instanceid</id>
<dbConfig>remote_registry</dbConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
</remoteInstance>
<mount path="/_system/config" overwrite="true">
<instanceId>instanceid</instanceId>
<targetPath>/_system/esbnodes</targetPath>
</mount>
<mount path="/_system/governance" overwrite="true">
<instanceId>instanceid</instanceId>
<targetPath>/_system/governance</targetPath>
</mount>
Specify the userstore in user-mgt.xml
<Property name=”dataSource”>jdbc/WSO2UmDB</Property>

WSO2 BAM + shared registry

I'm trying to follow the following guide http://wso2.org/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances to have a BAM pointing to a shared registry.
Versions of the two: BAM 2.2.0 greg 4.5.3
Platform CentOS 6.3
JAVA 1.6
Both point to the same MySQL server.
So the configuration is 3 VM:
1 BAM
1 GREG
1 MySQl
On greg
<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>
on 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>
and in the 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>
I get this error:
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
Any hints?
Thanks
Luca
That tutorial has some obsolete configurations. You need to follow
http://docs.wso2.org/wiki/display/BAM220/Sharing+Registry+Space+Among+Multiple+Products
for updated documentation.
Can you remove following from registry.xml and do following changes on 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>
and also change dbconfig in.
<remoteInstance url="https://wso2greg.prod.local:9443/registry">
<id>governanceRegistryInstance</id>
<dbConfig>wso2registry</dbConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
</remoteInstance>
If you have problems still.
Further you can use H2 database (or use another database) to store BAM's data without using all in one which is correct approach.
To do that quickly
On BAM server please try to do following.
Keep exisiting H2 databsae for WSO2_CARBON_DB (master-datasources.xml)
<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>
and rename dbconfig such that it will use WSO2BAM_DATASOURCE (registry.xml)
<dbConfig name="wso2registry">
<dataSource>jdbc/WSO2BAM_DATASOURCE</dataSource>
</dbConfig>