Brandon Werner

Archive for the ‘Service Oriented Architecture’ Category

Eclipse Modeling Framework Examination and that mean Websphere Error.

Thursday, April 19th, 2007

The Eclipse Modeling Framework (EMF) is one of the least understood and most powerful frameworks ever handed down to us mortals by IBM. Often confused with providing UML modeling capability in Eclipse and the Rational toolset (that’s actually the UML2 Framework) EMF concerns models in the meta-data sense, and is, in essence, an abstraction engine for data and code. The fact that Service Data Objects (SDOs), one of the two frameworks of the holy SOA stack (SDO/SCA), is built on top of EMF points to it’s power.

Sadly, most of us often encounter EMF only as some tool failure where we get an .Ecore error or some other nasty issue, and we usually reverse tracks instead of digging in to the mysterious innards of Eclipse. It was in this scenario I discovered a problem with EMF and Websphere, and I’m certain from the message board posts it’s gonna get a whole lot worse before it gets better. Luckily, there is a simple way around it.

The EMF Error

If you do any deployment on Websphere 5.x and higher, particularly it seems now that version 7 of the IBM Rational Platform is out, and use EMF either in SDOs or other parsing technologies, you’re going to run in to this error:


java.lang.IllegalArgumentException: resolve against non-hierarchical or relative base
at org.eclipse.emf.common.util.URI.resolve(URI.java:1853)

This is all the information you get, and it can be maddening. I was forced to face this error recently when trying to load in a xsd file in to an SDO from a relative URL. You can duplicate this problem by running the code below:

public class Test1 {

private static final String PO_MODEL = "po.xsd";
private static final String PO_XML = "po.xml";

private static void definePOTypes() throws Exception {
FileInputStream fis = new FileInputStream(PO_MODEL);
XSDHelper.INSTANCE.define(fis, null); // In Websphere container this will fail
fis.close();
}
}

public static void main(String[] args) throws Exception {
definePOTypes();


FileInputStream fis = new FileOutputStream(PO_XML);
XMLDocumentImpl xmlDoc = XMLHelper.INSTANCE.load(fis);
DataObject purchaseOrder = xmlDoc.getRootObject();

Of particular interest is this line here:


XSDHelper.INSTANCE.define(fis, null); // In Websphere container this will fail

Explanation Of Error And How EMF Determines Runtime Hierarchies

This XSDHelper simply takes an XSD (either String or stream) and prepares the SDO. In essence, the XSD gets parsed so that the SDO can apply the XML or any other data it gets to the XSD for Type validation. This XSDHelper is just a wrapper around EMF, which takes the XSD and begins to fit it in to a meta-model that Java can deal with. What is interesting is what EMF does under the covers, and for this we need to know about the URI class in EMF, and in particular the resolve method.

Recall the class we got the error from:


at org.eclipse.emf.common.util.URI.resolve(URI.java:1853)

The URI class in EMF is simply a representation of a Uniform Resource Identifier (URI), as specified by RFC 2396, with certain enhancements. Like String, URI is an immutable class; a URI instance offers several by-value methods that return a new URI object based on its current state. Most useful, a relative URI can be resolved (that’s the resolve() method in the error we got) against a base absolute URI — the latter typically identifies the document in which the former appears.

It’s finding this absolute base URI that EMF is having the problem with when it says “resolve against non-hierarchical or relative base”. Why does it always want to resolve a base absolute URI? Think of the situation poor EMF is in when it gets a relative URI. What if your XSD refers to other XSDs (po-folk.xsd)? What if it specifies other relative links in relation to it’s own place in an heirarchy(../po-folk.xsd)? EMF can’t deal with that unless it knows exacly where it is in your filesystem or URI landscape.

EMF And Websphere

So, now we know how that works, but what’s wrong with getting the absolute base URI in Websphere?

Well, let’s talk about those “certain enhancements” IBM mentions when talking about the URI class. Even though you probably don’t think about it, almost everything you access in a Java runtime is some kind of archive, no matter if it’s Jar or Zip. Even if you don’t think your working inside a JAR, if you’re running an IDE chances are you are. One enhancement in the URI class of EMF provides support for the hierarchical form used for files within archives, such as the JAR scheme. By default, this support is enabled for absolute URIs with scheme equal to “jar”, “zip”, or “archive” (ignoring case), and is implemented by a hierarchical URI, whose authority includes the entire URI of the archive, up to and including the ! character.

If we would ask EMF for the absolute base URI of the po.xml file in a typical Java application, we would see this:


jar:file:/C:/workspace/test/xsd.resources.jar!/org/eclipse/xsd/po.xsd

This is the URI, with the absolute base URI being “jar:file:/C:”. EMF would be confident all things could be found in relation to this root location.

Now, what happens if we do the same thing in Websphere?


wsjar:file:/C:/workspace/test/xsd.resources.jar!/org/eclipse/xsd/po.xsd

What’s that? A non-standard archive scheme called “wsjar”?. It would appear that IBM, never content with being standard, has an archive scheme that is completely different from one if you were to access a Jar file from outside the container.

What happens when EMF tries to get an absolute base URI when it doesn’t know the archive scheme of the file it’s looking it up for?


java.lang.IllegalArgumentException: resolve against non-hierarchical or relative base
at org.eclipse.emf.common.util.URI.resolve(URI.java:1853)

How To Fix It

Now we know what we’re dealing with. How do we fix it?

Well, all we need to do is let EMF know there is another archive scheme it needs to keep an eye out for, and you can do that two ways.

At the command line:


-Dorg.eclipse.emf.common.util.URI.archiveSchemes="wsjar wszip jar zip"

Or set it up in your WAS configuration as a JVM property.

I hope you learned something interesting about absolute base URIs and stumbled upon this article before you shed too many tears. I don’t know why more people are experiencing this problem with WAS and Rational Application Developer / Rational Software Architect 7, but hopefully IBM will see it fit to provide an EMF in Eclipse that has these new archive schemas built in. Lots of headaches could be solved.

From Legacy to Service-Oriented Architecture: The Strategic Importance of Services in the Insurance Industry

Friday, February 16th, 2007

I will speaking at the IBM Rational Software Developer Conference 2007 at the Walt Disney World Dolphin Resort June 12th, 2007 @ 11:30am (BBT07). This will be the first presentation I’ve done focused on one industry segment, and although I know that IBM has purchased Webify for it’s Insurance specific stack, I won’t be presenting that but instead some pitfalls and good ways forward for moving from a Legacy environment to a SOA using Websphere Process Server.

When I wrote my piece on IBM’s Websphere Process Server and it’s purchase of Webify, Robert LeBlanc, General Manager of WebSphere, forwarded it to Steve Mills, and the sparks flew (RedMonk’s James Govenor confessed it was him who forwarded it on to Robert). I understand, given the large amount of interest in these products, why such a public critism would cause concern, but there was a fair amount of praise for what WPS and WID has accomplished in the SOA space, particularly in the important (and thus far in Computer Science, elusive) goal of making a visual BPEL/development tool. This presentation will be along those lines; how to practically use these tools to create an even more compelling architecture without too much Legacy headache using Webpshere Integration Developer and Websphere Process Server.

Try to join me if you can, and if you are going to RSDC 2007 drop me a line so we can meet up and have a beer.

XML, Semantic Web & Data Intelligence: More Conference Info

Tuesday, January 23rd, 2007

I have been asked to present my work: “The Future of ACORD: Using Data Standards In The Semantic Web” at the Insurance Industry’s major conference ACORD-LOMA Insurance Systems Forum from May 20th - 22nd at the Dolphin Resort at Disney World. Since Microsoft and IBM are platnum sponsers, I’m expecting lots of free stuff :-) At least, more than you get speaking at the Rational Conference.

I have included the detailed snippet from the brochure below, and more information about when I’m scheduled should appear on the website after February 2nd when I deliver all my media information (my head shots from junior high apparently don’t cut it anymore)

My primary thesis is how to use the language in which we communicate, XML (here ACORD standard) and apply meta-data to enable us to gain insight and increase both human and machine understanding of the data we have, essentially helping us make better decisions. It’s easy to see how a system knowing what a policy or a named-insured is beyond just an XML tag can benefit decision making systems including competative rating and data mining for risk patterns in insurance. All of this is based off of using RDF and Ontologies (here developed for insurance) to make relationships between data. Imagine how much more valuable a data warehousing operation would be with this solution.

I think you’ll like it and I hope you can make it.

My question to you is: Do you think the industry is ready, having just now got up to speed with webservices and Service Oriented Architecture, to apply meta-data to our language? Although the benefits of making the semantic leap are real, is it realisitic in the near future?

My Presentation Brochure Detail Snippet

XML, as a describer and standardization of data and datatypes, are changing as we move in to a future where humans won’t be consuming data as much as other computers will. The Semantic web is about metadata, or “data about data” that tells computers what type of data it is, and it’s context. It is about a language for recording how the data relates to real world objects. This allows a person, or a machine, to start off in one database, and then move through an unending set of databases which are connected not by wires but by being about the same thing.

For the insurance industry, this transformation can bring incredible advances and solutions to the problems we are experiencing as an industry that XML and webservices alone can’t solve, including managing large amounts of data and customer information. In the Semantic Web, for instance, we can know what products may interest a customer through relationships built from their CLUE reports and their preferences or send self-describing products to agents without any upfront setup. Most importantly, it can be used in data warehousing applications to allow insurance companies to create their own meaning from their customer data for better rating by deploying reasoning systems to determine what risks are related to what datasets deeper than ever before.

ACORD standards will play the lead in this, and companies that are adopting ACORD standards in managing their business communications now, especially using ACORD in their webservices, will have a lead in this advancement. ACORD can become “richer” when paired with RDF documents that not only enforce the standards, but describe them as well.

In my presentation, I will demonstrate the future value of deploying these reasoning systems, demonstrate the work I’ve done in developing reasoning systems for ACORD formatted data, demonstrate a sample using Firefox and MIT’s Piggy Bank plug-in (http://simile.mit.edu/piggy-bank/ ) of a future ACORD standard based website that will show a customer, the products they may like and the best rate; all from self-describing meta-data and without any code (only the data itself)

I work with MIT’s Semantic Web SIMILE (http://simile.mit.edu/) project as well as invented and run the opensource cl-semantic project (http://common-lisp.net/project/cl-semantic/ ) that uses Lisp to discover relationships between data for automatic processing and the realization of patterns, geared specifically towards insurance and other probability based businesses. I have also been involved in research creating a RDF version of the ACORD standards (the subset of Surety) to allow ACORD standards to be used in a Semantic Web demonstration. I am also an ACORD voting member of the Casualty/Surety working group and sub-groups underneath. I am well known in the industry for my work, and you can browse my referred and non-referred research papers from my website (http://www.brandonwerner.com).

Conferences So Far For 2007

Saturday, December 16th, 2006

As the year draws to a close, I realize I haven’t been conference jumping as much as I use to, but did want to draw attention to a few places I will be presenting sessions for. If you are attending, be sure to say hello. More information on times when it becomes available.

ACORD LOMA Insurance Systems Forum
May 20 - 22nd 2007
Lake Buena Vista, FL
My Session: Future of ACORD: Using Data Standards In The Semantic Web

IBM Rational Software Development Conference 2007
10-14 Jun 2007
Orlando, FL
My Session: Websphere Process Server and SOA For Insurance

SOA Goes Vertical: But IBM Still Not There Yet.

Thursday, August 3rd, 2006

Much has been made about the purchase of Webify by IBM a few days ago, and for good reason. This is the first time that a large company has put it’s money where it’s SOA mouth has been all this time. Despite the enthusiasm such a purchase as created among the SOA community (especially smaller groups specializing in vertical markets such as Insurance), the bigger point this purchase makes is that despite all the marketing blitz and betting of the Enterprise Software market on SOA by large players, it’s the small players who seem to be doing it right. IBM, for it’s sake, has so far failed in it’s SOA products for specific industries, and it’s purchase of Webify demonstrates their weakness in developing their own custom SOA solutions.

Sadly, I have been in the position to experience this failure first hand.

I am currently neck deep in an Insurance SOA experiment with IBM as we speak, structured primarily around WPS (Websphere Process Server), SDO (Service Data Objects), Websphere Integration Developer IDE and all the rules engines you can imagine. In the SOA future, no matter what the business, business rules (BPEL) that drive the business processes in our environment will be the most important aspect of the Service Oriented Architecture. It is these mediation flows consuming and transforming messages on the ESB that give a large enterprise the flexibility that SOA promises in rapidly exposing and using services to respond to business needs. For an industry such as Insurance, the business rules and services are some of the most complex and highly regulated in the business world. In IBM’s SOA view, Websphere Process Server is the engine that combines Connectors, transformations of ESB messages and mediation flows all in one package. At least, that was the plan.

We were one of the first to attempt to use WPS in partnership with IBM, and we came in to the experiment with great enthusiasm. After all, insurance is a field ripe for taking control of complex business rules. However, some attempts we have made to stretch or conform WPS to our liking has met with failure on IBM’s side. This includes the following issues:

  • Consuming SOAP with attachments to convert a message to a ESB compatible Business Object or SDO is not possible
  • Consuming webservice messages not HTTP or other standard form is tedious
  • Numerous .xx releases to WPS and its development environment, Rational Integration Developer, has been IBM’s usual reply to issues with service connectors and visual mapping of services to Business Objects*.

This isn’t to say IBM’s suite of products in the SOA space isn’t impressive. Their Integration Developer IDE, built on top of Eclipse in much the same way Rational Software Architect and Rational Application Developer are (indeed, it’s just a few extra plug-ins), is amazing in it’s ability to attempt to consume external webservices and transform them in to SDOs that are controlled through the use of BEPL through-out the synapse. The problem is that the technology isn’t quite working yet, something that is disappointing when SOA has already made such inroads in the marketplace.
To this point, we are scaling back our strategy of using WPS in our new SOA architecture until the product matures, a very sad real world lesson to the marketing websites and seminars IBM is currently pitching. Keep in mind we’ve not stepped outside of IBM’s technology ecosystem once so far, including using every single piece of Websphere branded application server and Component we can license.

Although I developed the architecture of the SOA migration, including an inventive strategy to wrap existing non-SOA capable services to create custom SDOs for our ESB (some of which is hinted at when I published my SDO pattern for Rational Software Architect), the primary pain has been experienced by our Integration Team who are trying to get Websphere Process Server and it’s various services to work according to our designs. It is here, in the constant PMRs with IBM in nose-bleed level support tiers, that we are getting the most reality.

Insurance, as I stated, is a tricky business to begin with, and IBM was right in realizing that when it came to this vertical market, it needed someone who knew what it was doing. However, given my experience with IBM’s SOA products to date, they are going to need much more help than Webify can provide.

* - “Business Objects” is IBM’s term for SDOs generated from messages in WPS. It does not conform to the idea of “Business Objects” from an architecture stand-point. At this point, we should probably rename BOs from Fowler’s viewpoint since it is widely mis-used.

The Service Data Object (SDO) Pattern For Rational Software Architect

Wednesday, June 14th, 2006

As I was architecting some software lately, I noticed that the DeveloperWorks Reusable Asset directory had all the Enterprise and Security patterns, but the SDO pattern was sadly missing.

The Service Data Object is one of the most powerful tools in abstracting any data from it’s datasource, and is used heavily by enterprise architects and developers in Service Oriented Architectures (SOA) and in DAO patterns where you may have different data sources and abstraction is key. The SDO gives you built-in ChangeSummary ability, so that you can automatically update your datasource or XML with new data after you’ve finished using the SDO! Also, the SDO itself is serializable.

I am currently finishing an article about SDO and how to create a poor-man’s SOA from existing Business Objects using the SDO. Look for that somewhere soon.

In Rational Software Architect, having patterns in your Pattern Repository that you can drag and drop in to your Analysis or Design diagrams is essential to ensuring you’ve designed your own products correctly, and that you have the best representation of the pattern in your environment. With that in mind, I have recreated in complete detail the Service Data Object pattern here so that many SOA and DAO developers and architects can simply import it in to their RSA through Import –> RAS Asset and use it.

About The Pattern

I have included documentation from the ServiceDataObject specification Version 2.0 and have relied on several IBM and EMF document sources from DeveloperWorks and the SDO specification itself to create one pattern that seems to take in all the various text based and UML based examples of this pattern.

The completeness of this pattern is very important, so if you find anything wrong or would like to make suggestions either edit the included java file and send it along or comment to this thread.

This is an example of how it should look in your design document after you have filled out the pattern template completely and dragged the classes on to your design.

SDO Pattern in RSA

Click for larger view above.

Because of my current project name, the pattern will appear under Maestro -> Core Patterns, but you are free to copy / paste it where you like after import.

Download Files

Here is the Java file and the RAS file if you would like to do your own patterns or see how I made the associations I did above. To use the RAS file, simply do an Import... RAS Asset in your Rational Software Architect product.

  1. ServiceDataObject.java
  2. Service Data Object RAS File

Congrats to Floyd Marinescu, creator of Server Side did it again

Thursday, June 8th, 2006

My buddy Floyd Marinescu, author of the best-seller EJB Design Patterns and the creator of TheServerSide.com has officially launched his latest enterprise community website, InfoQ.com. When he left the server side last year, I was floored. TheServerSide.com was, under Floyd’s leadership, one of the best places for enterprise programming.

The new site expands the enterprise world away from Java-only coverage, and takes on both horizonal topics like Java, Ruby and .Net and vertical topics like Agile, SOA and patterns. It’s also very fresh and clean with easy navigation and quick reference to information.

I promised him I’d write something for him for the new site, but I got bogged down with my work and couldn’t do it. I’m certain, given the success after the launch at JavaOne 2006, they certainly don’t need my help

Read more about it here

P.S. I meant to write about this sooner after the launch party, but I accedentially called him on Skype tonight (he’s stuck right below Bruce Tate and Dick Wall) and it jogged my memory. Add it to your links and sign up!

End of EJB Gaining Momentum?

Thursday, February 9th, 2006

Last month I wrote an article called “How To Save J2EE, And It’s Not EJB 3.0” that sparked a lot of controversy and a public spat with Gavin King (inventor of Hibernate and spec lead of EJB 3.0).

I argued that Java on the enterprise should be moved forward as a set of patterns and best practices, not just a set of JCP approved technologies. In other words, before you had an entire architecture (J2EE) and your designs at the application level had to conform to the architecture of the blessed JCP specification.

Or, in the words of a Jewish proverb, “You cannot break the law, you can only break yourself against the law.”

Well, it turns out that you can also change the law. That’s what I argued in my article, stating that people might not want to get wrapped up in EJB 3.0 propaganda and instead continue to use Hibernate and Spring, as well as push for new technologies that can be applied in a JEE context.

In other words, architecture becomes less important, and design extremely important as businesses develop applications that are more agile and service oriented. Most important, they can customize their JEE space to their business needs, not import the whole elephant just because you want the trunk.
A direct out-growth of that idea is a new article at O’Reilly’s OnJava called “J2EE Without the Application Server” by Guy Pardon, which gives good examples of practical design strategies for non-ejb J2EE development.

That is why I am very excited about JBoss going forward, and very nervous about hearing Oracle was looking to buy them. JBoss might be the way all application servers will look in the future, a pluggable framework of services (some JCP, some not) that offer to annotate a container with functionaity but is light-weight and flexable. You pick the architecture pieces, then design.

I’m sorry Sun, but I think the EJB ship has sailed. It was a good idea that never worked, at least not as transparently as the idea of “JavaBeans that persist state” would suggest.

ServiceLocator Pattern: A History and Does EJB 3 Really Kill It Off?

Monday, January 16th, 2006

Soon, ServiceLocator will be replaced by Dependency Injection (also known as Inversion of Control) type annotations in EJB 3. However, as these annotations won’t be available to helper classes like current JNDI lookups are, the ServiceLocator singleton might still be around even after EJB 3’s release, to the dislike of many Singleton haters.

There are some caveats to IoC in EJB3:

  1. They are not be available to non-ejb programmers or in helper classes
  2. Those who use Composite Entity patterns in their JEE architecture will not have JNDI look-ups available to them in their Dependent Objects and must aquire all their resources from the EJB itself.
  3. Those who use Session Facades and Business Delegate patterns for more than EJB lookups will have to continue to rely on JNDI lookups and ServiceLocator.
  4. The way IoC is implemented in EJB3 leaves a lot to be desired (not just POJOs with XML files like Spring)
  5. This means that those who prefer (or are mandated) to use light-weight web frameworks and code for small to medium web applications will be stuck with JNDI look-ups and ServiceLocator(s) for some time to come.

Therefore, this article seeks to help people who want an honest comparison between the two methods of operation, about where we got where we are today, and how migrating from JDK 1.4.2 to JDK 1.5 might change their ServiceLocator pattern to reflect Java 5 Generics, since ServiceLocator makes heavy use of Collections API to cache JNDI lookups for services.

Do to formatting issues in Internet Explorer regarding all the code samples I used, it’s best if you just read this article on JavaLobby instead: ServiceLocator Pattern: Does EJB 3 Really Kill It Off?.

Are we gonna bash Restlet next?

Friday, January 13th, 2006

I got a lot of heat for stating that the way to save Java EE was to focus on architecture and not concrete JCP implementations. Although my metaphor regarding AJAX was over-represented in the press, I still believe that we shouldn’t be so concerned about using non-JCP technology in implementing Java EE architecture.

As I stated a few weeks ago:

If I am an enterprise developer, and the architect has done his job of abstracting DAO and dependent objects from the Business Objects, I can quickly plug and play from Spring to EJB 3.0 quickly. That was the whole point of DAO patterns in the EJB 1.x and early EJB 2.x days; so that when this mythical time came when CMP EJBs were fast and ready for wide deployment we could just implement that, clean the overrides and slice off the DAO / JDBC side… Why was it acceptable to do this during the J2EE 1.4 days with EJBs, but is sacrilegious to do so now to allow for Spring vs. EJB 3.0 plug-and-play? How does it not help JEE principles to write Adapter patterns to do this anymore than it did to abstract the dependent objects from DAO or to incorporate XML web service processing in our Business Delegate patterns using the Delegate Adapter Strategy?

I got knocked by Gavin pretty hard on talking down EJB 3.0, but I can’t help but think that now that his technology has been integrated in to the JCP (i.e. he won) he has become a little bit of a cheer leader for all things JCP. I wonder what he would think of Jerome Louvel’s Restlet project, a implementation of Roy T. Fielding’s excellent doctorial thesis on the REST architecture style.

The Servlet API has grown significantly over the last few years, with the addition of JSP, JSF and web service consuming all being stapled on top of the common API. Essentially, anything that has to do with HTTP travels through servlets. Although extremely simple and flexible at the base level, which has allowed for so much to be implemented on top of it, it has begun to show it’s age in its general philosophy towards persistence and mapping of sessions. Restlet is a replacement for the Servlet API and provides a lot of advantages over Servlets in HTTP communication, particularly for web services. Why has Restlet generated so much attention lately? Simply put, once again someone has decided to throw off the shackles of JCP-implied restrictions and write a solution that does not have to be crippled by the problems of the previous architecture (NIO blocking, session persistence). As we move in to thinking about SOA and the speed to which we can access and process web services from the ESB, Restlets might have appeared at just the right time.

What Spring and Hibernate did to EJB 2.x and J2EE in general, Restlet promises to do to the Servlet API.

This could mean more than just a replacement of course, but an eventual adoption and approval by the JCP. Just like Hibernate and Spring did to EJB persistence and Dependency Injection (killing my favorite asexual pattern, the Singleton), even a change in mind-set or “what is possible” could impact the next round of JCP submissions. In fact, This may already be happening as we speak.

This addition of Restlet to the Java EE open source landscape confirms what I have stated about programming to the problem domain using JEE best practices instead of just writing to the JCP specification. Those Jave EE architects who model the problem with an open mind when picking the best technologies for their next start-up or super-go-fast project will be the winners and push Java as a platform forward, particularly in SOA implementations where Java does not have the web service speed advantage.

As Gavin pointed out in his response to me, developers in Fortune 500 companies won’t be using Restlets, but then again they didn’t use Hibernate or Spring either. Although it is certain that these larger companies will always write to the vendor-pitched JCP standards, I believe that this is a demonstration of a weakness, not a strength. After all, what disruptive new way of doing something did any established company introduce? Why do they always kick themselves and try to catch up, when the obvious answer all along is that you don’t change things unless you are willing to take risks in technology?

Restlets, and its implications on the performance and flexibility of web services, is such a risk that could yield huge rewards. Unfortunately, the next Google (or maybe Google itself) will be the ones that deliver on this reward, while IBM and Sun will be demonstrating their Servlet tied technologies to Fortune 500 companies that will gawk at the idea of using such slow communication to and from their new SOA inspired Enterprise Service Bus.

But hey, at least it’s JCP approved and backwards compatible.