If you’re working with Drools trunk snapshots, you may be tripping over a bug in MVEL that caused me to lose about a day. On the RHS (right-hand side, the consequence) of my rule I had the following:
Which resulted in this error: [Error: unable to access property (null parent): $obj]
However, if I call an accessor or otherwise do something with the object before passing it off to the constructor, it works fine:
Right now this appears to be a problem in MVEL, but I don’t know enough about the internals of Drools of MVEL to say for sure. Ideally this workaround will keep you moving forward.
nick Entry drools, java
Monday saw the rather surprising announcement that VMware is acquiring SpringSource for about $420m all in. After the initial shock wore off, the next question had to be: Why bother acquiring SpringSource in the first place? According to the press release:
VMware and SpringSource plan to deliver compelling new solutions that enable companies to more efficiently build, run and manage applications within both internal and external cloud architectures.
So VMware is going to attempt to use SpringSource’s code to virtualize application deployments and management. Given Spring’s hooks into several application frameworks, it’s certainly possible but by no means guaranteed.
With a recent stock downgrade (from Buy to Underperform), VMware has to make something happen quickly to justify spending over $400m for glorified middleware.
VMware shares are down just over 2% today.
nick Entry acquisitions, spring, vmware
Recently I needed to be able to be able to query a bunch of XML files using XQuery. I looked at some options like CouchDB but ultimately I needed a database of some sort that had native support for XQuery. While it looks like you can add on or hack in XQuery support to CouchDB, I preferred to keep things simple and went with eXist.
eXist allows you to store XML documents, with supporting DTDs and schemas, and access the collections using various mechanisms like REST or WebDAV. Once you have a number of XML documents in your repository, issuing an XQuery using the REST interface is pretty simple:
The above query will return a something like:
You can learn more about XQuery’s FLWOR structure here.
But eXist is more than just an XML store. By supporting XPath, XUpdate and XQuery Update, as well as custom extensions, eXist can be an application platform. I’m looking forward to working with XForms and Wicket in the future and I believe eXist will play heavily in that.
nick Entry exist, xml, xquery
Congrats to Andrew over at Mystic Coders for releasing his Wicket reference card over at DZone.
Of course, I’m probably going to take his refcard text and work it into WicketForge.
nick Entry wicket, wicketforge
Like it or not, if you’re writing code today you’re going to have to deal with consuming and producing XML. From my experience, one of the best options to manage the heavy lifting surrounding XML. However finding useful information on JAXB is difficult, with various forum posts and mailing lists, most information is out of date. Luckily Wolfgang Laun has created an outstanding tutorial. Wolfgang’s tutorial is possibly the most comprehensive (and most current) information on every aspect of JAXB. I highly recommend it both as a getting started guide and a reference.
nick Entry jaxb tutorial xml java
Some time ago I read the excellent Enterprise Integration Patterns book and I’ve wanted to leverage the concepts detailed in the book in my own work. Eventually I found the Apache Camel project and have been impressed with how quickly I was able to integrate it into my application.
Camel is essentially a message router that allows you define routing and mediation rules using either a domain specific language (DSL) or XML. Here’s an example of a rule I’m currently using in production:
This is an asynchronous route that accepts an incoming XML payload via JMS and routes it to the correct filter component based on the root element. (While the filter component is a custom component, but it could just as easily be a simple bean invocation, or any other component supported by Camel.)
The more time I spend exploring Camel, the more impressed I am with it. I plan on making it a permanent fixture in my application stack for client projects.
nick Entry camel, spring
WicketForge 0.5.4 was released last night, correcting a few ClassCastException bugs and adding another Wicket XHTML to the list of tags available to be completed. This release doesn’t yet add the properties file support I’ve been working on, but I’m hoping to get time to finish that up shortly.
To update to 0.5.4, please run your IDEA plugin updater.
nick Entry idea, wicket, wicketforge
To most of us, sending a text message is magic. Simply enter your short message content, select a recipient, and send. From there, the message arrives in the recipient’s inbox to be read or ignored. For this privilege, wireless customers pay about $0.20/message unless they have a prepaid package. How the message pricing is determined is essentially a black art, and the subject of a recent NYT article (registration required).
The most interesting point in the article is that once the carrier costs are covered, it doesn’t matter if a tower conveys a hundred messages or a million. While revenue per message has been falling, the volume of messages has been skyrocketing and will continue to do so.
nick Entry mobility, texting
American Airlines has introduced Mobile Boarding Pass, which allows you to avoid having to print a boarding pass at home. Instead, a link to the boarding pass is emailed to your device. You follow the link to retrieve a device-only version of your boarding pass which can be shown to security and gate personnel. Currently, you can only use this for non-stop flights from Chicago O’Hare, LAX or Santa Anna, so it’s extremely limited. The other obvious problem is showing your boarding pass after you pass through the metal detector - you can’t take your phone through the detector, so how can you show the boarding pass after you pass through?
More information on Mobile Boarding Pass can be found here.
nick Entry airlines, mobility
At a recent event in Denver, some of our integration partners complained about the namespace prefixes in the XML we generated. By default, JAXB creates simple prefixes like “ns1″, “ns2″ and so on. I’m not sure it matters unless you’re processing XML using some archaic means, but keeping partners happy is usually a good idea, so I turned to the JAXB API.
JAXB makes prefix customization pretty easy through the NamespacePrefixMapper class, found in the com.sun.xml.bind.marshaller package. The abstract class has one method to implement:
From here, it’s a simple matter of returning the prefix you want for a given namespace, then telling your JAXBContext about your implementation:
If you’re also using javax.xml.xpath.XPath, your NamespacePrefixMapper can also implement javax.xml.namespace.NamespaceContext, centralizing your namespace customization in a single class.
nick Entry java, jaxb, namespace customization, xml, xpath
It can take years to build a solid reputation in any industry, especially in the phone service business. While it’s hard to recall, Sprint had a glowing reputation, with good customer service and a strong network. A number of network problems, like the Great Nextel Failure of 2006 and increasingly horrible customer service pushed customers away in droves - mostly into the arms of AT&T Wireless and Verizon.
Sprint’s looking to turn the corner after hiring former AT&T Wireless CEO Dan Hesse. USA Today ran an interview with him yesterday. While he doesn’t list many specifics outside of changing the corporate culture and reliance on WiMax in the future, he seems confident that he can stop the bleeding.
Hesse’s main focus seems to be on differentiating Sprint from other carrier. It’s not a bad plan - you always want to be disruptive. To differentiate Sprint, they should fix their customer service and capitalize on the Nextel services that so many customers left in late 2006. Devices really don’t matter. Service and pricing matters.
If Hesse can’t do it, maybe Microsoft should buy them.
nick Entry mobility, sprint
When I started System Mobile, one of the most challenging things was determining how much to charge clients for projects. At first, estimates were more of a guess than the result of a process. As I became more knowledgeable about projects and various clients, my estimates became more precise.
The popular blog FreelanceSwitch has an article on determining what your time is worth and discusses the pros and cons of charging hourly versus charging by project.
nick Entry consulting, self-employment
Anyone that’s spent some time with Java has made use of reflection, which can be loosely defined as Java’s ability to programmatically interrogate a class and call methods on it. Reflection is typically used in frameworks to call property accessors. Within Wicket, reflection is used to retrieve and populate properties using the PropertyModel. Suppose you’ve got a Person class with two properties: firstName and lastName, with the relevant accessors. Your PropertyModel would look like:
Easy enough, right? Where the process breaks down is the string referring to the firstName property. What if the property changes? You won’t know until you try the page or your unit test fails. This is where CGLIB comes in.
A Wicket user working on a project came up with the idea to use CGLIB proxies to bind object properties to components, taking you from this:
to this:
It’s slightly more verbose, but it allows you to know if your property names have changed at compile-time rather than runtime.
Is this in Wicket yet? No, it was just brought up on the Wicket list yesterday, but a number of people are excited about it. It will likely end up in an extension or Wicket-Stuff rather than the core framework. You can follow the discussion here: http://www.nabble.com/CompoundModel-based-on-proxies-td15317807.html
nick Entry cglib, wicket
Various people have responded about my Maven complaint, suggesting explicitly excluding the JAR. I tried it, and it didn’t work. Like I said, I’m new to Maven so it’s possible I missed a “simpler” fix.
nick Entry java, maven
Some time ago I posted about my experiment with Kiva, a website coordinating microcredit loans. My initial loan was $100 divided over four business. While that doesn’t seem like a significant amount, my $25 was combined with several other creditors to meet the full loan amount of the various businesses. Kiva suggests smaller loan amounts in order to minimize your risk.
So far, two of the four businesses have repaid the loans in full, ahead of their repayment schedule. I reloaned the funds to additional businesses. The remaining businesses are still meeting their repayments on time. The process seems to be working, and working quite well.
If you’re like me and consider most charities to be inefficient at best and wastes of money at worst, supporting people with microcredits might be for you.
nick Entry kiva, microcredits
A new project I’m on requires the use of both XFire, for Crowd’s Java Client, as well as CXF, for everything else. Of course, XFire and CXF both require the XmlSchema library, but the POMs for each require different versions of if. XFire’s POM uses version 1.1 while CXF uses 1.3.2. Both versions are downloaded and 1.1 is loaded in the classpath first, causing various problems with CXF.
After fighting this and losing half a day, I eventually had to setup my own Maven repository for XFire, changing its dependency to 1.3.2. Along the way I had to update the POM hashes or Maven wouldn’t use the POM to resolve dependencies.
I’m relatively new to Maven and it’s possible I’ve overlooked something, but this problem shouldn’t have been that hard to solve. Hopefully Don’s work on Maven will yield some improvements in Maven. Otherwise, I’m sticking with Ant.
nick Entry
With Apache Wicket 1.3.0 out for a while now, it was time to finish my article and turn it over to TSS to publish. The article went up yesterday and the response has been very positive so far.
I’m hoping to make this a short series, although future articles probably won’t be 22 pages long. If you’ve read the article, I’m always interested in your feedback.
nick Entry java, wicket
I had an opportunity to speak with Paul Krill over at InfoWorld about the Apache Wicket 1.3 release from the user’s perspective. Paul’s clearly a talented writer, since he took my incoherent mumbling and made me appear almost intelligent.
Thanks to Martijn for lining up the interview.
nick Entry
Amazon.com offers a number of low-cost, high-availability services, including S3, EC2 and Flexible Payments. It looks like Amazon has plans to provide some form of database as well, called SimpleDB.
SimpleDB allows you to create a domain, which is similar to a table in traditional relational terms. You place items (rows) into the domain and assign attributes (columns). SimpleDB supports multiple values per attribute, which can be somewhat confusing.
One huge potential issue is you’re not guaranteed that your data will be consistent immediately. Amazon calls it ‘eventual consistency’. Data is written to multiple locations and the propagation takes time, so your data might not be consistent as soon as you complete the operation.
From the available documentation, it’s also not clear if referential integrity is supported and how, or if any form of transactions are available.
I’ve used S3 with Eventful and it’s an excellent service. I’m not sure where Amazon is going with SimpleDB.
nick Entry
Suppose you wanted to get internet access to your new house or apartment. You’ve already got a new computer with a shiny Dell/Apple/etc logo. After doing the research and choosing an internet service provider, you’re told your new computer won’t work on the ISP’s network. Instead, you have to buy a new computer from the ISP, complete with a two-year agreement.
If it doesn’t make sense for internet access, why should consumers tolerate it from cellular providers? At least one company is starting to get it.
Business Week is reporting that Verizon is adopting Google’s Android platform for mobile phones, in addition to allowing a broader range of devices on their network. Why would Verizon want to sell the razors if it’s not going to sell the blades? Simple - carriers subsidize the cost of phones and don’t make money until the customer is in the 10th month of the contract. By moving to a cellular service provider (CSP), Verizon can potentially save money on phones and support costs.
Other cell carriers haven’t responded to Verizon’s move, and most will probably take a wait-and-see approach. Given Verizon’s position as the most profitable carrier, any success will likely spur competitors to open network access.
nick Entry