As part of Axis2/OSGi integration process, we have implemented the basic facility to expose an OSGi service as a Web service. Still some of the advanced functionalities related to this function is in development stage and we will update the progress as we go alone.
In order to facilitate this, register OSGi service with Directory object with name/value pair "org.apache.axis2.osgi.ws/name of WS". This will create an AxisService with default Axis2 properties. This includes message receivers to be RPC*, default schema/targetNamespace generation etc.
You can test this out from here. Follow "axis2_osgi_integration.pdf" to set up the environment.
The example has registered a simple Calculator POJO as an OSGi service and exposed it as a WS. The name/value pair for this instance is "org.apache.axis2.osgi.ws/myCal". Then one will be able to observe
wsdl -> http://localhost:8080/services/myCal?wsdl
wsdl2 -> http://localhost:8080/services/myCal?wsdl2
A request -> http://localhost:8080/services/myCal/add?x=10&y=10
Monday, August 18, 2008
Winners & Losers
01. The Winner is always part of the answer;
The Loser is always part of the problem.
02. Winners always thrive in chaos;
Losers always look for excuses.
03. The Winner says, "Let me do it for you";
The Loser says, "That's not my job.";
04. The Winner sees an answer for every problem;
The Loser sees a problem for every answer.
05. The Winner says, "It may be difficult but it is possible";
The Loser says, "It may be possible but it is too
difficult."
06. When a Winner makes a mistake, he says "I was wrong";
When a Loser makes a mistake, he says "It wasn't my fault."
07. A Winner makes commitments;
A Loser makes promises.;
08. Winners have dreams;
Losers have schemes.
09. Winners suggest and take ownership;
Losers complain and pass the buck.
10. Winners say, "I must do something";
Losers say, "Something must be done."
11. Winners are a part of the team;
Losers are apart from the team.
12. Winners see the gain;
Losers see pain.
13. Winners see possibilities;
Losers see problems.
14. Winners believe in win/win;
Losers believe for them to win someone has to lose.
15. Winners are far sighted and see the potential;
Losers are short sighted and see the past.;
16. Winners learn from mistakes;
Losers keep repeating the same mistakes.
17. Winners choose what they say;
Losers say what they choose.
18. Winners say "WE did it";
Losers say "I did it".
19. Winners use hard arguments, but soft words;
Losers use soft arguments, but hard words.;
20. Winners always think "There is something to learn from
others";
Losers always think "I know all and no one should try to
teach me".
21. Winners stand firm on values and objectives but compromise on
petty things;
Losers stand firm on petty things but compromise on values
and objectives.
22. Winners follow the philosophy of empathy "Don't do to others
what you don't want them to do to you";
Losers follow the philosophy "Do it to others before they
do it to you."
23. Winners make it happen;
Losers let it happen.
24. Winners always look out for challenges;
Losers always challenge others.
25. Winners share knowledge and build teams.
Losers hang on to knowledge and glorify themselves.
The Loser is always part of the problem.
02. Winners always thrive in chaos;
Losers always look for excuses.
03. The Winner says, "Let me do it for you";
The Loser says, "That's not my job.";
04. The Winner sees an answer for every problem;
The Loser sees a problem for every answer.
05. The Winner says, "It may be difficult but it is possible";
The Loser says, "It may be possible but it is too
difficult."
06. When a Winner makes a mistake, he says "I was wrong";
When a Loser makes a mistake, he says "It wasn't my fault."
07. A Winner makes commitments;
A Loser makes promises.;
08. Winners have dreams;
Losers have schemes.
09. Winners suggest and take ownership;
Losers complain and pass the buck.
10. Winners say, "I must do something";
Losers say, "Something must be done."
11. Winners are a part of the team;
Losers are apart from the team.
12. Winners see the gain;
Losers see pain.
13. Winners see possibilities;
Losers see problems.
14. Winners believe in win/win;
Losers believe for them to win someone has to lose.
15. Winners are far sighted and see the potential;
Losers are short sighted and see the past.;
16. Winners learn from mistakes;
Losers keep repeating the same mistakes.
17. Winners choose what they say;
Losers say what they choose.
18. Winners say "WE did it";
Losers say "I did it".
19. Winners use hard arguments, but soft words;
Losers use soft arguments, but hard words.;
20. Winners always think "There is something to learn from
others";
Losers always think "I know all and no one should try to
teach me".
21. Winners stand firm on values and objectives but compromise on
petty things;
Losers stand firm on petty things but compromise on values
and objectives.
22. Winners follow the philosophy of empathy "Don't do to others
what you don't want them to do to you";
Losers follow the philosophy "Do it to others before they
do it to you."
23. Winners make it happen;
Losers let it happen.
24. Winners always look out for challenges;
Losers always challenge others.
25. Winners share knowledge and build teams.
Losers hang on to knowledge and glorify themselves.
Sunday, August 17, 2008
Welcome to Miami !
It has been almost three weeks since I have arrived to Miami, US to pursue my graduate studies in computer science in Department of Computer Science at University of Miami. If I may honest with you, these three weeks have been the most toughest and sort of expensive weeks of my entire life so far and it seems that the next week is also going to be more tough with the tropical storm Fay.
So when I landed in Miami three weeks ago, I had succumbed with a kidney stone, one of the most painful illnesses one could ever have. Since I was being a kidney stone patient for almost 2/3 years, I kinda new what hit me this time. No one to blamed but me because I don't drink enough WATER. So I started drinking plenty of water but the pain continued to persist throughout the week and next week. Normally from my experience, this excruciating pain should go away after 9/10 days but this time it didn't and I had no pain medicine with me. So finally I went to my universities health center to check this out and they immediately transferred me to University of Miami Hospital ER to CT my kindness and appendix. Thank god that I was negative for appendix but the CT showed that I had a swamp of particles in the kidney which was ready to pass down the narrow tube (urethra) on its way to my bladder, which was going to cause more pain. So I had given Vicodin, one of the most powerful pain medicine you could ever find on this plant. Pills were great, they did what they supposed to do. I believe my student health insurance covered the costs involved but I have to wait and see the report. It seems that the pain is kinda gone now but not completely yet that's encouraging. So guys/girls, if you are reading this, don't take it for granted, just drink enough WATER.
Officially I stared the graduate program on 15th August 2008. I'm not quite decided what should I do for my grad studies yet. I wanted to do distributed systems but there are plenty of research areas and I hope time will tell the answer. Anyhow I needed a transportation to go the Uni which is almost four miles away from my apartment. Public transportation in this area suck worse and quite expensive. Hence, I bought my first vehicle to go to Uni, which cost me $ 70 :). I haven't ridden a cycle for more than 15 years and this is going to be quite an experience and I love it.

To add to the excitement, National Oceanic and Atmospheric Administration has predicted that the tropical storm Fay is going to hit Miami big time on Tuesday at around 2.00 pm, specially Miami-Dade county where I live in. As this is not a hurricane, residence here believe that this storm is not going to do much damage and I hope it will stay that way. So, if I don't blog at the end of this week, there is a probability that I might have blown away with the gusty winds :). Anyway I hope that this will not going to be too serious.
Miami is a pretty exciting place and I will try to share my experiences, hopefully stay alive and healthy and write to you guys. To get the spirit flowing, listing to "Miami" by Will Simith ;).
Guys, ***c pain, I did went to South beach and the place really bringin the heat, you gotta see to believe it!.
So when I landed in Miami three weeks ago, I had succumbed with a kidney stone, one of the most painful illnesses one could ever have. Since I was being a kidney stone patient for almost 2/3 years, I kinda new what hit me this time. No one to blamed but me because I don't drink enough WATER. So I started drinking plenty of water but the pain continued to persist throughout the week and next week. Normally from my experience, this excruciating pain should go away after 9/10 days but this time it didn't and I had no pain medicine with me. So finally I went to my universities health center to check this out and they immediately transferred me to University of Miami Hospital ER to CT my kindness and appendix. Thank god that I was negative for appendix but the CT showed that I had a swamp of particles in the kidney which was ready to pass down the narrow tube (urethra) on its way to my bladder, which was going to cause more pain. So I had given Vicodin, one of the most powerful pain medicine you could ever find on this plant. Pills were great, they did what they supposed to do. I believe my student health insurance covered the costs involved but I have to wait and see the report. It seems that the pain is kinda gone now but not completely yet that's encouraging. So guys/girls, if you are reading this, don't take it for granted, just drink enough WATER.
Officially I stared the graduate program on 15th August 2008. I'm not quite decided what should I do for my grad studies yet. I wanted to do distributed systems but there are plenty of research areas and I hope time will tell the answer. Anyhow I needed a transportation to go the Uni which is almost four miles away from my apartment. Public transportation in this area suck worse and quite expensive. Hence, I bought my first vehicle to go to Uni, which cost me $ 70 :). I haven't ridden a cycle for more than 15 years and this is going to be quite an experience and I love it.
To add to the excitement, National Oceanic and Atmospheric Administration has predicted that the tropical storm Fay is going to hit Miami big time on Tuesday at around 2.00 pm, specially Miami-Dade county where I live in. As this is not a hurricane, residence here believe that this storm is not going to do much damage and I hope it will stay that way. So, if I don't blog at the end of this week, there is a probability that I might have blown away with the gusty winds :). Anyway I hope that this will not going to be too serious.
Miami is a pretty exciting place and I will try to share my experiences, hopefully stay alive and healthy and write to you guys. To get the spirit flowing, listing to "Miami" by Will Simith ;).
Guys, ***c pain, I did went to South beach and the place really bringin the heat, you gotta see to believe it!.
Tuesday, July 22, 2008
Everything can be a bundle
One of the demanding aspect of server side OSGi is to reuse the existing classic jar files as bundles. The other aspect of the spectrum is to diagnose these bundles. Out of the lot BND (Bundle Tool) tool from Peter Kriens helps you to create and diagnose OSGi R4 bundles.
The key features are,
1. Show the manifest and JAR content of a bundle
2. Wraps a JAR as a bundle
3. Create a bundle from a specification and a classpath
4. Verifying the validity of the manifest entries
This tool can be used as a,
1. Command line tool
2. Eclipse plugin
3. Maven plugin
4. Ant plugin
You will find more information about this tool here.
Apache Felix folks has written a Maven2 plugin based on BND called maven-bundle-plugin to create bundles.
You'll find a really cool article on usage of BND is available here.
The key features are,
1. Show the manifest and JAR content of a bundle
2. Wraps a JAR as a bundle
3. Create a bundle from a specification and a classpath
4. Verifying the validity of the manifest entries
This tool can be used as a,
1. Command line tool
2. Eclipse plugin
3. Maven plugin
4. Ant plugin
You will find more information about this tool here.
Apache Felix folks has written a Maven2 plugin based on BND called maven-bundle-plugin to create bundles.
You'll find a really cool article on usage of BND is available here.
Monday, July 14, 2008
Maven 2 GPG Plugin
Maven 2 GPG Plugin, allows to sign attached artifacts with GunPG. One of the tedious processes involved in releasing a project is to sign its artifacts. Some of the releases might contain 10-15 artifacts. Ex: WSO2 WSAS etc. So in order to get the release process smoother, one could just need to add the following plugin into the parent pom.xml,
<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-gpg-plugin</artifactid>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
The latest version of this plugin is 1.0-alpha-4 as at 2007-09-28.
Then using "mvn clean deploy" will sign the artifacts in addition to md5 & sha1. It's advisable if the prior plugin be added in a "profile" section. Then only at the release time, "asc" files are generated. Trust me, when you have A LOT OF artifacts to be signed, above plugin is a life saver.
<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-gpg-plugin</artifactid>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
The latest version of this plugin is 1.0-alpha-4 as at 2007-09-28.
Then using "mvn clean deploy" will sign the artifacts in addition to md5 & sha1. It's advisable if the prior plugin be added in a "profile" section. Then only at the release time, "asc" files are generated. Trust me, when you have A LOT OF artifacts to be signed, above plugin is a life saver.
Wednesday, July 9, 2008
Partial solution to TCCL problem in OSGi
One of perennial problem that OSGi uses asked from mailing lists is to resolved the problem of TCCL. As I have mentioned in the blog post "OSGi and TCCL dilemma", there is no proper definition is available in OSGi R4.1 specification for TCCL.
On the other hand Eclipse Equinox OSGi implementation has taken steps to prevent this problem with the invent of ContextFinder (CF). When the framework starts, Equinox sets the framework TCCL to CF. Hence, all the bundles spawn from this framework will set its TCCL to CF. CF finds classes and resources from the classloader associate with the current method of the execution stack. (java.lang.SecurityManager#getClassContext). This is not the complete answer to the problem, but it will solve most of the common scenarios. Thus, it's very easy to use this concept and apply to other OSGi implementations as well, such as Apache Felix.
WSO2 is align with producing products that are OSGi enabled. The underline infrastructure of these products uses a product called "Carbon", which is an OSGi wrapper powered with either Eclipse Equinox or Apache Felix and provide a
Web Services infrastructure powered by Apache Axis2. Carbon uses the "servletbridge" design principle to bridge OSGi and Servlet container. Hence, Carbon is one such infrastructure that harness the benefits of server-side OSGi. Though Carbon defaults to Equinox and Felix OSGi implementations, it has give a very powerful API to integrate other OSGi implementations as well.
You will be able to find the source code from "svn co https://svn.wso2.org/repos/wso2/trunk/carbon".
Nice thing about Carbon is that it can switch between Equinox or Felix based on users preference. It can switched to any other OSGi implementations that is registered with too. Carbon uses the prior mentioned ContextFinder principle to solve the TCCL problem and I think it's a very fair assumption until OSGi specification mandate on the TCCL.
One of the very first product that is scheduled to be released on this month on top of the prior mentioned infrastructure is "Data Services Solution", which is a complete solution for data services via web services.
On the other hand Eclipse Equinox OSGi implementation has taken steps to prevent this problem with the invent of ContextFinder (CF). When the framework starts, Equinox sets the framework TCCL to CF. Hence, all the bundles spawn from this framework will set its TCCL to CF. CF finds classes and resources from the classloader associate with the current method of the execution stack. (java.lang.SecurityManager#getClassContext). This is not the complete answer to the problem, but it will solve most of the common scenarios. Thus, it's very easy to use this concept and apply to other OSGi implementations as well, such as Apache Felix.
WSO2 is align with producing products that are OSGi enabled. The underline infrastructure of these products uses a product called "Carbon", which is an OSGi wrapper powered with either Eclipse Equinox or Apache Felix and provide a
Web Services infrastructure powered by Apache Axis2. Carbon uses the "servletbridge" design principle to bridge OSGi and Servlet container. Hence, Carbon is one such infrastructure that harness the benefits of server-side OSGi. Though Carbon defaults to Equinox and Felix OSGi implementations, it has give a very powerful API to integrate other OSGi implementations as well.
You will be able to find the source code from "svn co https://svn.wso2.org/repos/wso2/trunk/carbon".
Nice thing about Carbon is that it can switch between Equinox or Felix based on users preference. It can switched to any other OSGi implementations that is registered with too. Carbon uses the prior mentioned ContextFinder principle to solve the TCCL problem and I think it's a very fair assumption until OSGi specification mandate on the TCCL.
One of the very first product that is scheduled to be released on this month on top of the prior mentioned infrastructure is "Data Services Solution", which is a complete solution for data services via web services.
Labels:
Axis2,
Carbon,
ContextFinder,
Equinox,
Felix,
Servlet Bridge
Saturday, July 5, 2008
Light weight, OSGi based, Axis2 powered, web services application server in 5 minuets
Few days back I blogged about "Embed Eclipse Equinox in a Servlet Container". Let's extend this idea a little bit more to write your own light weight, OSGi based, Axis2 powered, web services application server.
There is an ongoing effort to extend Axis2 Web Services engine to deploy as a bundle in an OSGi environment. The purpose of this extension is to allow deployed bundles to provide services and modules which will be recognized by OSGi based Axis2 engine and deploy them.
Let's create the light weight, OSGi based, Axis2 powered, web services application server using Eclipse Equinox OSGi implementation and Apache Tomcat.
1. Download Apache Tomcat
2. Download bridge.war from Eclipse Equinox.
3. Download commons logging (org.eclipse.equinox.common_3.3.0.v20070426.jar) bundle from Eclipse Equinox.
4. Copy the downloaded bridge.war to Apache Tomcat webapps directory
5. svn co https://svn.apache.org/repos/asf/webservices/axis2/scratch/java/saminda/osgi_test osgi_test
6. Go to osgi_test directory and type "mvn clean install -U". You need Maven2 build system.
7. Go to osgi_test/distribution/target directory and unzipped distribution-1.0.0.zip.
8. Copy all the bundles from distribution-1.0.0/plugin folder to/webapps/bridge/WEB-INF/eclipse/plugins and copy commons logging bundle too.
9. Restart Tomcat
10. On the osgi> command prompt start all bundles except fragment host bundles.
11. http://localhost:8080/bridge/services/Version?wsdl
http://localhost:8080/bridge/services/Version?wsdl2
http://localhost:8080/bridge/services/Version/getVersion
You have your personal light weight, OSGi based, Axis2 powered web services application server.
There is an ongoing effort to extend Axis2 Web Services engine to deploy as a bundle in an OSGi environment. The purpose of this extension is to allow deployed bundles to provide services and modules which will be recognized by OSGi based Axis2 engine and deploy them.
Let's create the light weight, OSGi based, Axis2 powered, web services application server using Eclipse Equinox OSGi implementation and Apache Tomcat.
1. Download Apache Tomcat
2. Download bridge.war from Eclipse Equinox.
3. Download commons logging (org.eclipse.equinox.common_3.3.0.v20070426.jar) bundle from Eclipse Equinox.
4. Copy the downloaded bridge.war to Apache Tomcat webapps directory
5. svn co https://svn.apache.org/repos/asf/webservices/axis2/scratch/java/saminda/osgi_test osgi_test
6. Go to osgi_test directory and type "mvn clean install -U". You need Maven2 build system.
7. Go to osgi_test/distribution/target directory and unzipped distribution-1.0.0.zip.
8. Copy all the bundles from distribution-1.0.0/plugin folder to
9. Restart Tomcat
10. On the osgi> command prompt start all bundles except fragment host bundles.
11. http://localhost:8080/bridge/services/Version?wsdl
http://localhost:8080/bridge/services/Version?wsdl2
http://localhost:8080/bridge/services/Version/getVersion
You have your personal light weight, OSGi based, Axis2 powered web services application server.
Subscribe to:
Posts (Atom)