Main

February 27, 2008

Steve Vinoski on REST, Web Services, and Erlang

Just finished the video of Interview with Steve Vinoski by Stefan Tilkov. Highly recommend to watch it if you read Vinoski's blog constantly. As Stefan promised, InfoQ has a nice new video infrastructure now. The two-direction synchronization of video and transcript is cool.

January 17, 2008

Say thanks to Mark

Mark Baker is one of the Canadians in my list of "FIELDING HAS A POSSE". You can find his name in many old discusses about "REST VS SOAP" topics at various blogs and Yahoo SOA and REST discussion groups. Maybe he is a little tired of that now. But I agree that "the war really has been won" for him. He had already broadcast the ideas to many like me. And now I try to tell others the message when I am learning it. Thank you, Mark.

January 15, 2008

"Grid computing zone is being retired"

Thank you for your continued interest in grid computing and for looking to developerWorks to keep you up to date. The Grid computing zone is no longer being updated because the zone is being discontinued.
from IBM developerWorks

January 08, 2008

Slides for TRLabs SOA workshop

The TRLabs just organized a successful workshop on SOA. I gave a short presentation about REST there. Here is the slides.

November 29, 2007

Jetty 6 authentication by configuration XML without web.xml

I spent about a week for porting of NetKernel 3.3 from Jetty 5 to Jetty 6. It is done and I am testing the non-blocking IO (NIO) of Jetty 6 together with asynchronous processing feature of NetKernel. I also figure out how to configure Jetty 6 security in the configuration XML file. From the Jetty document about Realm, the security of an application can be configured in web.xml. However, there is no web.xml in my case, when the request received by Jetty be handled by a specific handler, which will call another handler-like facility for processing. The solution for Jetty 5 does not work for Jetty 6 for this case, since the corresponding API's of org.mortbay.jetty.Server are removed. I got some hint from the document about how to configure security for embedded Jetty. However, it is still about a web application via class WebAppContext. Then I wondered if org.mortbay.jetty.security.SecurityHandler will help (it has an interesting name). Yes, it is. The hack is done with a longer XML file creating a HashUserRealm and a ConstraintMappings. See the details in the following snippet.
<Set name="handler">
  <New id="Handlers"
  class="org.mortbay.jetty.handler.HandlerCollection">
    <Set name="handlers">
      <Array type="org.mortbay.jetty.Handler">
        <Item>
          <New id="BackendSecurity"
          class="org.mortbay.jetty.security.SecurityHandler" />
        </Item>
        <Item>
          <New id="BackendNetkernel"
          class="org.ten60.transport.jetty.HttpHandler" />
        </Item>
      </Array>
    </Set>
  </New>
</Set>
<!-- =========================================================== -->
<!-- Configure BackendSecurity                                   -->
<!-- Add a Realm and a ConstraintMappings to it. See             -->
<!-- http://docs.codehaus.org/display/JETTY/How+to+Configure+Security+with+Embedded+Jetty -->
<!-- =========================================================== -->
<Ref id="BackendSecurity">
  <Set name="UserRealm">
    <New class="org.mortbay.jetty.security.HashUserRealm">
      <Set name="name">Test Realm</Set>
      <Set name="config">
      <SystemProperty name="bootloader.basepath"
      default=".." />/etc/realm.properties</Set>
    </New>
  </Set>
  <Set name="AuthMethod">DIGEST</Set>
  <Set name="ConstraintMappings">
    <Array type="org.mortbay.jetty.security.ConstraintMapping">
      <Item>
        <New id="BSConstraintMapping"
        class="org.mortbay.jetty.security.ConstraintMapping">
          <Set name="Constraint">
            <New class="org.mortbay.jetty.security.Constraint">
              <Set name="Name">allSite</Set>
              <Set name="Roles">
                <Array type="java.lang.String">
                  <Item>admin</Item>
                </Array>
              </Set>
              <Set name="Authenticate">true</Set>
            </New>
          </Set>
          <Set name="PathSpec">/</Set>
        </New>
      </Item>
    </Array>
  </Set>
</Ref>

November 27, 2007

NetKernel backend securing by using Jetty realm

NetKernel uses Jetty for HTTP transport. By default, it opens two port, one for services, and one for management. The fresh installation does not secure the management port, the backend. However, you can configure it to do that by using HTAccessHandler of Jetty as described in http://www.1060.org/forum/topic/265/2 . I encountered problems when doing like that on Window system. So I tried to using Realm of Jetty to do that, and it works. Here is the configuration file.
<?xml version="1.0" encoding="utf-8"?>
<httpConfig>
  <!--
        *****************
        Jetty HTTP Server
        *****************
        -->
  <Configure class="org.mortbay.jetty.Server">
    <!--
                ***********
                Add Listeners
                ***********
                -->
    <!--Start addlisteners-->
    <!--Add SocketListener with default port 1060-->
    <Call name="addListener">
      <Arg>
        <New class="org.mortbay.http.SocketListener">
          <Set name="Port">1060</Set>
          <Set name="MinThreads">5</Set>
          <Set name="MaxThreads">50</Set>
          <Set name="MaxIdleTimeMs">30000</Set>
          <Set name="LowResourcePersistTimeMs">5000</Set>
        </New>
      </Arg>
    </Call>
    <!--End addlisteners-->
    <Call name="addRealm">
      <Arg>
        <New class="org.mortbay.http.HashUserRealm">
          <Arg>Admin Realm</Arg>
          <Put name="admin">yourpasshere</Put>
          <Call name="addUserToRole">
            <Arg>admin</Arg>
            <Arg>server-administrator</Arg>
          </Call>
        </New>
      </Arg>
    </Call>
    <!--
                ************
                Add Server Contexts
                ************
                -->
    <!--Default context at root / -->
    <Call name="addContext">
      <Arg>/</Arg>
      <Set name="realmName">Admin Realm</Set>
      <Set name="authenticator">
        <New class="org.mortbay.http.BasicAuthenticator" />
      </Set>
      <Call name="addHandler">
        <Arg>
          <New class="org.mortbay.http.handler.SecurityHandler" />
        </Arg>
      </Call>
      <Call name="addSecurityConstraint">
        <Arg>/</Arg>
        <Arg>
          <New class="org.mortbay.http.SecurityConstraint">
            <Arg>Admin</Arg>
            <Arg>server-administrator</Arg>
          </New>
        </Arg>
      </Call>
      <Call name="addHandler">
        <Arg>
          <New class="org.ten60.transport.jetty.HttpHandler">
            <Set name="Name">BackendHTTPTransport</Set>
          </New>
        </Arg>
      </Call>
    </Call>
  </Configure>
</httpConfig>
Jetty also provides HashUserRealm that reads a property file in which the user names and passwords can be specified.

April 27, 2007

Interesting panel records from TSSJS2007

TheServerSide has posted records of three interesting panel in TSSJS2007. They are worth watching.
SOA Technology Panel - TSSJS 2007
The Next Application Platform - TSSJS 2007
High Performance Computing Panel - TSSJS 2007

The keywords that are talked are SOA, EDA, EAI, high performance infrastructure, ESB, Ajax, mashup, management, and scalability(scale out).

March 20, 2007

Who understands the links?

Stefan considered that
as long as Web services don’t actually add something more to the Web than a single endpoint per service, they are not “on the Web”, but are indeed dead ends.
in the post of Links are for Humans Only? I Don't Think So. I agree with his opinion. And it reminders me a question appearing in my mind last night. Why is it more difficult to collect the visit statistics of an XML feed than the web page of the same resource when there is no mean to access the server log? For web pages, just a snippet of script can make the visit recorded by a service on the web. But we cannot put the script in XML feeds, because the feed readers will do nothing about the script. In fact, the web browsers automate this browser to machine interaction described by the script. If the scripts are removed from web pages, then what left are those for representation in web browsers. The links are among those representations. So who understands the links? Here is a paragraph from Fielding's paper:
Semantics are a byproduct of the act of assigning resource identifiers and populating those resources with representations. At no time whatsoever do the server or client software need to know or understand the meaning of a URI—they merely act as a conduit through which the creator of a resource (a human naming authority) can associate representations with the semantics identified by the URI. In other words, there are no resources on the server; just mechanisms that supply answers across an abstract interface defined by resources. It may seem odd, but this is the essence of what makes the Web work across so many different implementations.
For sure, the human can understand the links. However, they may be cheated by what they see on the page. They need to take the risk by clicking them. The web applications can also try to understand the links, although they do not need to. This needs special prescript of their functions. As Stefan pointed out, this can also be done in XML for machine to machine interaction, e.g. Atom publishing. The condition is that the application accessing the XML knows Atom protocol. Similarly, the web services supporting WS-Addressing is not dead ends, they can reply with 'links' to other services. Again, the condition is that the service consumers know WS-Addressing.

March 06, 2007

About the "Web of Services for Enterprise Computing" workshop

Thanks to Steve's Post, I read most of the position papers and slides presented in the workshop. It is interesting to know what people from both REST and WS sides think about services and the Web. Eric has posted two summaries about the workshop. Paul posted a summary on his blog as well.

March 01, 2007

REST vs ?

It is nice to read the blogs that I have missed for almost two months and write something on my own. I found many guys raised another tons of discussion about REST and web services. As I remember, they compared REST and SOAP at first, then REST and web services, and then REST and SOA. I do not know what is the next to be compared with REST.

Many like to predict the technical changes in the coming year. In his post, Carlos predicted that

"WS-* and its corresponding specifications like SOAP and WSDL will be declared dead by year end."

It is interesting that the technology is considered hopeless when the developers of SOAP engines are struggling to improve its performance. What I hope is by the end of 2007 the debate about REST vs ? will stop. Obviously, the "dead of web services" cannot assure that.

Mark Nottingham listed the "real and imagined issues" here. I agree with most of them. However, I still think that the following is really an issue when interpreting the REST as the Web technological style.
"False Choice: Machines vs. People
There’s an insistence from some quarters that somehow, HTTP and REST are only good for people sitting behind browsers. I think that this has been solidly and obviously disproven, and find it difficult to believe that such continued, vigorous assertions are anything other than FUD. *shrug*"

Why? It is because "one of the deeper REST constraints is using hypertext as the engine of application state". The Web is the space of information, or the virtual state machine of web pages. Mark Baker believes "the Web, since its inception, has always been about services, and therefore that “Web services” are redundant." Of course, that depends on how to define the "service". The success of Web results from its architecture, REST, or more concretely, client-server, request-response messaging, and loose-coupling by HTML, XML, and widely accepted scripts. To make all this happen, the browsers are the heroes in the background. The browsers are the agents working for people. People with the browsers trigger the state transfer of the Web as a virtual state machine. In the service scenarios, every service can trigger the state transfer of the virtual state machine of services. If a long long URL with all the request information encoded inside is tolerant and no MEP's other than request-response are needed, fine, let's just call it "services" not "web services", and make it just like a web page.

February 28, 2007

Intense discussion about performance of Java SOAP stacks

Stefan Tilkov posted an article about the discussion about Java SOAP stack performance on InfoQ. It seems that some developers of the three major Java SOAP stack projects, Axis2, Xfire, and JAX-WS, are really concerned about the topic. Although part of it was not so comfortable, the discussion can still help to improve the development of those projects. I think Steve did tell the essentials of SOAP performance that developers need to care about.

I have tried to learn all the three frameworks. To me, the learning curve and tools are also important for an open-source project to be accepted by the developers besides code reliability.

October 24, 2006

IBM's patents

Just heard that IBM Files Patent Infringement Lawsuits Against Amazon.com. I am really curious to know these patents refer to what applications Amazon has done. The following is my guess:
"Presenting Applications in an Interactive Service" -- web application or web services or Amazon E-Commerce Service (ECS)?
"Storing Data in an Interactive Network" -- database or Amazon Simple Storage Service (Amazon S3)?
"Presenting Advertising in an Interactive Service" -- all the Ads on the web?
"Adjusting Hypertext Links with Weighted User Goals and Activities" -- personalized recommendations?
"Ordering Items Using an Electronic Catalogue" -- the whole Amazon website?

September 29, 2006

A tutorial for new axis2 users

I just posted a beginner tutorial of axis2. Two simple web service examples are discussed. The source code is here.

September 06, 2006

Web services and utility computing meet at Amazon

Amazon web services has published more and more items based on the ideas of virtualization and utility computing. It seems that Amazon will virtualize every piece of IT and make them as utility services: from storage (Amazon Simple Storage Service (Amazon S3)) to messaging bus (Amazon Simple Queue Service (Amazon SQS)) to application hosting (Amazon Elastic Compute Cloud (Amazon EC2)). Even the human resource is virtulized into Amazon Mechanical Turk as "Artificial Artificial Intelligence". The idea is really interesting and crazy. I find reward prices for most jobs in the "Artificial Artificial Intelligence" machine are ridiculous. It is just a test now, but may become popular in the future because of divers human resource markets in the world.

The concepts of virtulization and utility computing have been around for couples of years, Amazon does a great job to realize them in B2C market.

August 29, 2006

More debates coming about REST and WS

In a talk between Mark Baker and Stefan Tilkov published on InfoQ titled "Give it a REST: Mark Baker on Web Services", Mark Baker says that

Web services build upon HTTP, but they don't build upon the Web. The Web uses HTTP as an application contract which enables the loosely coupled exchange of documents between applications, while Web services uses HTTP as a bit pipe - as a transport protocol. Doing the latter instead of former means that you're starting from scratch, and not taking advantage of the existing network effects in the Web.

This is new for me about the difference between the web and another "web" in web services. I consider the web to be a space of information, and the end applications of web so far are agents(web browsers) with humans behind them. So how about the space of services? I imagine most agents(services) in that space are autonomous, and they are not directly controlled by the human users. In the case that most current services, e.g. google.com, amazon.com, are targeting human customers, there is no big difference between the space of information and the space of services. However, I suspect that there will be in the future.

I agree with his point that SOAP is essentially a generic XML envelope. However, I cannot see what to replace the roles of WSDL and UDDI for service description and discovery. My opinions have a root in the study of agent-based software systems.

His suggestion about starting REST is

It's technically possible, but from what I've seen of Web services toolkits (even those that claim to "support REST"), there's a very good chance that it'll be more trouble than it's worth. My advice would be to start with mature client and server Web frameworks in your language of choice, and to read up on what others are doing with REST/POX/XML-HTTP style services as replacements for traditional "Web services". Then apply that to the simplest possible problem you have, and once you've conquered that, move on to more complex problems.

Again, the assumption of this method is that services are just part of the web.

March 19, 2006

Load-balance Jetty using mod_proxy

Here are two reference articles for this topic: one from Jetty and the other by PierFumagalli. Although they were developed before the release of Apache Httpd 2.2, most of the configuration can still be applied to the current version.

March 02, 2006

Using mod_proxy and mod_proxy_balancer to cluster and load-balance Tomcat application servers

I just updated the Apache HTTP server on my Window box from 2.0.54 to the current 2.2.0. Release 2.2.0 includes many new features, among which mod_proxy and its extension for load balancing, mod_proxy_balancer are most interesting to me as replacements for load balancing using mod_jk. Graham King has a good article about how to setup mod_jk/mod_jk2 for clustering Tomcat using Apache. Now he also changed to the new mod_proxy and mod_proxy_balancer, and say goodbye to mod_jk. To setup mod_proxy_balancer in 2.2.0 is quite straightforward and you can refer to mod_proxy_balancer document and Graham’s post.

To test the load balancing of Tomcat, I have to start several Tomcat instances on my Windows system. I found some hints about running Tomcat instances on the same system from the Web, but they did not help me so
much. The method I figured out is as follows:


  1. Download the zip version of core release of Tomcat, and unzip it to a directory where will be the Home of one Tomcat instance, say c:\tomcat0. Read the RUNNING.txt in the directory. The “Advanced Configuration - Multiple Tomcat Instances” part will help you a lot during the further configurations.

  2. Download the Tomcat Native library and put it in the \bin if you want to improve Tomcat’s performance.

  3. In server.xml, change the ports for connections to avoid conflict with other applications including other tomcat instances. Add jvmRoute=”tomcat0” into the line of < Engine name="Catalina"
    defaultHost="localhost" > to specify the route required in < proxy/ > entry of httpd.conf.

  4. At the beginning of startup.bat and shutdown.bat, set both CATALINA_HOME and CATALINA_BASE to be c:\tomcat0.

  5. Copy the folder c:\tomcat0 to c:\tomcat1 to create another Home for an instance, and change its server.xml, startup.bat and shutdown.bat correspondingly.


Now you can run startup.bat in c:\tomcat0 to get the Tomcat instance of tomcat0, and the same for instance of tomcat1, and so on.

I have tried both ajp and http connections to forward the request from Apache proxy to Tomcat instances, and using JMeter to test the performance of both options. Unfortunately, ajp always triggers exceptions related to socket connections. My Tomcat log is quite similar to those catched when using mod_jk . I am not sure if that mean we cannot avoid the bugs in org.apache.jk package even if switching from mod_jk to mod_proxy_ajp. Therefore I suggest to use http to connect Tomcat with Apache other than ajp at this moment.

November 25, 2005

Solution for listServices.jsp of Axis 2 returning errors

The errors indicate that "root cause java.lang.NoClassDefFoundError: org.apache.ws.security.handler.WSHandler". The problem is caused by XPath lib. Download and install the xalan-j lib of 2.6.0, and that will be fixed. You can find detailed information at jira.

October 14, 2004

Big Is Beautiful?

The size of my Hotmail email box has been increased to 250M as a free service promotion. The Yahoo! Mail offers 100M email storage for free. Maybe both Microsoft and Yahoo have felt the pressure from Gmail that offers 1G free storage space powered by Google. The competition had caused some pain for Hotmail.

The philosophy represented by Gmail is that the users need to SEARCH their emails but not to organize them from time to time. Gmail is still at Beta version, and let’s see the new features that Google will implement.

About me

Categories

Feeds

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.21