Category Archives: wso2

[DEPRECATED] When WSO2 Data Services Server 3.0.1 and Cassandra 1.1 CQL 2 JDBC driver — doesn’t support BLOB

Attempted to use the following CQL 2 schema with two BLOBs:

With the following DSS configuration:

But received the following error:

[DEPRECATED] WSO2 Data Services Server 3.0.1 adding input operation parameter that maps to a query input BLOB parameter results in NullPointerException

Config:

Results in the following error:

If <with-param name="ekg" query-param="ekg"/> is removed then this error is not encountered.

[DEPRECATED] WSO2 Data Services Server 3.0.1 doesn’t work with Cassandra CQL 3

WSO2 Data Services Server 3.0.1 comes with support for an unspecified Cassandra version. However, in their documentation they call out 1.1.X. After much frustration and many NullPointerExceptions from WSO2, I discovered that while Cassandra 1.1 supports CQL 3, it defaults to CQL 2 in the JDBC driver. I also noticed that despite general JDBC support in DSS, the Cassandra JDBC driver is bundled with DSS 3.0.1 and appears to have been customized by WSO2 to support specifically Cassandra 1.1 and DSS 3.0.1.

Tonight I attempted to use the Cassandra JDBC 1.2 driver with WSO2 DSS’s support for “generic” JDBC data sources. I was able to get DSS to connect to the Cassandra server, but running even a simple SELECT query failed with a NullPointerException. To meet my current objectives, I’ve rolled back Cassandra to 1.1 to be compatible with WSO2 DSS 3.0.1 and reverted to using CQL 2. This is a bit of a disappointment since CQL 2 doesn’t seem to have any support for leveraging Cassandra’s “schema-free” features that CQL 3 does (map, set, list, etc).

[DEPRECATED] CentOS 6: Install wso2server.sh as a service that starts on boot

Versions

  • CentOS 6.3
  • Oracle JDK 1.6

Configure

Note: Replace <product> with the abbreviated name of the WSO2 product (API Manager = ‘am’, Data Services Server = ‘dss’, etc) and replace <version> with the version number (’1.3.1′, ’4.0.6′, etc)

1. Edit /etc/init.d/wso2<product>

Note: the script hard codes JAVA_HOME, but this can be deferred to the /etc/sysconfig/wso2<product> script (which you must create) if desired. Note that the normal /etc/profile.sh is *not* run for services.
TODO: find better way of setting JAVA_HOME, can’t execute /etc/profile or /etc/profile.d/java.sh directly

2. Make it executable

2. Start service on boot

Verify

1. Start service

Source

[DEPRECATED] WSO2: Use LDAP as the Carbon user-store for any WSO2 product

Tested Products

  • WSO2 Data Services Server 3.0.1
  • WSO2 API Manager 1.3.1

Overview

All WSO2 Carbon-based products can be configured to work with LDAP simply by changing the configuration files. Out of the box Carbon uses one H2 database as a user-store that stores usernames, passwords, etc and another H2 database to store roles and permissions. This guide is for replacing the first database with LDAP. This configuration has been tested with both the WSO2 API Manager and WOS2 Data Services Server.

1. Import LDAP server PEM file into Java trust store

  • Default Carbon trust store: /repository/resources/security/client-truststore.jks
  • Defatul Carbon trust store password: wso2carbon

2. Edit <carbon-home>/repository/conf/user-mgt.xml

Note1: The password field /UserManager/Realm/Configuration/AdminRole/AdminUser/Password has no effect since the user-store is external and pre-configured.
Note2: The admin user specified at /UserManager/Realm/Configuration/AdminRole/AdminUser must be the first account to log in. Other users will not be able to log in until they are assigned a WSO2 role that has authentication privileges.
Note3: The connection name must exist in the UserSearchBase.
Note4: The user specified by /UserManager/Realm/Configuration/UserStoreManager/Property[@name="ConnectionName"] does not need to be the LDAP admin. However, it must have sufficient privileges to search all accounts that need to be authenticated.
Note5: /UserManager/Realm/Configuration/UserStoreManager/Property[@name="ReadLDAPGroups"] determines if Carbon will retain its own roles or use the LDAP server’s groups.
3. Change default admin account for Carbon applications
Note1: the file will vary depending on the WSO2 product being configured
Note2: not all WSO2 products require this (DSS does not)

API Manager

Set the username at the following XPaths:

  • /APIManager/AuthManager/Username/text()
  • /APIManager/APIGateway/Username/text()
  • /APIManager/APIKeyManager/Username/text()

Set the password at the following XPaths:

  • /APIManager/AuthManager/Password/text()
  • /APIManager/APIGateway/Password/text()
  • /APIManager/APIKeyManager/Password/text()

Sources

[DEPRECATED] CentOS 6: Install WSO2 Data Services Server

Versions

  • CentOS 6.3
  • Oracle Java JDK 1.6
  • WSO2 Data Services Server 3.0.1

Prerequisties

Install

1. Download
Download Data Services Server from WSO2 website: http://wso2.com/products/data-services-server/
Note: can’t link directly since currently requires filling out a form to download.

2. Extract

Note: update version as required
2. Move

Configure

1. Create wso2 user if missing

2. Update permissions

3. Create service script /etc/init.d/wso2dss

Note: the script hard codes JAVA_HOME, but this can be deferred to the /etc/sysconfig/wso2<product> script (which you must create) if desired. Note that the normal /etc/profile.sh is *not* run for system accounts.
TODO: find better way of setting JAVA_HOME, can’t execute /etc/profile or /etc/profile.d/java.sh directly

4. Make it executable

5. Start service

6. Start service on boot

7. Open the following ports as required:

  • 9443 – carbon admin and https port used to access data services
  • 9763 – http port used to access data services

See Open a port for iptables

Verify

Watch wso2dss logs:

Should see the following:

Visit your new Carbon website: https://<hostname>:9443/carbon/
WSO2 Data Services Server - Google Chrome_006
Initial login:

  • Username: admin
  • Password: admin

Important Note: if are you going to want to configure API Manager to use LDAP for logins, don’t log in using the default admin account!

[DEPRECATED] CentOS 6: Install WSO2 API Manager

Versions

  • CentOS 6.3
  • Oracle Java JDK 1.6
  • WSO2 API Manager 1.3.1

Prerequisties

Install

1. Download
Download API Manager from WSO2 website: http://wso2.com/products/api-manager/
Note: can’t link directly since currently requires filling out a form to download.
2. Extract

Note: update version as required

2. Move

Configure

1. Create wso2 user if missing

2. Update permissions

3. Create service script /etc/init.d/wso2am

Note: the script hard codes JAVA_HOME, but this can be deferred to the /etc/sysconfig/wso2am script (which you must create) if desired. Note that the normal /etc/profile.sh is *not* run for system accounts.
TODO: find better way of setting JAVA_HOME, can’t execute /etc/profile or /etc/profile.d/java.sh directly

4. Make it executable

5. Start service

6. Start service on boot

7. Open the following ports as required:

  • 9443 – carbon admin, publisher and store applications
  • 8243 – http port used by gateway to access API services
  • 8280 – https port used by gateway to access API services

See Open a port for iptables

Verify

Watch wso2dss logs:

Should see the following:

Visit your new Carbon website: https://XXX.XXX.XXX.XXX:9443/carbon/
WSO2 API Manager - Google Chrome_003
Initial login:

  • Username: admin
  • Password: admin

Configure LDAP

See Configure WSO2 to use LDAP