Thursday, May 9, 2013

#THANKYOUSIRALEX - Tribute to the Greatest Football Manager Ever Sir Alex Ferguson













The Greatest Ever Manager Footballing world witness!!

27 Years ...  38 Trophies ... 28 Major Trophies .... With Manchester United ...

#LEGEND #THANKYOUSIRALEX #MANUTD #WEWILLMISSYOU

Saturday, March 2, 2013

Fix for WSO2 Developer Studio Pre Installed Eclipse Distributions to Prompt Workspace Launcher

Recently we identified a bug in WSO2 Developer Studio Pre Installed Eclipse Distributions, where these distribution packs does not prompt user to provide the workspace location with Eclipse Workspace Launcher like in vanilla Eclipse distributions. So we focused our attention to this issue since it is extremely inconvenient to Developer Studio users to always run the distribution and then switch workspaces.

As a result we identified the issue and fixed the issue for the upcoming WSO2 Developer Studio 3.0.0 version. Also we made sure that we have a workaround for the existing Developer Studio Pre Installed Distribution users to fix the issue, which is indicated below.

Please follow the steps given below to fix the issue in Developer Studio Pre Installed Distribution versions up to 2.1.0.


  1. Close pre installed Developer Studio instance if you are running. 
  2. Delete rest of the folders inside <ECLIPSE_HOME>/configuration except the list of files and folders indicated below.
    • org.eclipse.equinox.simpleconfigurator 
    • org.eclipse.equinox.source 
    • org.eclipse.update 
    • config.ini 
  3. Open the bundles.info file in <ECLIPSE_HOME>/configuration/org.eclipse.equinox.simpleconfigurator location 
  4. Find and Replace all the occurrences of "true" to "false" 
  5. Change the trailing value of entries corresponding to following list of elements from "false" to "true" 
    • org.eclipse.core.runtime
    • org.eclipse.equinox.common
    • org.eclipse.equinox.ds
    • org.eclipse.equinox.event
    • org.eclipse.equinox.p2.reconciler.dropins
    • org.eclipse.osgi
  6.   Start Developer Studio using the shell/command prompt with "-clean" switch. 

                E.g: Linux : ./eclipse -clean 
                        Windows : eclipse.exe -clean
                        Mac: ./eclipse -clean

Saturday, June 16, 2012

Configuring WSO2 BPS with PostgreSql database

WSO2 Carbon Servers including WSO2 BPS use embedded H2 database as the data source by default. But you can plug other databases as external data source for Carbon Servers. WSO2 Carbon based servers supports Oracle, MSSQL, MySQL,PostgreSql, etc.

In this tutorial we explain how to configure WSO2 BPS to use PostgreSql database as it's external data source.


Applies To:

WSO2 BPS 2.1.2
Oracle JDK 1.6.0_26
PostgreSql 9.0.4-1

Table of Content

  1. Installing PostgreSql in your system
  2. Configuring PostgreSql database
  3. Configuring BPS server with PostgreSql database
  4. Finalizing Setup

Installing PostgreSql in your system


1. Downloaded PostgreSql 9.0.4-1 from [1].
2. Downloaded PostgreSql JDBC driver from [2].
3. Install the PostgreSql instance in your operating system.
4. Configure the PostgreSql server. (E.g: Username, Password, Port,etc)
5. Log in to the PostgreSql instance using pgAdmin3.

Configuring PostgreSql database


1. Create a new database called bpsds with default database settings.
2. Copy the content of postgresql.sql dbscript which resides in <BPS_HOME>/dbscripts folder to the SQL Query tool which comes with pgAdmin3.
3. Execute the SQL Script.in pgAdmin3
4. Browse bpsds database via pgAdmin3 and check whether there are bunch of tables created in it.

Configuring BPS server with PostgreSql database


Now we need to update the configuration files in order to set PostgreSql as the database for the BPS [3]
  1. Database configuration for Registry
  2. Database configuration for User Manager
  3. Configuring BPS Data Source

Database configuration for Registry


Modify database configuration in <BPS_HOME>/repository/conf/registry.xml as follows.
    <dbConfig name="wso2registry"> 
    <url>jdbc:postgresql://localhost/[DATABASE-NAME]</url>
    <userName>[DATABASE_USERNAME]</userName>
    <password>[DATABASE_PASSWORD]</password>
    <driverName>org.postgresql.Driver</driverName>
    <maxActive>40</maxActive>
    <maxWait>60000</maxWait>
    <minIdle>5</minIdle>
    </dbConfig>

Database configuration for User Manager.


Modify database configuration in <BPS_HOME>/repository/conf/user-mgt.xml as follows.
    <Configuration>
    <AdminRole>admin</AdminRole>
    <AdminUser>
    <UserName>admin</UserName>
    <Password>admin</Password>
    </AdminUser>
    <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in thsi role sees the registry root -->
    <ReadOnly>false</ReadOnly>
    <MaxUserNameListLength>500</MaxUserNameListLength>
    <Property name="url">jdbc:postgresql://localhost/[DATABASE_NAME]</Property>
    <Property name="userName">[DATABASE_USERNAME]</Property>
    <Property name="password">[DATABASE_PASSWORD]</Property>
    <Property name="driverName">org.postgresql.Driver</Property>
    <Property name="maxActive">40</Property>
    <Property name="maxWait">60000</Property>
    <Property name="minIdle">5</Property>
    </Configuration>


Configuring BPS Data Source

You need to configure reusable data source in BPS. Modify reusable data source configuration in <BPS_HOME>/repository/conf/datasources.properties as follows.
    synapse.datasources.bpsds.driverClassName=org.postgresql.Driver
    synapse.datasources.bpsds.url=jdbc:postgresql://localhost/[DATABASE-NAME]
    synapse.datasources.bpsds.username=[DATABASE_USERNAME]
    synapse.datasources.bpsds.password=[DATABASE_PASSWORD]
Finalizing Setup
1. Now copy the downloaded PostgreSql driver to the <BPS_HOME>/repository/components/lib
2. Go to the <BPS_HOME>/bin folder and start the BPS with wso2server.bat or wso2server.sh command and check whether your BPS instance starts without any error.

References:


  1. http://www.enterprisedb.com/products-services-training/pgdownload#windows
  2. http://jdbc.postgresql.org/download/postgresql-9.0-801.jdbc4.jar
  3. http://wso2.org/blog/sumedha/9154

Author:

Harshana Martin
Senior Software Engineer, WSO2 Inc

Wednesday, June 13, 2012

Apache Axis2 integration with Eclipse

 Overview

Apache Axis2 is a popular open source Web Service Engine and the Axis2 project is hosted at the Apache organization. Eclipse is the most widely used and most popular Integrated Development Environment (IDE). At WSO2, we have a complete middle platform which is known as WSO2 Carbon based on OSGi and Axis2. WSO2 Application Server leverages all the features of Apache Tomcat Application Server and Apache Axis2 Web Service Engine. 

At WSO2, we also have implemented an Eclipse IDE based tooling platform for WSO2 Carbon middleware platform which is known as WSO2 Developer Studio. WSO2 Developer Studio contains tools for WSO2 Application Server, WSO2 Enterprise Service Bus, WSO2 Data Services Server, etc and in this article we are going to explain how to use WSO2 Developer Studio tools to implement web services for Apache Axis2 web service engine.



Applies To:

WSO2 Developer Studio 2.0.0
Eclipse Helios SR2 3.6.2
Apache Axis2 1.6.2


Content

1. Installing WSO2 Developer Studio 
2. Top Down Web Service Implementation 
3. Bottom Up Web Service Implementation
4. Deploy Web Service in Axis2


Installing WSO2 Developer Studio 

WSO2 Developer Studio installation guide can be found from here [1]. After installing WSO2 Developer Studio we can continue to implement the Axis2 Web Services with it.

Top Down Web Service Implementation

There are 2 methods to implement Axis2 Web Services. First method we are going to discuss here is known as Top Down approach. In top down web service implementation first thing you implement is the WSDL (Web Service Description Language) file which defines the Web Service contract. WSDL file defines all the information about the Web Service and how the clients can access the Web Service, etc. 

Once you finish the implementing your WSDL file or you have the WSDL file of the 3rd party Web Service, you can use this WSDL file to generate Axis2 web service.

1. Select File -> New -> Other



2. From the New Wizard, first select  and expand the WSO2 Category and once you expand it, you will see a set of sub categories and select Service Hosting. When you select that sub category, it will show a set of options. From these options select Axis2 Service Project and click on Next.



3. Now you will see the New Axis2 Service wizard and and in this wizard page you can select which approach you are going to use to implement the Web Service. Since we are going to implement from the Top Down approach, we use Create New Axis2 Web Service using WSDL file option. Then click on Next again.


4. In the next wizard page you can point to your WSDL file and you need to provide a name for your Axis2 Service Project. This Project name will be used as the Axis2 Service name as well.


5. You can click on the Browse button and it will open up the a File System Browser. From this browser you can select the WSDL file you want to create your web Service.


6. As we mentioned in the Step 4, you need to provide a project name for your Axis2 Service as well. you need to enter that name in the Project Name text box in this wizard page. Then click on Next button.


7. Now you will get the Axis2 Service Configuration options page. In this page you can configure Axis2 service related configurations such as Port Name, Binding Type, package for service, Service Style (Sync, Async), Unpacking, Wrapping, etc. We have included most widely used options in this wizard page. Once you set all the Service generation options, click on Finish button.



8. After you click on Finish, Axis2 Service generation task will be executed and it will create a new  Axis2 Project with a Axis2 Service related classes in your workspace. This Axis2 Service project will have the name you have provided in previous steps.


9. Apart from the classes, this Axis2 service generation process will generate the services.xml file which is the configuration file for the Axis2 Web Service as well. You can see that in the image below.


10. Now you have generated the Web Service classes and the services.xml configuration file, you can complete the web service operation logic implementations in these classes. Once you are done with the service operation logic implementations, you are able to generate the Deployable Axis2 Service Artifact (.aar) file from this project and deploy it in Axis2 Server. Please follow the section on "Deploy Web Service in Axis2" for more information.




Bottom Up Web Service Implementation

As we mentioned in a previous section, there are 2 well known approaches to implement Axis2 Web Services and in the previous section of this article we described about one of them, top Down Implementation. In this section we are going to discuss about the other approach which is well knwon as Bottom UP Web Service Implementation.

In this Bottom Up implementation, instead of implementing the Web Service operation logic at the end of the Top down approach, we first implement the Web Service operation logic in classes and then create the service from these POJO classes. Hence first step is to create the classes in the project and then implement web service operations in there.

In this section of this article we are going to discuss about creating an Axis2 web service from this approach. 

1. Follow step 1 and 2 of Top Down approach and select New Axis2 Project wizard from the new wizard list.

2. In the New Axis2 Project wizard, now we select first option, Create New Axis2 Service option. Then click on Next.




3. In the next wizard page, you need to enter few information related to your Axis2 web service such as Project Name which is again going to be your Axis2 Service name. Then you need to enter the package and the Class name for your POJO. 

These information is used to generate the Axis2 service and the Axis2 service configuration file, services.xml.

Once you complete these information click on Finish.




4. Now you will see that tool has created the new Axis2 project with the name you have entered and there is a Java Class with the full qualified name you have entered. This class is your POJO class and you need to define your Web Service operations in this class. Just like a normal java application you can do the implementations. 

Please keep in mind that Web Services are Stateless when you are implementing these operations. 




5. In the image below, you can see that we have implemented our web Service logic in the class tool has created. Once you are done with the implementation, you have successfully implemented your web Service. 




You can export the Axis2 Web service deployable archive (.aar) file from this project and deploy this Axis2 service in your Axis2 Web service engine. For more information look at the "Deploy Web Service in Axis2" section on this article.




Deploy Web Service in Axis2

Axis2 web services are normally exported as Axis2 Service Archives with the file extension "aar". So to deploy an Axis2 web service, you need to make aar file out of this Axis2 Service. WSO2 Developer Studio tools supports generating Axis2 services to deploy on aoache Axis2 Web service engine. as a part of these tools, it supports implementing Axis2 Service Archives as well. 

There are 2 methods to generate the aar file for your Axis2 web service with WSO2 Developer Studio. We are going to discuss those 2 methods in the next few sections.

1. Export the Axis2 Service Project from Developer Studio IDE
2. Build the Axis2 Service Project with Apache Maven build tool


Export the Axis2 Service Project from Developer Studio IDE

First approach to get a Axis2 Service Archive is to use the Artifact Export option in Developer Studio IDE. This mechanism allows you to generate the aar file for your Axis2 Service project to a selected location in your file system.

This section in this tutorial explains about using Artifact Export option in Developer Studio.

1. Right click on your Axis2 Service Project and Select Export Project as Deployable Archive option.




2. Now you will get the Export dialog and there you can select the Project you want to Export and the export location. Once you click on Finish, Developer Studio will generate the Axis2 Service Archive in the location you have indicated.






Build the Axis2 Service Project with Apache Maven build tool

Next approach to generate the Axis2 Service Archive without using Developer Studio is to use Apache Maven build tool. For each and every Axis2 Service Project, Developer Studio generates a Maven Project Object Model which is commonly known as Maven pom file. This file contains the maven related configuration for your project.

In this section of the article explains how to use Maven build tool to generate the Axis2 Service Archive. Please note that you need to install Apache Maven tool in your system prior to using this option.

1. Image below shows the Maven pom file generated for your Axis2 Service Project.


2. Go to the location of the project from your console and provide the command "mvn clean install" to generate the Axis2 Service Archive.



Now you have successfully generated the Axis2 Service Archive (aar) for your web service. You can copy this file to Axis2 hot deployment folder and your web service will be deployed in the Axis2 Web service engine.




If you have any question regarding the steps of this article, please feel free to make a comment or drop a mail to user@wso2.com mailing list. We are happy to assist you.

References:

Saturday, September 3, 2011

FA Community Shield 2011 - Epic Manchester United

FA community shield 2011 was taken place on 7th August 2011 at Wembley Stadium, London. This time the parties involved was Manchester United as usual and Manchester city. 

Manchester United started the game in a brilliant way and keep creating chances but failed to materialize any of 'em. Finally city got 2 goals out of nothing. 

In the second half United started where they left it in the first half and this time we managed to score and game on from there. Then Nani scored the best team goal I have seen for last few years by Manchester United. Cleverly was instrumental in attacking and in the midfield. Finally Nani scored the injury time winner to mark a yet another remarkable comeback win for Manchester United. 

Official FA Highlughts of the match:


Official FA Pitchside highlights of the match:


Glory Glory Man Utd! #MUFC #RedDevils 
Locations of visitors to this page