Tuesday, February 18, 2014

How to set correct JDK

How to set correct JDK when multiple versions available in Linux

Method1
Sometime setting the PATH variable like below doesn't resolve the issue in some machines.

export PATH=$PATH:$JAVA_HOME/bin

Then try append the Java path before loading the rest of the PATH variables like below. 

export PATH=$JAVA_HOME/bin:$PATH

Method2

You can choose between already available alternative java by entering the below command in ubuntu

$sudo update-alternatives --config java

You will be getting an output similar to below for a user selection.

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-oracle/jre/bin/java   1         auto mode
  1            /usr/lib/jvm/java-7-oracle/jre/bin/java   1         manual mode
* 2            /usr/lib/jvm/jdk1.6.0_45/bin/java         1         manual mode

Press enter to keep the current choice[*], or type selection number:

If you want to include a particular version of JDK use below command

sudo update-alternatives --install <link> <name> <path> <priority>

e.g.
$sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java" 1

Thursday, January 23, 2014

How to expose AdminServices

To list Admin Services and to use in WSO2 Product stack

To enable Admin services please navigate to $WSO2CARBON_HOME/repository/conf/carbon.xml

1. Set the HideAdminServiceWSDLs tag to false
<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>

2. Restart the server with -DosgiConsole option
e.g wso2server.sh -DosgiConsole

3. From the OSGI console type the below and enter
listAdminServices

4. You will get all the exposed admin services for your product

5. This can be invoked using soapUI or any tool of your choice for verification
https://<hostname>:<post>/services/<ServiceName>?wsdl

e.g. https://localhost:9443/services/HumanTaskClientAPIAdmin?wsdl