Friday, April 30, 2010

Here comes WebSphere CloudBurst 2.0

Lifted from Dustin's Blog.

Just over a year ago, IBM announced the availability of the initial version of the WebSphere CloudBurst Appliance. Today, an announcement signals the coming availability of WebSphere CloudBurst 2.0, and that brings the major release count up to three in a period of about 12 months (the release of 1.1 came at the end of last year).


You can read the announcement for yourself, but here is a quick overview of the new features and enhancements delivered in the latest version:


- WebSphere Process Server support: You can now provision fully functional, virtualized WebSphere Process Server environments using WebSphere CloudBurst. This adds to the existing support for WebSphere Application Server, and the beta and trial versions of WebSphere Portal and DB2 respectively.


- Multi-image pattern support: In previous versions of WebSphere CloudBurst, all patterns mapped to a single virtual image. This meant your custom patterns could only contain parts (or nodes) from a single product. Now you can build patterns that contain parts from multiple different images. This allows you to represent diverse application environments, for instance, one that includes WebSphere Application Server, WebSphere Process Server, and DB2 components, as a single pattern. Of course, this also means installing and initializing these different product components becomes as simple as deploying a single pattern.


- Dynamic system management: During the lifetime of an application environment, it is commonplace to add additional capacity. Specifically for WebSphere environments, this often means adding more nodes and application servers into your landscape. WebSphere CloudBurst 2.0 makes it simple (click of a button) to add more nodes and application servers to a virtual system you previously deployed. Using this new capability, you can quickly scale up your application environment to meet the changing demands of its users. Conversely, you can scale down the environment and remove unnecessary nodes with the simple click of a button as well.


- Intelligence for the runtime: I always talk about the WebSphere intelligence the appliance delivers in terms of deploying and constructing WebSphere application environments. The addition of the WebSphere Application Server Hypervisor Edition Intelligent Management Pack means this intelligence starts to make its way into the runtimes of your application environments. Use the new intelligent management pack to enable a policy-based approach to managing your applications. You can enforce application health actions, govern application response times, and even manage the rollout of new versions of your application with no service disruption.


- New Red Hat WebSphere Application Server Hypervisor Edition: The WebSphere Application Server Hypervisor Edition is a virtual image that includes everything from the operating system all the way to the WebSphere Application Server, pre-installed and pre-configured. Initial versions of this virtual image shipped with Novell SUSE Linux Enterprise Server. Staring in WebSphere CloudBurst 2.0, users can use a new WebSphere Application Server Hypervisor Edition virtual image for VMWare ESX that packages the Red Hat Enterprise Linux Server operating system.



As WebSphere CloudBurst marches forward with new releases, a theme becomes apparent: Give users a choice. What do I mean? Well, just look at where WebSphere CloudBurst stands with the 2.0 release:


- You can use WebSphere CloudBurst to provision environments to VMware ESX, PowerVM, and z/VM hypervisor platforms


- You can use WebSphere CloudBurst to provision WebSphere Application Server, WebSphere Process Server, DB2, and WebSphere Portal


- You can run your virtualized WebSphere application environments on SUSE, Red Hat, AIX, and zLinux operating systems


Want to see more about the 2.0 release? Check out my new video. This much is inarguable: For running WebSphere application environments in an on-premise cloud, nothing comes close to the capabilities of WebSphere CloudBurst.



CEA Impact Sessions

In case you are looking to learn more about Communications Enabled Applications (CEA) at Impact, here are some talks you can come into:
Enabling Cobrowsing and Coshopping on your website - 2040A Tue, 4/May 10:15 AM - 11:30 AM Venetian - San Polo 3506
Adding Rich Interaction Support to your Enterprise Application - 2272A Wed, 5/May  10:15 AM - 11:30 AM Venetian - Lido 3103

Also, we have a lab on Enabling Coshopping and Two Way Forms on your Web Applications with CEA - 2027A Tue, 4/May 04:45 PM - 06:00 PM Venetian - Murano 3304

Finally, here is a less than 3 minute video showing cobrowsing and the new mobile widgets we have made available and will be demoing at Impact here as a tech preview

WebSphere Application Server Feature Pack for Dynamic Scripting

Lifted from Project Zero blog:

Today we announced a new feature pack for WebSphere Application Server based on WebSphere sMash. This new feature pack delivers the sMash programming model for use on entitled / current subscription WebSphere Application Server V6.1 and V7.0 servers.

Complete details can be found in the IBM.com announcement letter.

When the Feature Pack becomes electronically Generally Available, downloads will be available on the official IBM.com web site for WebSphere Application Server Feature Pack for Dynamic Scripting.

Also being made available through Project Zero, the sMash Enterprise Packager allows WebSphere Application Server V7 to deploy and manage sMash applications through the administrative console as an EAR file. Read more info about this and download the sMash Enterprise Packager on ProjectZero.org.

Find out more about this new Feature Pack and more at IBM Impact 2010.


Based on technology from WebSphere sMash V1.1.1, the feature pack for dynamic scripting provides support for dynamic scripting languages including PHP and Groovy all the while allowing you integrate with AJAX, REST, ATOM, RSS, etc. There is also a resource model as part of the included Zero programming model that simplifies the creation of RESTful services. Want a quick way to create a Web 2.0 application in these languages .. then give this feature pack a try.

Thursday, April 29, 2010

Video Blogs on Impact 2010 Sessions Next Week

Are you heading to IBM Software Impact 2010 next week? I hope so!

I will be presenting on WebSphere XML Strategy. I will be presenting a session on the WebSphere Application Server Feature Pack for XML talking about usage scenarios, how to use the feature pack, and best practices (Sessions 1635A/B on Monday and repeat Thursday). I will also be providing a general education session on XPath 2.0, XSLT 2.0 and XQuery 1.0 (Session 1634 on Tuesday) focused on basic education as well as noting whats new with the standards - with a cool give away! I will be assisting a lab where you can get hands on experience with the XML Feature Pack and the Rational Application Developer tools (Session 1606 on Monday). Stop by any of these session or hit me up on twitter (@aspyker) if you have any questions about XML or data strategy within your enterprise.

Along with the XML Feature Pack and XML strategy talks, I'll be participating in a SOA and BPM Performance update (1321) talking about SPEC SOA and multiple panel discussions around the values of the application server, performance, and feature packs.

You can hear me talk about the sessions here:



Some other videos about sessions next week are available as well.

Erik Kristiansen on RESTful, dynamic scripting, and OSGi programming models:



Lan Vuong on extreme transaction processing and elastic application architectures:

Thursday, April 8, 2010

Looking for XPath/XSLT/XQuery Education?

Last year, I attended the XML-In-Practice 2009 conference. One person I met there is Ken Holman. Ken works for Crane Softwrights Ltd. which is a consultancy delivering computer systems analysis and training services with focus in structured text processing related to XML and SGML including XSL/XSL-FO, XSLT, XPath and XQuery, and UBL.

Ken and I have been collaborating recently on enabling the hands-on in-depth XSLT/XQuery classes offered to use the IBM Thin Client for XML with WebSphere Application Server V7.0. Now students with the feature pack can quickly configure Crane's exercises to utilize the latest XSLT/XQuery support from IBM.

The three upcoming publicly-subscribed deliveries for XSLT/XQuery are:

West-coast North America: April 26-30, 2010 - San Francisco area

East-coast North America: May 10-14, 2010 - Ottawa, Canada

Europe: June 7-11, 2010 - Trondheim, Norway

Ken travels the world teaching a number of XML-related classes both privately and publicly. He is willing to consider teaching anywhere and he welcomes anyone to contact him regarding a possible private or public class of any of his material. Ken has taught and offers other classes. You can see them here.

Wednesday, April 7, 2010

XML Feature Pack 1.0.0.3 Available

I'm happy to announce another major update to the XML Feature Pack and its impact on our development tooling - Rational Application Developer for WebSphere.

We just released the 1.0.0.3 version of the XML Feature Pack that has two major new features (as well as some small bug fixes). The two new features are:

XQuery Schema Awareness



In the initial release we had Schema Awareness for XSLT 2.0. In this release we add similar function to XQuery. Specifically this means we started to support the optional XQuery 1.0 features of schema import and schema validation. With these features you can use your own type information in XQuery programs. A common scenario would be looking for all addresses in an input document, regardless of they were "billingAddress" or "shippingAddress". Programming based on type information is a powerful concept that leads to more flexible implementations. Also, validation allows you to validate incoming documents, xml trees and whole output documents. This allows for greater reliability in your XML processing.

Debugging support for XSLT 2.0 under Rational Application Developer (RAD) for WebSphere



Previously with RAD you could debug XSLT 1.0 stylesheets. With this new release of the XML Feature Pack and with RAD 7.5.5.1 you can debug XSLT 2.0 stylesheets. This isn't just about moving to a newer stylesheet level. With all the changes in the data model and advanced new concepts like grouping, there are many improvements in visualization with debugging over the XSLT 1.0 debugger.

What is also interesting is that this is a converged debugger. While there are other XSLT 2.0 debuggers out there, they only work on the stylesheet itself. With this support in RAD, you can debug not only the stylesheet, but also the Java code in your web application that invokes the XSLT engine along with any Java extension functions you might have. If you are using XSLT 2.0 in the application server, this is the tool you want for debugging end to end.

I hope to do a video demo of this Rational Application Developer functionality. Imagine setting breakpoints in XSLT as well as Java and being to jump between them. Anyone interested in seeing such a video demo?

Have fun with the new functions!

Sunday, April 4, 2010

Options for WebSphere Application Server Scripting

 WebSphere Application Server (WAS) provides a scripting interface called wsadmin. wsadmin supports two scripting languages jacl* and jython. Five objects are available when you use scripts:
  • AdminControl: Use to run operational commands.
  • AdminConfig: Use to run configurational commands to create/modify WAS configuration.
  • AdminApp: Use to administer applications.
  • AdminTask: Use to run administrative commands.
  • Help: Use to obtain general help.

WAS provides a number of aids to developers and system administrators for the development of wsadmin scripts. Different options that can be leveraged in developing wsadmin scripts are explained below.

WAS V7 Script Libraries (new in v7 .. supported)
WebSphere Application Server V7.0 includes script libraries that can simplify the use of these objects.
Script libraries can be used to perform a higher level of wsadmin functions than can be done using a single wsadmin command. Only a single line from a library function is needed to perform complex functions. Each script is written in Jython, and is often referred to as “the Jython script”. The script libraries are categorized into six types (Application, Resources, Security, Servers, System) and the types are further subdivided into application and utilities. See the WAS V7 Administration and Configuration Guide chapter 8 for additional details. The script libraries are located in  WAS_INSTALL_ROOT/scriptLibraries directory. These libraries are loaded when wsadmin starts and are readily available from the wsadmin command prompt or to be used from the customized scripts.

Command assistance ( supported)
The command assistance feature in the administrative console was introduced in WAS V6.1 with limited scope in function. The command assistance feature has been broadened in V7.0. When you perform an action in the administrative console, you can select the View administrative scripting command for last action option in the Help area of the panel to display the command equivalent. This command can be copied and pasted into a script or command window.You also have the option to send these as notifications to the Rational Application Developer V7.5, where you can use the Jython editor to build scripts.

wsadminlib.py ( 'as-is' see note below)
Another resource for WebSphere System Administrators for scripting is the wsadminlib.py script library.
wsadminlib.py  wsadminlib.py is a large python file containing hundreds of methods to help simplify configuring the WAS using scripting. A wide variety of methods have been developed. These methods perform tasks such as creating servers, starting servers, creating clusters, installing applications, proxies, core groups, core group bridge, dynacache, shared libraries, classloaders, replication domains, security, BLA, JDBC, etc. Please note that wsadminlib is provided on an 'as is' basis under the IBM DeveloperWorks license agreement. It is not a supported product. The underlying wsadmin calls made by the scripts are however supported by IBM.



Happy Scripting!


* jacl has been stabilized

Wednesday, March 31, 2010

Programming XML Across Multiple Tiers

In the XML Feature Pack, we ship a sample that shows how to use XML centric programming in the middle tier. The sample shows how to unlock data in Web 2.0 ATOM XML encoded feeds using XQuery and present the data in a typical web application using XSLT. As an extension to this sample, we also have a sample that shows how to persist data from these feeds into an XML Database such as DB2 pureXML or Apache Derby. We included this example as we found, frequently, that people working with XML centric programming typically had large XML datastores in XML centric databases.

While the sample is there, with source code, in the XML Feature Pack, we don't explain why we coded the sample the way we did. In this new developerWorks article (Programming XML across the multiple tiers: Use XML in the middle tier for performance, fidelity, and development ease), we go into detail why for simplicity, performance, and flexibility reasons we coded the sample the way we did.

The article is worth a read. It will walk you through the new features in the XML Feature Pack and JDBC 4.0 that allow an end to end native XML programming model across the XML Feature Pack and an XML database. We hope to expand this article over time to cover more advanced concepts when working with XML databases.

Finally, here are two quick videos that show how to get the sample working with DB2 pureXML and Apache Derby.

DB2 pureXML (Part 1/2)
Direct Link (HD Version)

Apache Derby (Part 2/2)
Direct Link (HD Version)

Tuesday, March 30, 2010

XQuery as a replacement for VBScript?

I was discussing with a colleague the leaning of folks to use JavaScript to process data on the server. I have seen a few products recently move to JavaScript as a programming model aimed towards folks that aren't skilled in languages such as Java. I always wondered why. JavaScript doesn't seem like the right language for a server environment and isn't the best language for data navigation. The colleague told me that his belief was that JavaScript was much closer to VBScript that "business users" are used to using in Excel. After looking at a presentation on XQuery I did, my colleague believes that XQuery could have filled the same need as JavaScript (high level language, script like, etc.).

In this presentation, I showed how I replaced a process we had internally using Excel and VBScript with an online application using XQuery running on the XML Feature Pack. I also showed how others have done non-query based applications using XQuery (like the XQuery Ray Tracer) proving that XQuery is a full language.

I wonder if others out there also believe that XQuery is a good language to replace VBScript and "programs" currently locked in Excel documents?

Monday, March 29, 2010

IBM WebSphere Application Server V8.0 Alpha

The WebSphere Application Server team is proud to announce the availability of the IBM WebSphere Application Server V8.0 Alpha.

Building upon the capabilities of our previous releases, some of the Alpha features include:
  • Key portions of Java™ Enterprise Edition 6.0 specifications

  • Increased developer productivity

  • Simplified product install with integrated prerequisite and interdependency checking

  • Enhanced security and governance capabilities

  • JPA L2 cache and JPA L2 cache integration with DynaCache

  • High Performance Extensible Logging


Our architects, designers, engineers, testers, information developers, and user experience professionals are eager to participate with you in the Alpha forum, discussing what's new, learning about your experiences with all aspects of the product, and answering questions.

Also, the WebSphere Customer Experience Program (CEP) offers opportunities for interactive sessions with our development teams, including demos of potential new features and opportunities to provide feedback that we can use to drive improvements into each version of the product.

More details about the Alpha program, how to download the product, and the CEP program can be found here:

https://www14.software.ibm.com/iwm/web/cc/earlyprograms/websphere/wsasoa/index.shtml

And, here's a link to the Alpha forum:

http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2180&start=0

We're looking forward to hearing from you about your experiences with the IBM WebSphere Application Server V8.0 Alpha.

Enjoy!

Wednesday, March 17, 2010

More OSGi goodness

There is a new feature in the Beta refresh of the OSGi feature pack which went out last week - a tool to inspect application bundles. Here are some brief instructions on how to use it.

First, install the feature pack (see here) and start the application server, then at the shell command line navigate to:

[AppServerHome]/feature_packs/aries/bin


There is a script in there called osgApplicationConsole.sh (or .bat), run it and you should get a "wsadmin>" prompt. Use the list() at the prompt and it will show you ... nothing. That's fine, you need to install and start an application before you can see anything.

Install and start the Blog Sample (as described here), then try list() again, you will see something this:




Two frameworks are listed, 'shared bundles' and the Blog application. Connect to the first like this:

wasadmin>connect(0)

Use the ss() command to look at what is in it:



You don't have to disconnect from a framework explicitly, so to look at framework 1 (the Blog application) just connect to it:

wsadmin> connect(1)

then ss() shows the blog sample bundles.




This may by now be looking slightly familiar to anyone used to the Equinox OSGi console. The difference is that WebSphere is partitioning the space into separate application frameworks which you can look at individually - nice feature if you have a lot of applications. By the way, if you forget which framework you are connected to, list() at the wsadmin> prompt will tell you.


Other console commands can be found in the documentation, or by using 'help()' at the wsadmin> prompt. Have fun!

Friday, February 26, 2010

The pain of XML in Web 2.0

I have continued to think about the end to end XML story across database, middle tier, and the browser client. I have talked to many organizations that work with standard industry XML documents (HL7, OAGIS, ACCORD, etc) where the XML view unifies the data of their entire enterprise. To these organizations, they work data out from the message queues to data storage to middle tier. However, what does it look like when they want to expose this data to the web tier? There are products that handle this well like Lotus Forms based on XML centric standards like XForms. But what about Web 2.0 libraries like DOJO or jQuery?

I took the download sample I described here, and tried to visualize the data to Web 2.0 webpages. The data format of the XML of interest is:



First, I looked at the DOJO bar chart code and did something like this in a server side XQuery program that generated HTML with the following under JavaScript:



This works as XQuery can return sequence of primitive types and in this case, I'm just returning a string and inserting it inside of the JavaScript code that expects value/text values. But what if I want to have a REST endpoint serve up XML directly and have the browser consume it?

DOJO DataGrid can read from a DataStore which can be hooked to an XmlStore. This means I can use a browser side control to read from my server side XML. All seems good until you get into the details. Here are snippets of the code to make this "work":



What are the some of the issues with this? First, the XmlStore has to map to a simpler format for the DataGrid to understand the XML data. That is why I had to manually tell the XmlStore to promote all the attribute values to similarly named element names. Nicely, the XmlStore supports allowing the ability to drill down to something other than the root item for the data, but it really just allows you to pick the name of an element (you'll see I specified "month"). The second problem is that for any complex industry specific data, likely that wouldn't be sufficient. What if I had multiple month elements at different parts of the XML tree? I'd end up getting a table that combined months that meant different things. What I'd really want is XPath as the root selector. Third, even though the Store abstraction is nice for handling multiple data formats, if I wanted data to be combined from different parts of the XML tree or multiple trees, what I really would like is XPath from the DataGrid formatter function itself.

Assuming this might be easier in the other very popular library for JavaScript query, I went off an investigated jQuery. I quickly found articles that talked about jQuery and XML. I patterned the next part of the article after this example. So, rewriting, I ended up with:



Now, with jQuery, I'm actually able to do a little more "native" xml query. You'll see that I can access attributes directly. You'll see that I can navigate only to the months or the monthByMonthDownloadStats. However, as someone that knows XQuery, this syntax seems very unnatural (I'm sure it's very clear to JavaScript and/or CSS writers). Unnaturalness aside, this seems more verbose. In XQuery I can write this like:



With this I get all of the same benefits that jQuery has (plus more - I'm almost sure jQuery wouldn't support the rich Functions and Operations of XPath 2.0 or any mixed XML content common in document centric XML approaches). XQuery mixes the construction of the content with the query of input much better in my opinion (I believe if we showed date comparison for example you'd see a worse comparison). Of course the benefit of jQuery over XQuery is XQuery doesn't run in the browser. I had to run the previous XQuery sample on the server. That is a pretty big benefit.

I think the summary of all of this, if you stayed with me this long, is that Web 2.0 technology in the browser isn't really ready to handle the complex XML documents that exist within most enterprises. This means if you want to marry Web 2.0 with the enterprise XML data, you'll need to write data conversions essentially extending the presentation tier across the browser and middle tier that simplify the data or use feature like the Web 2.0 Feature Pack to do this for you. Also, you'll need to learn two languages (arguably three if you consider jQuery a language) and programming styles when dealing the with XML data.

Given I look at WebSphere XML Strategy, I'm not sure I'm happy with this answer. I am currently looking towards other solutions to this issue. Given I'm rather new to Web 2.0, feel free to point out other things I didn't consider in the Web 2.0 space for XML processing (outside of XForms of course).

Monday, February 22, 2010

XPath, XSLT 2.0 and XQuery 1.0 in five minutes

You may remember a similar demo back in the open beta timeframe. Now, the IBM Thin Client for XML with WebSphere Application Server v7.0 is available based upon the shipping version of the XML Feature Pack. The following video will show you how to get up and running in about five minutes (including download time).

The thin client for the XML Feature Pack allows you to use the XPath 2.0, XSLT 2.0, and XQuery 1.0 runtime in your client applications of the application server using the same API's as when running in the application server. Before, you could get the thin client by installing the XML Feature Pack on top of the application server. Now, we've made the thin client separately downloadable which makes prototyping very simple.

Here are the links shown in the demo:

Direct link to download the thin client, Demo files

XML Feature Pack Thin Client Demo



Direct Link (HD Version)


Please note that the thin client is only supported on Java 1.6 JVM's.

Wednesday, February 17, 2010

Simple XQuery execution in Eclipse using XQDT/XML Feature Pack

I recently was shown that the current version of XQDT works with the XML Feature Pack. XQDT is working to become a main Eclipse project, currently under incubator. You can follow the instructions here on how to install .

After installing, here is how to setup the right things to make it call the XML Feature Pack:

1. Setup the interpreter to point to the XML Feature Pack thin client (note you can obtain the thin client from here for evaluation, or obtain it from a XML Feature Pack installation)
2. Create a new XQuery project
3. Setup the run as XQuery options to set the input file
4. Run and view the output

This will get you to a place where you can quickly edit and run XQuery programs. It won't allow you to debug and doesn't integrate with your Rational Application Developer projects, but for quick edit/run/fix development of XQuery it does a decent job. Its worth noting that this is something I discovered as working and given you get this from Eclipse/open source, there is no IBM support. However, if you give it a try and have some feedback, post it on the forum and I'll get it back to our tooling teams.

In the spirit of another big post, here are some images that show these steps, using the locations.xml and simple.xq that I used in this previous post.

To setup the interpreter to point to the XML Feature Pack thin client, load up Windows -> Preferences and navigate to XQuery -> Interpreters and click Add.



The settings to put into the dialog are:


Interpreter type: Java XQuery Engine
Interpreter name: XMLFEP
Interpreter JAR/WAR: C:\ibm\WebSphere\AppServer\feature_packs\xml\runtimes\com.ibm.xml.thinclient_1.0.0.jar
Main class: com.ibm.xml.xci.internal.cmdline.ExecuteXQuery
Interpreter arguments: ${query_file}


And it looks like this:



Next you need to create an XQuery project. It would be nice if you could use this functionality outside of an XQuery project, but I haven't been able to get that to work yet. You can create a new project by right clicking the project window New -> Other -> XQuery -> XQuery Project. Give it whatever name you want. Make sure you pick the XMLFEP (or whatever you named it) as the default interpreter. This looks like this:



Next, copy the simple.xq and locations.xml into your project and refresh. Once you have done that you should be able to right click on simple.xq and do Run As->Run Configurations.... That looks like this:



Once you're in there, navigate to Arguments. You can add any command line options here, but most importantly you want to add the -input parameter and point it to the input file (locations.xml in this simple sample). That looks like this:



Once you have this setup, you can Run the XQuery file in the project by right click Run As->XQuery or simply Control-F11. If it all is setup right, you'll see the output in the console window. That should look like this:



Update 2010-02-22: Note that if you have Java 1.5 on your path, make sure you replace it with Java 1.6. Otherwise you'll get an error about invalid class formats or magic numbers since the thin client only supports Java 1.6 JDK's. You can tell if your system have Java 1.5 on the path by opening a command prompt or shell and typing java -fullversion. Hopefully XQDT at some point will allow you to control what Java the execution is run on instead of defaulting to the global path version of Java.

Update 2010-10-06:

XQDT has moved to WTP Incubator at Eclipse. The XQDT team just release a new milestone, which in particular brings compatibility with the latest Eclipse Helios (Eclipse 3.6). For more details changes, go look at the New and Noteworthy page on the Eclipse web site:

http://wiki.eclipse.org/XQDT/New_and_Noteworthy/0.8.0

To install the latest XQDT build from Eclipse, make sure to stop using the old XQDT update site. Instead use the Eclipse update site:


http://download.eclipse.org/webtools/incubator/repository/xquery/milestones/

Friday, February 12, 2010

Try out WebSphere's OSGi Application Feature

The open Beta version of the WebSphere OSGi Application and JPA Feature Pack hits the streets today. This brings together the JPA and OSGi Application Alpha programs and makes them installable features within a managed install. This post focuses on the OSGi Application feature of the Beta which and adds many new and good things beyond the Alpha including a completely re-factored version of the original Blog Sample application. In this post I will step through instructions for running and and modifying the Blog Sample application. Detailed instructions on how to run the Blog Sample are supplied in the Readme.txt that comes with the sample, so I will go over some of the steps quite briefly.

I will refer to your WebSphere home directory as WAS_HOME throughout this post. I ran through this using the free-for-developers version of WebSphere running on Ubuntu, so there may be a slightly Linux-y flavour; I'll document the 'assume nothing' Ubuntu install here. Everything should, of course, work on any supported WAS platform.

The Blog sample



The Blog sample is an OSGi Application that demonstrates the main concepts and many of the benefits of assembling and deploying an enterprise application as an OSGi Application. It comprises four main bundles and an optional fifth bundle, the relationship between the bundles is shown below:

The blog sample demonstrates the use of blueprint management, bean injection, using and publishing services from and to the osgi service registry, using optional services and the use of java persistence. In the main application, supplied as an EBA (enterprise bundle archive), the four bundles are:

  1. The API bundle - describes all of the interfaces in the application
  2. The Web bundle - contains all of the front end (servlet) code and the 'lipstick' (css, images)
  3. The Blog bundle - the main application logic. This bundle publishes a 'blogging service' that the Web bundles uses.
  4. The persistence bundle - the codes that deals with persisting objects (authors, blog posts ..) to a database (Derby in this case). The persistence bundle supplies a service for this which is used by the Blog bundle; the persistence service in this implementation uses JPA, with OpenJPA as the JPA provider.
  5. The final bundle is an upgrade to the persistence service, it contains an additional service that will deal with persisting comments as well as authors and blog posts.




Running the Blog Sample


The first steps in running the sample are to set up some data sources and create the database that the sample will use. There are instructions on how to do both in the Readme.txt file which can be found in WAS_HOME/feature_packs/aries/samples/blog; when you run the blogSampleInstall.py script use the 'setupOnly' option which will just create data sources. I'm going to step through the rest of the installation using the WebSphere Admin Console.

Start up WebSphere and point your web browser at the Admin Console, if you are running on a local machine and have not set up administrative security you will find the console at http://localhost:9060/ibm/console. Before going any further check that the data sources were set up properly by navigating to Resources->JDBC->Data sources, you should see something like this:



In the next sections I will work through installing the sample, starting with the bundles that it depends on.


Deploying bundles by reference


The Blog sample uses a common JSON library; while it could be deployed as part of the application the Blog sample illustrates how common libraries can be installed to the new WebSphere OSGi bundle repository and provisioned as part of the installation of an application that requires it. So the first thing we do is add the common JSON library to the WebSphere bundle respository. Navigate to Environment->OSGi Bundle Repositories->Internal bundle repository, the repository will be empty if you are using a new installation.

Click on 'New' to add a new bundle, on the next screen add the asset WAS_HOME/feature_packs/aries/InstallableApps/com.ibm.json.java_1.0.0.jar. Click 'OK' and then save the configuration, you should see this screen:




Creating the Blog Asset


Installing an OSGi Application through the Admin console is accomplished in two steps, described in this section. The blogSampleInstall.py script mentioned above illustrates the underlying wsadmin commands for a scripted install. The first step is to add an EBA (enterprise bundle archive) archive as an administrative asset, the .eba extension just indicates that this is an OSGi Application. Navigate to Applications->Application Types->Assets. Click 'Import' and add WAS_HOME/feature_packs/aries/InstallableApps/com.ibm.ws.eba.example.blog.eba. After saving you should see this:





Creating the Blog Sample Business Level Application



The second step is to to create an application which uses the EBA asset. Navigate to Applications->Business Level Applications, add a new application called Blog Sample:





After you have added the application you must associate it with the Blog sample asset, click on the sample and add com.ibm.ws.eba.examples.blog.eba under Deployed Assets.



As usual, save the configuration.

Start and run the Blog Sample application



At this point everything is in place and ready to run the application. From the Business Level Application screen, select the radio button beside the Blog sample and click start. If the sample starts as expected then point your web browser to
http://localhost:9080/blog, and you will see this:



With the blog sample running you will be able to add authors and posts and see that they are persisted to the database. Here is my first post to the Blog sample:



There isn't a great deal of functional code in this 1.0.0 version of the sample but a 1.1.0 version of the blog.persistence bundle is provided which adds a functional service to enable you to add comments to blog posts. We'll now illustrate how to update an application to add a new service by moving from version 1.0.0 of the blog persistence bundle to version 1.1.0 which contains the new service.

Changing the bundles that the Blog Sample application uses


First you will need to add the blog.persistence_1.1.0 jar to the internal bundle repository. This means repeating the same steps as for adding the JSON jar above. The path to the archive is WAS_HOME/feature_packs/aries/InstallableApps/com.ibm.ws.eba.example.blog.persistence_1.1.0.jar. Add it to the internal bundle repository and save the configuration.

Now you need to allow the application to use the new bundle. To do this, select the blog sample asset by navigating to Applications->Application types->Assets and clicking on com.ibm.ws.eba.examples.blog.eba. Scroll down to close to the end of the next screen where you will find this link:



Clicking on the 'Update bundle versions...' link will take you to this page:



Click on the the drop down arrow to the right of the line for the persistence bundle, you will be offered a choice of using the 1.0.0. or the 1.1.0 bundle. Choose 1.1.0 and follow through the preview and commit screens. You will need to restart the Blog application (from the Business Level Application screen) to make it use the new bundle, after that, navigating to http://localhost:9080/blog should show you the blog application with a new link to add comments. Unfortunately, it doesn't. This is what you will see:



This turns out to be entirely my mistake. In the last minute scramble to get the sample into the Beta delivery I didn't notice that some changes had been made to the JPA support had been made at the same time. The consequence of those changes is that my MANIFEST.MF requires an additional line. This is an easy fix and in the next section I'll describe how to make it.

How to modify the Blog Sample



All of the sample source code and Ant build files can be found under WAS_HOME/feature_packs/aries/samples/blog. Before making any other changes you should modify the build.properties file in this directory so that the first line refers to your WAS_HOME, you will need this file to build code with later on.

The best way to fix the problem with the MANIFEST.MF is to create another version of the persistence bundle, it should be a 1.1.1 version since the fix is very small. To start with, create a new directory under WAS_HOME/feature_packs/aries/samples/blog called com.ibm.ws.eba.example.blog.persistence_1.1.1, then copy the entire contents of com.ibm.ws.eba.example.blog.persistece_1.1.0 into it. Two files need to be modified, the META_INF/MANIFEST.MF needs to be changed to add the pink highlights shown below:




be very careful with the Meta-Persistence: line, it must have a space after the colon and the code will not compile if it doesn't. The second file that needs a small modification is the build.xml file, the project name needs to end 1.1.1, not 1.1.0.

After making the changes, run the build.xml file in your new 1.1.1 directory, like this:

ant -propertyfile ../build.properties -buildfile build.xml


This will create the archive target/lib/com.ibm.ws.eba/blog.persistence_1.1.1.jar. To install the new archive, go back to the WAS console and repeat the steps for adding it to the internal bundle repository and making the Blog Asset use it. Finally, restart the Blog application, point the web browser to the Blog and hit refresh. Et voila! A new link has appeared so that comments can be added to the post. Here is a screen shot with a comment added:




How does it work?



This Blog sample is designed to demonstrate how easy it is to change bundles and how to use optional services. To make this work we had to think about how to design the sample to be able to use the additional comment service from the start. This isn't really unrealistic, how often have you had a complete design in mind but not had time to implement the whole thing before delivering it? In this case we stopped short of delivering the service in the first version but we were able to supply it as an upgrade with an almost undetectable interruption to the service.

The sample is designed so that the bundles can be maintained completely independently of each other - I want the ability to upgrade one bit at a time. This might be overkill for an application of this size but the principle applies to applications of any complexity.

The other thing I have rather glossed over is that I didn't change the database, again the database had to have the right structure for the comment service from the start. However, this follows fairly naturally from designing the application to expect to be able to use commenting.

The best way to understand what is happening when the application is running is to look at the META-INF.MANIFEST.MF and OSGI-INF/blueprint/blueprint.xml files for each bundle. As the code is fairly simple, it's easy to follow through to the Java code and see where properties are injected by the container as specified in the application blueprint.

In the next revision of the Beta release I will fix the mistake in the MANIFEST.MF and will also correct a horrible anti-pattern that I introduced in trying to keep the persistence blog layers separate. In fact, I'll buy a beer for anyone that can see it and send me a good fix for it!

Monday, February 8, 2010

Some Learning Experiences with XQuery/XSLT2

While working on a demo of XQuery, I ran into issues with the following things and wanted to share in case others new to XQuery could benefit. The demo was the first time I linked XQuery to Web 2.0 (was populating DOJO graphs from XML data) in an application.

First, DOJO is based upon JavaScript. When you write an XQuery that generates a dynamic web pages that mixes XQuery and DOJO, you need to be careful of the "{" character. JavaScript structures love to use the "{" character, as does XQuery. XQuery allows you to escape the "{" character by using "{{" (similarly for "}"). This isn't a huge issue once you realize what is going on as the XML Feature Pack will complain when compiling a XQuery + JavaScript program telling you that some XQuery script subsection isn't valid (its trying to interpret the JavaScript structure as XQuery).

Second, similar to a problem I had before, you have to be careful with namespaces. I had something like:


<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Title</title>
</head>
<body>
{
for $i in /some/path/in/input/document
return $i
}


And the some path in input document wasn't returning any data, even though I knew there was data at that path. The issue here is documented in the spec. The default namespace of xhtml in the direct constructor becomes the default namespace for the path step elements. I found the simplest way to fix this was to move the path logic into a declared function that was outside of the direct constructor where the XHTML default namespace wasn't in scope. I could have also re-declared the default namespace or prefixed all xhtml nodes, but that wouldn't look as clean.

Speaking of declared functions, I also was tripped up for a little bit by the fact that declared functions don't get the same context passed to them automatically as the does the main execution of the same module. This exhibited by the runtime telling that the path I was executing was invalid as the context was unknown. Again the spec tells me that the context is undefined. In order to deal with this, you just need to pass the context of interest to the function and have all relative paths work off of the passed context.

Finally, I did get tripped up on XSLT 2.0 as well. When running a stylesheet that took no direct input, I mistakenly called setXSLTInitialMode (good for defining multiple paths through a XSLT 2.0 stylesheet) instead of setXSLTInitialTemplate (good for loading data from multiple input docs or unparsed text, etc.). Luckily, the errors of IXJXE0793E and ERR XTDE0045 came out in the logs and helped me spot the code completion generated typo.

Hopefully some small help if, like myself, you're working to use XQuery/XSLT 2.0 more and more in your ever day coding. Now, if I could just stop typing ";" at the end of XQuery let statements.

Friday, February 5, 2010

The appliance form factor of WebSphere CloudBurst

As with most new technologies, the WebSphere CloudBurst Appliance inspires a healthy set of questions. As usual most of the questions are about features, capabilities, use cases, etc., yet there is one question that is quite frequent but a bit of an outlier from the preceding categories. Personally, I’m not sure I’ve talked to a group about WebSphere CloudBurst without getting this question. What's the question?

Why is WebSphere CloudBurst an appliance?

It is a very fair question and one whose frequency used to surprise me. I guess I should have seen it coming because save the WebSphere DataPower Appliance, the brand isn’t typically associated with hardware.

In this particular case though, I can confidently say the appliance was exactly the right form factor for the offering, and it comes down to three main reasons:

1) Consumability

2) Capability

3) Security

In general, appliances deliver a very high level of consumability or put another way, decreased time to value. WebSphere CloudBurst fits this mold. When you receive the appliance you hook it up to your network, do some one time initialization and you are up and ready to go. The appliance comes loaded with pre-built and ready to use virtual images and patterns. You simply define your cloud infrastructure to WebSphere CloudBurst and you can start deploying the shipped patterns or you can begin to build and deploy your own. Since the function provided by WebSphere CloudBurst is delivered on the appliance’s firmware, there is no need to install and subsequently maintain software on other machines. In addition, any updates to this function are delivered via firmware updates that can be applied directly from the appliance’s console.

From a capability perspective, appliances deliver right-sized, purpose-built compute resources. In particular, the WebSphere CloudBurst Appliance contains the right amount of processing power, memory, storage, etc. to meet its needs. In many ways, this points back to consumability in that you don’t have to hunt down the right set of hardware and storage because all of that is delivered on the appliance. In addition, the delivery of function (firmware) and hardware in one unit allows for optimization otherwise hard to achieve.

Lastly, and possibly most importantly, the appliance form factor of WebSphere CloudBurst provides for a very high level of security. To start, all of the contents stored on the appliance, whether they exist on the hard drive or flash drive, are encrypted by a private key. This private key is unique to each and every appliance and it cannot be modified. The appliance provides no way to upload and execute code. There is no shell with which you can interface, and the internals operate on “Just Enough Operating System” principles to decrease the attack surface even further. Finally, the appliance is physically secure. If someone were to remove the casing in an attempt to access the internals, the box is put into a dormant state and must be sent back to IBM before it can be used again. This is in no way an exhaustive list of security features, but hopefully it gives you some background on the high degree of security provided via the appliance form factor.

I hope this helps shed some light on the decision to deliver WebSphere CloudBurst as an appliance. If you have other questions about WebSphere CloudBurst check out my top ten FAQs, or leave a comment below.

Tuesday, January 26, 2010

DevX coverage of CEA, XML, and SCA Feature Packs

Here is a good DevX article that covers the values of the three WebSphere Application Server Version 7.0 Feature Packs - Communication Enabled Applications (CEA), XML (XQuery, XSLT 2.0, XPath 2.0) Applications, and Service Component Architecture (SCA). It also covers why our strategy of feature packs helps our customers save money, get functions easier, and have more stable environments.

Friday, January 22, 2010

The WebSphere CloudBurst Appliance

Up to this point, we haven't discussed the WebSphere CloudBurst Appliance too much on this blog (though I've been writing about it extensively here). So if you have been following and reading along here and have only casually heard of this new appliance, you may be asking yourself "What is it?" and "What does it do?" Given that, I thought it was about time we provided a brief overview of WebSphere CloudBurst on the WebSphere Community Blog.

Very simply put, WebSphere CloudBurst is a cloud management device provided in an appliance form factor. It provides you with the capabilities to create, deploy, and manage virtualized WebSphere application environments in an on-premise cloud. Laying the foundation for the cloud-based application environment lifecycle capability provided by WebSphere CloudBurst are special virtual images. These virtual images, which are provided and maintained by IBM, provide pre-installed, pre-configured software stacks that include everything from the operating system all the way through the IBM Software middleware tier. As of right now there are three different IBM Software offerings packaged in this virtual image format: WebSphere Application Server (generally available in 6.1 and 7.0 versions), WebSphere Portal 6.1.5 (Beta version), and DB2 Enterprise 9.7 (trial).

Why did I refer to the virtual images as building blocks? Because from these virtual images WebSphere CloudBurst patterns are built. A pattern is a complete representation of your middleware application environment. The appliance comes pre-loaded with a set of best-practice patterns, and you can also build your own. A custom pattern will include the topology (i.e. the number of application server nodes, management nodes, databases, etc.) you desire, as well as your custom configuration like your applications that run in the environment. As an example, here’s a screenshot of a WebSphere Application Server pattern I built using WebSphere CloudBurst:

Once you build your custom application environment in the form of a WebSphere CloudBurst pattern, you can use the appliance to dispense it to your on-premise cloud. This cloud, consisting of a pool of hypervisors (both VMware and PowerVM platforms are supported) and associated compute resources like memory, storage, CPU, and IP addresses, is defined to and managed by the appliance. When deploying your patterns into the cloud, WebSphere CloudBurst uses an intelligent placement algorithm that considers things like available compute resource and high availability to ensure that your application environment runs as safely and efficiently as possible.

The end result of deployment is a fully functional WebSphere middleware environment running in one or more virtual machines. These environments offer the same capabilities and function as if you had deployed them in a more traditional manner, so you can run the same applications you use now unchanged. In addition, you can use WebSphere CloudBurst to apply fixes and upgrades to your application environments in a simple, fast and safe manner, and you can easily remove an environment when you are no longer using it thus returning resources to your cloud.

In my opinion, this is one of those things that is easier to understand when seen. In that regard, I’ve put together quite a few short demonstrations that highlight different features and capabilities of the appliance. If you are interested in reading more, I mentioned a blog earlier, and we have quite a few articles available on developerWorks.

Jerry's 2010 WebSphere Trends


Just in case you missed it, our WebSphere CTO, Jerry Cuomo, has released his top trends for 2010. Read more to learn about our trends towards Agile Delivery and Development, Business Driven IT, and Extreme Transaction Optimization and listen to the video to find out more information on the effects to the WebSphere platform.