Arch2Arch Tab BEA.com

Andy Piper's Blog

Andy Piper Andy Piper's Homepage
Andy Piper is a Senior Staff Engineer in the WebLogic Server advanced development group. Andy has worked on WebLogic Server for the past 6 years and is responsible for many features and innovations. His interests include distributed systems, object-oriented design and development, high availability and open source. Andy holds a PhD and bachelor's degree from Cambridge University, UK.

SpringSource announces SpringSource Application Platform (S2AP)

Posted by andypiper on May 8, 2008 at 11:24 AM | Permalink | Comments (1)

So Billy Newport beat me to it, blogging about SpringSource's (formerly Interface21) application platform. Nevertheless I thought I would share a few thoughts on this since BEA has been shipping a lightweight application platform for a year now.

First of all congratulations to all the folk at SpringSource on the release! I know many of them personally and they are all great guys, great engineers and forward thinking innovators. Shipping an application platform is the next natual evolution for them and I look forward to their release stimulating further innovation from all the vendors in this space.

Now of course I don't personally see this as innovation. Event Server (WLEvS) is a lightweight application platform built using OSGi, Spring and Spring-DM. Indeed, as someone pointed out on TSSJ, BEA has been an active contributor to the Spring-DM project - and we have been using it in BEA products - since its inception. Spring-DM is central to WLEvS, it represents the programming model for WLEvS developers, much like it does in S2AS, and we have extended it using standard Spring hooks. Likewise we have a deployment model based on OSGi bundles, moniitoring, logging, management - the list goes on and I won't bore you with all the URLs. So you can see why claims that S2AS is ground-breaking in some way leave me a little nonplussed. Even OSGi-based LTW, which I think is one of the truly cool features of S2AS, has been around for a while. And the TSSJ comment that accessing OSGi services from webapps was a game-changing innovation, we have been doing for two years now! (We actually found that publishing OSGi services inside a webapp's JNDI tree made a lot more sense to users.)

I do like the dynamic provisioning features of S2AS, although this is not a great deal different to the maven integration done by xbean and initially integrated into Spring-DM by your truly. The key thing is that the SpringSource guys have productized it with a bundle repository backing it. Indeed, that's really the essence of what they have done - taken a set of existing technologies, in various states of readiness, and integrated them into a cohesive, production-quality whole. When I talk to customers that's one of the things they like about Spring in general - it pulls together other open source projects in a way that makes them easy-to-use, with all of the integration issues resolved.

I must talk a little about the choice of GPL3 license since it has generated a fair amount of controversy. In my opinion the use of GPL is a mistake. Here's why - SpringSource are a commercial outfit, ultimately they are valued on how well they are able to generate returns on their assets (consultants, IPR, user base etc). Free does not contribute to this. If something is free, regardless of whether it is GPL3 or ASL licensed, it does not contribute directly to this financial return. What matters is what is called in the literature "strategic complimentaries" (if you want the full story read my upcoming MBA thesis ;)) - basically stuff that you control (and can protect) that you can make money off that is driven by the usage of the free stuff. Things like training, consultancy, other proprietary software, support, subscriptions etc - all the things that SpringSource do so well. But the value derived from these things is dependent on one key ingredient - market penetration of the free stuff. The more the free stuff is accepted by the market, the more the stuff you make money off is worth. In fact it gets better than this - get enough penetration and customers will hesitate to use a competitor, a host of 3rd-party services will grow up around your free stuff (what are called "network effects") and customers will end up with switching costs that are too high to be worth contemplating - things like retraining all your developers, getting different tools etc, etc. So penetration is the key. Now you tell me, which license - GPL3 or ASL - is likely to achieve more penetration? The answer is self-evident. So what if some big competitor copies your invention - your invention is free anyway so who cares - what matters is that it's increasing the value of the stuff that matters do you. So I'm with Billy - the application platform will become commodity and its in SpringSource's interest for this to be the case.

Ok I'll get off my soapbox. Just to round this out, look out for the upcoming WLEvS 3.0 release, due out in the summer, which incorporates many of the features - and more - being considered by SpringSource for S2AS 2.0. Clustering, management console, single system image just to name a few.

Co-operative Open Source

Posted by andypiper on March 4, 2008 at 2:29 AM | Permalink | Comments (0)

I just finished fixing a bug in the unreleased development version of WebLogic Event Server. The code in question leveraged some advanced features of the Spring Framework and was something that I had had to code around in EvS 2.0. Fortunately, for me, I had spent a bunch of time with Juergen Hoeller at SpringOne last year discussing some of the ways we were trying to use Spring in EvS and how we were running into a few problems. The free beer that BEA provided at the event was a great persuader and I subsequently raised a bunch of enhancement JIRA's which Juergen fixed for me (SPR-3609, SPR-3364, SPR-3608 for the curious).

The great thing is that since EvS is essentially an open platform, we can leverage these technologies bringing value-added functionality to market more quickly. Even better SPR-3608 turned out to be absolutely essential for EvS 2.0 and so, since Spring is open source, I was able to make the fix myself and allow EvS 2.0 to ship on time. Now that we are working on EvS 3.0 - which is based on Spring 2.5.x - I am able to pick up the official fix from Juergen and don't have to maintain a forked version of Spring 2.0.5.

This experience is not unique. Many features in Spring-DM, which we use heavily in EvS, were influenced by EvS requirements (or coded by me!). Although the SpringSource folks are quick to challenge stupid ideas, they are also cognizant of the fact that customers drive their business, and Costin graciously accepted the majority of my requests and submissions for Spring-DM. In fact one of the key features of Spring-DM - automatic activation of application contexts, which is essentially the EvS deployment model - was conceived and implemented by a BEA engineer.

As an engineer who has had to deal with a somewhat more glacial approach from other organizations, the approach is a breath of fresh air. And the key is open-ness - the open-ness of the EvS platform approach and the opensourciness [?] of many of the technologies that we leverage - not just Spring. This gives a great deal of comfort to our customers, since their commitment to our platform is not a case of vendor lock-in, but more a synergistic union of open technologies. They benefit not just from a fast turnaround on development, but wider understanding and support of the underlying technologies.

And the bug? Too embarrassing to discuss.

WebLogic Event Server - Why we used Spring

Posted by andypiper on August 29, 2007 at 2:58 AM | Permalink | Comments (4)

I have now been working on WLEvS for about 8 months. Before that time I was heavily involved with the development of Spring-OSGi and making sure that it met the needs of WLEvS.

Why the interest in Spring? What has BEA to gain by so extensively using an Open Source technology in one of its products? Well the answer is actually pretty easy. Event Driven Architectures (EDA) are now reaching the mainstream both in terms of interest and in terms of development. They are a key part of Gartner's Extreme Transaction Processing (XTP) vision for the future - a vision in which BEA is currently in pole position. But enough of the marketing, developers want to know what it means for them in terms of their day-to-day jobs. At a development level EDA is significantly different to things like Java EE and thus requires new programming paradigms and environments. So building event driven applications requires something other than Java EE, but Java EE has a key advantage - its a standard and everyone is familiar with it. Love it or hate it is pretty easy to find developers with Java EE experience. But what happens when you need to do something new? Proprietary APIs are no good - all customers are wary of "vendor lock-in", and developers especially so. The answer is pretty simple - use something that developers are already familiar with. Hence, in a word, Spring.

BEA has a pretty long and positive history with Spring, as evidenced on our Spring resource page. But more than just providing a familiar programming environment, Spring provides a powerful extension mechanism for event server developers and a user friendly way of accessing OSGI services via Spring-OSGI. Furthermore we have used Spring 2.x's extension mechanism to implement WLEvS' domain specific language for network assembly. The nice thing about this is that if you don't know Spring you don't have to use it, but if you want to go deeper you still can.

The simple things are easy and the difficult things are possible, or as the Spring folks are fond of saying, "simple and powerful."

Spring 2.0 and Message Driven POJOs

Posted by andypiper on July 17, 2006 at 3:52 AM | Permalink | Comments (2)

One of the new features of Spring 2.0 is message driven-POJO's or MDP's. These are like MDB's but do not require the EJB framework. In Spring 2.0 you get a lot of different options for creating MDP's but in general you simply need to implement a JMS message listener and wire it into Spring.

I have implemented an MDP sample attached to this arcticle. It requires maven2 to build, so make sure you download and install that first.

Take a look at MessageTraderBean.java in the sample. The guts of the implementation is onMessage() which simply receives a quote on a JMS topic and prints it out:

  public void onMessage(Message msg) {
    ObjectMessage tm = (ObjectMessage) msg;
    try {
      Quote quote = (Quote)tm.getObject();
      if (quote.getShares() > tradeLimit) {
        log("Trade " + quote.toString() + " was denied");
      }
      else {
        lastQuote = quote.toString();
        log("Received new quote : " + lastQuote);
      }
    }
    catch(JMSException ex) {
      ex.printStackTrace();
    }
  }
Note how there is no extraneous framework code and indeed no references to Spring at all - the beauty of dependency injection!

In order to the wire up the MDP we need a Spring configuration file which is src/main/webapp/WEB-INF/applicationContext.xml. Inside you can see various Spring classes being wired together, in this instance I am using org.springframework.jms.listener.DefaultMessageListenerContainer. For more information on these consult the Spring documentation. The one important thing to note here is the use of commonJ WorkManagers (I'm not going to show the code here since putting XML in a blog entry is such a pain!). Since we are going to be running the sample on WebLogic Server we don't want to start creating threads inside the application. Fortunately Spring 2.0 provides a way of deferring the asynchronous execution required by MDP's to WorkManagers as well as simpler thread pooling schemes. The WorkManager we are referencing is defined in web.xml (in the same directory) with WebLogic specific configuration in weblogic.xml. For more information on configuring WorkManagers consult the WLS documentation. For more information on Spring 2.0's TaskExecutor support consult the reference manual.

In order to use the example you need to create an appropriate JMS topic for publishing messages to. So fire up a server and start the console.

First of all you will need to create a persistent store for the server, so select Services->Persistent Stores and create a new FileStore. The name doesn't matter. You can select "." as the directory.

Next, you will need to create a JMS server using that persistent store. This is where the names start getting important in order for the Spring application to find the right topic. You will notice that I have called the destinationName in the applicationContext.xml "myserverJMSServer/spring-jms!quotes" which in English is translated as "the JMS server myserverJMSServer with JMS module spring-jms and topic quotes", so make sure that you call the new JMS server "myserverJMSServer". So select Services->Messaging-> JMS Servers and create a new JMSServer with that name and targetted at the persistent store you just created. Make sure also that you select the running server as a target.

Now you need a JMS module targetted at the JMS server. So select Services->Messaging-> JMS Modules and create a new JMS module called "spring-jms" and targetted at the running server. When asked if you would like to add resources, accept and create a new Topic resource called "quotes" and target it at myserverJMSServer. You don't need to set the JNDI-name for the topic.

You are now ready to deploy the application. Copy target/mdp-1.0-SNAPSHOT.war into the server's autodeploy directory. You should get a flurry of debug messages, but no exceptions. If you get an exception most likely you got one of the names wrong when setting up JMS. You may have to kill the server and start again if this happens since there was a bug in earlier releases of Spring 2.0 that caused the server to spew endless exceptions if the deployment names did not match. Hopefully this will not happen to you!

Once you have the app deployed, all that remains to do is to run the client. You can see that the guts of the client is to publish a message to a topic:

  public void example() throws RemoteException, JMSException, NamingException {
    Topic newTopic = null;
    TopicSession session = null;
    try {
      session =
        m_topicConnection.createTopicSession(false,   // non transacted
                                             Session.AUTO_ACKNOWLEDGE);
      
      newTopic = (Topic) m_context.lookup(TOPIC_JNDI_NAME);
    }
    catch(NamingException ex) {
      newTopic = session.createTopic(TOPIC_NAME);
      m_context.bind(TOPIC_JNDI_NAME, newTopic);
    }

    TopicPublisher sender = session.createPublisher(newTopic);
    ObjectMessage tm = session.createObjectMessage();
    String[] symbols = new String[] {
      "BEAS", "SUNW", "IBM"
    };
    float[] price = new float[] {
      13.10F, 4.50F, 89.89F
    };
    int[] shares = new int[] {
      1000, 50, 3000
    };
    for (int i = 0; i < symbols.length; i++) {
    tm.setObject( new Quote(symbols[i], price[i], shares[i]));
      sender.publish(tm);
    }
  }
Note that here too there is no reference to Spring 2.0 in the code. The client does not even know it is interacting with a Spring application. To run the client you will need to include target/classes in your classpath to pick up the client classes, so something like:
eagle Andrew Piper> java -classpath "target/classes;$CLASSPATH" com.bea.spring.Client t3://eagle:7001

Beginning message.Client...

Success!  created topic: myserverJMSServer/spring-jms!quotes and published a message.

End message.Client...
You should also see a message in the server console window:
Received new quote : 1000 of BEAS@13.1
Received new quote : 50 of SUNW@4.5
Received new quote : 3000 of IBM@89.89
Congratulations! Your message driven POJO works!

If you have problems with the example let me know. I ran this with Spring 2.0 rc2 which is available from the maven repositories as well as WebLogic Server 9.1. There shouldn't be any problem running the example on later releases of either Spring 2.0 or WebLogic Server.

Spring Console Extension

Posted by andypiper on July 6, 2006 at 2:11 AM | Permalink | Comments (7)

The Spring on WebLogic Server paper described a new console extension that can be downloaded with the Spring on WebLogic kit. Many folks have had trouble getting this working, so I thought I would go over the setup once again and describe some of the gotchas.

Essentially the console extension displays registered spring beans in a table and allows you to call the accessors and mutators. In order to do this the beans needs to be exported via JMX and then registered with the console extension. The extension comes in two pieces, a client piece that gets packaged with your spring application and does the registration, and a server piece that gets packaged with the server and adds the extension page.

The first step in configuration is to add the relevant configuration to your spring applicationContext.xml. The config will look something like this:
<bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter">
  <property name="beans">
    <map>
      <entry key="petclinic:service=clinic" value-ref="clinic"/>
    </map>
  </property>
  <property name="assembler">
    <bean class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
      <property name="interfaceMappings">
        <props>
          <prop key="petclinic:service=clinic">org.springframework.samples.petclinic.jdbc.CachingClinic</prop>
        </props>
      </property>
    </bean>
  </property>
  <property name="listeners">
    <list>
      <ref local="mediator"/>
    </list>
  </property>
  <property name="autodetect" value="true"/>
  <property name="server">
    <bean class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="java:comp/env/jmx/runtime"/>
    </bean>
  </property>
</bean>
  
<bean id="mediator" class="com.interface21.wl9.jmx.mediator.Mediator">
  <property name="applicationName" value="petclinic"/>
</bean>
The first part of the config identifies which beans you will be exporting, so value-ref should refer to another bean in your config. However note that it is also crucial that the true application name be used for the ObjectName "petclinic:service=clinic" (i.e. the petclinic part). The console extension looks up beans based on special JMX ObjectNames built from the application name, and if these are not in sync you will see no beans.

The same applies to the interface mappings section further down. Note too that you must expose you beans via an interface, you cannot simply export a regular JavaBean. It is this interface that appears in the interfaceMappings section.

Finally the JMX exporter refers to a mediator that listens to events and publishes beans to the console as they are exported to JMX. The mediator section appears at the bottom, and again the applicationName must exactly match your application name, otherwise you will see no beans.

We plan to make the configuration of this much simpler very soon, so stay tuned. You can see the full set of properties for the MBeanExporter here. Likewise you can see the configuration properties for the InterfaceBasedMBeanInfoAssembler here.

Once you have your config sorted, you need to build your application and include the console client extension. Unfortunately there was a bug in earlier builds of this and doubly unfortunately the builds of client and server pieces need to match. So I include both the server jar and client jar libraries here. I have verified these with WebLogic Server 9.1 and Spring 2.0-m5. They should work fine with earlier versions of Spring. The extension has been designed so that the version of Sping used by the server piece does not need to match that used by the client piece. You will however need to bundle the appropriate Spring jars with your application also.

Finnaly you need to configure the server extension, this simply involves dropping the server jar into the console-ext directory of your WebLogic Server configuration. Start the server run the app and you should be good to go. The extension appears as an extra tab called "Spring Management Objects" under the deployment entry for your application in the console.

Gotchas - there are a bunch of things that can go wrong here:
  • If the tab does not appear then you likely have not configured the server extension correctly. The other possibility is that you are using autodeployment. autodeployment does not work with the console extension, you must use regular deployment.
  • If you get the tab but no managed objects then most likely your application name does not match the one you configured. Also check that you are using the correct versions of the console extension, both server and client shown above.
  • Clustering is not really supported at present - the beans are exported to the JMX server of the server on which they reside. The console must therefore also be running on this server. Its probably possible to use WebLogic Server's federated JMX server to look up beans remotely, but I have not tried that as yet.


SpringOne Day 2 - Write-only code

Posted by andypiper on June 19, 2006 at 4:44 AM | Permalink | Comments (0)

Gregor Kizcales had a family emergency and so Gregor Hohpe stepped in to give the keynote that he gave at TSSS earlier in the year.

Overall it was a very interesting presentation discussing why code goes bad, choosing the right tool for the job and why tools can be bad for your health. Unfortunately my orginal blog entry for this got gunned down by IE's back button and my memory of the keynote is fading fast. One thing he did say that stuck was how often (4GL type) tools can be good for demos, but when you want to either (a) debug a problem or (b) enhance an existing large project then they often fail to deliver - leading to the thesis that they often produce write-only code. On the other hand custom languages (including XML) while expressive and simple, can suffer from a lack of tooling. Essentially Gregor was advocating considering TCO issues when doing development, which seems good advice to me.

Rod's keynote was essentially a corporate pitch.

My presentation was poorly attended :-P, probably not helped by the fact that I was in competition with Adrian talking about new features in Spring 2.0. However, I will make sure some of the information finds its way onto this site.

SpringOne Day 1 - Where is the A/C?

Posted by andypiper on June 15, 2006 at 2:11 AM | Permalink | Comments (0)

SpringOne has started and its hot! That has as much to do with the lack of air-conditioning as the quality of the presentations, although the latter are undeniably strong.

Rod kicked off with an overview of where Spring has come from and where it is going with Spring 2.0 - rc1 being released at the conference.

Rod quipped that "Spring is everywhere!" but interestingly for me, so was BEA. BEA featured prominently in the keynote, both in our use of Spring (certification on WLS 9.0 and Pitchfork) and with customers' use of our technology (Voca). Its great to see BEA's blended strategy resonating with technologists who know.

Adrian Colyer went on to talk about the superiority of Spring 2.0 AOP support and then, more interestingly, discussed where Spring is going. For me the key quote was "we have the right building blocks", which is one of the things I really like about Spring. Spring is built on Spring, each feature is logically consistent and totally extensible. As a vendor its a veritable goldmine of productivity, for customers it must be a godsend!

I must just mention the BEA booth. We have free Belgian beer on the stand - I'm not sure when we will start serving, but if this heat keeps up we might get mobbed.

SpringOne Day 0

Posted by andypiper on June 14, 2006 at 11:56 AM | Permalink | Comments (0)

An inauspicious start to SpringOne, most people seem to be having problems actually getting here. My flight was delayed and then the traffic from Brussels to Antwerp was abysmal. Having finally arrived my satnav kindly took me through the center of Antwerp to get to the hotel - which wasn't there! I drove around a little, ended up driving under the river at which point the police closed the tunnel. 30 mins later I was finally back under the river and eventually found the hotel.

Adrian Colyer's (I21) luck was just as bad it seems - plane delayed 2.5 hours and then a train that stopped virtually everywhere between Brussels and Antwerp.

The weather is abysmal also, good job I will be inside for the next 3 days! Lets hope the conference proper has fewer logistical difficulties than me.

Spring is just the ticket

Posted by andypiper on January 31, 2006 at 2:39 AM | Permalink | Comments (2)

When we posted the original Spring support kit and whitepaper back in the summer we were unsure of what the response would be. Sure, Spring has a loyal customer base, but would official WebLogic support just be another tick in the box for them? Ok, we put a few extra goodies in there such as clustered Spring remoting, console support for Spring components and a comprehensively integrated sample application, but the real value of the package was the endorsement and certification by us on WebLogic Server. So the overwhelmingly positive response from both customers and the developer community took us completely by surprise! I am sure that this is not just a reflection of the undeniably high-quality code, but also the professionalism and dedication of our friends at Interface21.

Spring is definitely in the air. Our customers love it and we love it too. The simplicity of the programming model really is light years ahead of many current technologies. And, in case you thought this was just a marketing ploy by us, we have now certified Spring 1.2.6 on the newly released Weblogic Server 9.1. We have integrated the fixes required by WebLogic Server 9.0 into this release, including a well-known hibernate issue. But that's not all. Most excitingly we have just released WebLogic Real Time of which Spring 1.2.6 is an integral part.

If you have not tried Spring before then I encourage you to download the kit and jump right in.

Blogged to Death

Posted by andypiper on July 9, 2005 at 6:50 AM | Permalink | Comments (1)

Why is using the internet so hard sometimes? It took me half an hour to actually (re)discover how to add entries to my blog. Now you might surmise that I am a cynical English idiot, and while the first part might be true, several certificates from an institution in the Cambridgeshire fens indicate that the latter is not. Not on paper at least.

So why is it so hard sometimes? I'm no HCI expert, and I don't want to cover obvious ground, but to my mind part of the problem is that its so hard to incorporate feedback.

What would be the process to improve my blog's accessibilty once logged in? Well, the obvious thing is to make the home page customized based on who's logged in and provide useful customized links from there. E.g. "Edit your blog". Fair enough, then I have to transmit this idea to whoever runs the website. Well, who is that? Maybe there's a feedback link on the home page? Let's assume there is (I'm not going to check). So I send feedback via e-mail trying to express my somewhat visual idea in words. The reply I usually get from this sort of feedback is "thanks for your feedback". And that's it. Sometimes if I make the feedback inflammatory enough I will get more personalized treatment - or a letter from appropriate corporate attorneys.

The net is one disgruntled user and an unchanged site.

I'm a developer, I know customer feedback can sometimes be irksome, either because some customers don't necessarily understand what they are doing or because the feedback is about taste rather than function. But the vast majority of customers do know what they are doing and getting them in the feedback loop is vital to improving software.

In WebLogic Server development we are keen to "dogfood" our own products, this means that we use our products regularly to try and find useability problems (or, heaven forbid, bugs). As users and developers we can find and fix issues all at the same time, making a very tight feedback loop. We also have the benefit of being involved in customer escalations. When this happens to me, I am continually asking myself "why did this happen?", "why did the customer find it so hard?", "how can we make it easier to diagnose this problem?". If there are suitable answers I will usually implement them there and then in the development codeline, or raise a change request for some other appropriate part of the team.

Of course this is still feedback from a limited group. To make this really effective we have to make it easier for anyone's feedback to be incorporated. I'm not sure how, but it seems essential to me if software is ever going to delight rather than frustrate.

May 2008

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31


Search this blog:


Archives

May 2008
March 2008
August 2007
July 2006
June 2006
January 2006
July 2005

Categories

Product: WebLogic Event Server
Product: WebLogic Server
Technology: Dev Toolbox

Recent Entries

SpringSource announces SpringSource Application Platform (S2AP)

Co-operative Open Source

WebLogic Event Server - Why we used Spring

Articles

Spring 2.0.1 and BEA WebLogic Server 9.2 Integration
WebLogic Server 9.2 provides a platform for enhanced management, ease-of-use and scalability of Java applications. The Spring Framework enables a simpler, POJO based, approach to Java EE development without sacrificing the power of the platform. This article describes the synergy of these two systems, and introduces the Spring on WebLogic kit. Apr. 23, 2007

Spring 1.2.x Integration with WebLogic Server
WebLogic Server 9.0 provides a platform for enhanced management, ease-of-use and scalability of Java applications. The Spring Framework enables a simpler, POJO based, approach to J2EE development without sacrificing the power of the platform. This article describes the synergy of these two systems, and introduces the Spring on WebLogic kit. Sep. 28, 2005

All articles by Andy Piper »


Powered by
Movable Type 3.31