Friday, March 4, 2011

Jersey and Maven Share (i.e. Über Jars)

For the past year or so, much of the work I've done with Java has used Maven's Shade plugin. This plugin does a really excellent job of mashing dozens to hundreds of Java dependencies into a single jar file. This not only makes deployment easier, but for things like Hadoop jobs makes dependency management in general much easier.


Unfortunately, using the Shade plugin does occasionally have some negative side effects. Namely, on some occasions I've had jar files stomp on each with non-obvious outcomes. Today was one of those times.

The issue in this case only appeared in the production environment but not in test and not when running from my IDE under a debugger. The core service would start fine, but on any request, the code streaming data would throw an exception similar to:

javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:240)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:593)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)

This particular exception was particularly difficult to diagnose because Jersey writes a critical piece of data to stdout and not to the conventional logging infrastructure:

SEVERE: A message body writer for Java type, class java.lang.String, and MIME media type, application/octet-stream, was not found

When I finally realized this was the case, a Google search turned up this discussion where the difficult diagnostics had already been published by Gaëtan Sheridan . From there, it was a matter of excluding specific portions of the jersey-server plugin from the shade-generated artifact and all was well.

The relevant portion of the POM file looks like so:



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>com.sun.jersey:jersey-server</artifact>
<excludes>
<exclude>META-INF/services/javax.ws.rs.ext.MessageBodyWriter</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>



Making that change fixed the issue.

The other painful reminder from this exercise was that common tools such as mvn jetty:run and launching from the IDE are no substitute for testing with the exact binaries and classpath used in production. Because my IDE and maven's jerry:run command manually assembled the classpath, it turns out that they did not experience the issue. Only when running directly from the über jar did the problem surface.

Tuesday, March 10, 2009

Jive Product Launch Videos

Our product marketing team undertook a huge new push this week for Jive's 3.0 product launch, new web site included.


Most fun though are the YouTube videos the team and other Jivers created:

http://www.youtube.com/watch?v=0Y6aceiLzCI

http://www.youtube.com/watch?v=RThcPOmVC9o

Next on My Reading List - Against Intellectual Monopoly

http://www.newswise.com/articles/view/549822/?sc=dwhn


What intrigues me most is that its an economist-driven view. Not the normal FOSS evangelist vs. IP lawyer-type rant, but a different perspective, hopefully with some quantitative backing behind their assertions. Always hard to argue with numbers.

Tuesday, January 13, 2009

Portland's clear.com Not Up to the Task

I was excited to see WiMax coming to Portland via clear.com but that excitement has ended now that I've learned more and that the service has been rolled-out:

  1. My main interest was for mobile access. I love the 3G on my iPhone, but without a way to tether to my laptop, I'm still forced into situations where I want to get online but cannot or have to pay yet another provider for service. Unfortunately, clear.com does not support Macs for their USB devices which I find stunning considering I see more Macs in downtown PDX than practically anywhere else I've traveled in the last few years. I'm feeling like they didn't research that one at all.
  2. Support reps for clear.com's online chat is uneducated on their actual products. I asked if they support Mac and if there were Linux drivers for the USB dongle and the support resource happily told me "yes" to both. In talking with two different reps at clear.com kiosks around town, both confirmed only Windows is currently supported (again, in a town where Windows probably has the least market share of any urban area in the US for personal devices).
  3. I suspect that clear.com is blowing up my satellite radio signal. Others in PDX seem to suspect the same. All I can say for sure is that since clear.com's service came on line, my satellite radio equipment that was previously working just fine stopped holding a signal. The same equipment did not move, just mysteriously stopped functioning with a similar experience in my car's unit.
  4. For home service, the speed isn't really that impressive. Its slower than Qwest's high-end DSL at roughly the same price point, and definitely slower than Verizon's FIOS if you're lucky enough to have access to it - I for one can only dream.
In general, beware Portland WiMax and specifically clear.com.

Friday, October 3, 2008

Prog-iona

Some how the Progress acquisition of IONA slipped under my radar. Funny, because that brings many things on my periphery full circle.

I used to work for C-bridge Internet Solutions. eXcelon bought C-bridge after the bubble burst in 2002. Fast forward to 2005 and I'm in Portland working for a now-defunct company trying to break into the ESB space via an open model. That space leaned towards JBI. I'd still argue that we bet correct and that JBI has done a whole lot of not much, offering "vendor independent" layers on top of things that people didn't care about vendor independence for, but in 2005 we gave it a serious look.

LogicBlaze used to be one of the primary FOSS backers of JBI and from the looks of the mailing list, their core team continues to be heavily involved in the development of ActiveMQ on which their JBI implementation was based.

By April 2007, LogicBlaze was acquired by IONA. Around that time, Mike started talking with Larry who was our boss in the latter part of the eXcelon days. Mike and I were both at LM, and we regularly worked with Stephen who doesn't blog (sorry no link) but formerly worked for IONA. Mike's talks with Larry didn't go anywhere, but the IONA/C-Bridge/eXcelon/Progress/LM circle was complete.

Now, last month, Progress buys IONA and Larry again works for Progress. I'm also again doing a deep dive into ActiveMQ, whose IP is now I guess owned by Progress who I used to work for. So in some sense, the company who owned my butt as far back as 1999 is still influencing my role today.

Add to that mix a couple of interactions via TSS, OSCON and IRC with Hiram and James (which they probably don't recall but did result in some attribution), and things get even more tangled.

It never fails to amaze and amuse me how small this business is, despite being so big. The networks I started making 10 years ago still come into play even today in subtle ways and keep overlapping. Six degrees of separation is nothing, I have trouble keeping it to two.

Friday, August 8, 2008

Classes of iPhone Users

I've had an iPhone for some time now. While it does bother me that Apple doesn't really give two shakes about contributing back to the open source community on whose shoulders they have built, I'm also pragmatic. The device is simply the best of its kind out there.

I like to consider myself a student of other iPhone users. Any time I see someone with one, "classic" or 3G, I like to snoop on what they are doing. Over the last few months, I've noticed a few classes of iPhone user emerging. What follows is my untrained attempt at social anthropology mixed with humor.

  • The Frustrated Designer - a Mac user through and through. They always buy 1st gen Apple hardware, even though rational people know better. Most easily identified by their propensity to verbally express a tangible frustration attempting to use 97 nested DIVs, advanced CSS selectors and 12578 lines of JavaScript to center an image in the iPhone Safari interface. Would write an ObjectiveC native app, but doesn't know what a compiler or socket or ObjectiveC or a native apps is.
  • The Trophy - doesn't really know why they have an iPhone, just that their wealthy partner gave them one. Most easily identified by well-manicured nails attempting to tap out a text message with the sound at full volume for each key press. Never types faster than twelve keys per minute. Commonly sits next to me on airplanes.
  • The Showman - Doesn't really know why he needs an iPhone, just that he does. Identify the showman by his inability to do much other than talk on the iPhone, set it on the table during meetings so you know it's there, and by the fact that his emails still end with "Sent from my iPhone" despite having the device for nearly a year.
  • The Tech Luminary - Installs every possible application from the iTunes store hoping to gain status as someone qualified to comment on the state of iTunes Store/iPhone technology while at the same time not knowing a thing about the underlying platform. The luminary mocks Windows users for arbitrarily installing shareware from .ru domains, but never questions why he has installed 47 iPhone applications, 43 of which are never used.
  • The Frustrated Developer - Has an iPhone application in the works, but can't talk about it due to an unenforceable NDA. Identify these users by their regular and sanctimonious references to their NDA despite never having really finished an application or by their smug looks at local user groups.
  • The Marketing Director - Only knows that they should have an iPhone because their underlings said so. Loves the speaker phone, thinks it's the major advance of the device. Most easily identified by the fact they are still running the same firmware they bought the device with.
  • The Commuter - Found in urban areas, this individual cannot stop texting, browsing, or listening to podcasts long enough to exhibit any awareness of those around him/her and actually move out of the path of egress for everyone else on the transit device. Likely to accidentally enter altercation with local meth addict while engrossed in something Twitter-related.
  • The Power User - The most elusive of the iPhone users, understands device limitations (most Bluetooth profiles lacking, no Copy/Paste, no Search, AT&T partnership) along with a healthy distrust of anything Steve Jobs claims. Generally refuses to tout the virtues of the device unless overhearing someone rant about how much better a Nokia or RIM device is. Understands there are no better alternatives and that using the device sticks it to "the man" by making consumer opinion matter again. Hopes Android kicks major ass and that people will take Openmoko seriously.
It's probably obvious that I associate myself mostly with the latter category, but there is plenty of commuter in me as well.

There is a snobbery around having an iPhone. It's sort of like riding a fixed-gear bike in Portland; you feel like it makes you cool, you usually go out of your way to let people know you have one. Then you see all of the other DBs using one and realize its way too much machine for them. Some of them even run into walls while using the device you admire. You can't give up your baby, so you're left trying to quietly blend back into the masses hoping nobody noticed and that you don't get associated with the new user population. I'm sure there's a Gartner graph to prove it all out somewhere...

Wednesday, April 16, 2008

I Can Ride a Bike With No Handlebars

This post on slashdot blew me away. I'm typing this on a Hardy/Kubunty alpha (maybe beta by now?) installation and it has been more difficult to install than several of my Gentoo installations - that's saying something.

Granted, I went with KDE4 which is simply asking for problems, but really, this was a doozie. Issues of note:

  1. Now famed Ubuntu "Black Screen of Death" - I attribute this to my having some slamming video cards, but seriously, the people's distro should *never* get itself into a place where you can't fall back to the kernel fb. When good ole' Ctl+Shift+Del can't save you from X+driver maddness, something is fundamentally wrong. For the interested, I had to drop to a recovery console and install nvidia-glx-new, then hack xorg.conf to use nv drivers, then "activate" properietary nvidia drviers. Not pleasant.
  2. Java UIs fail - mouse-over for certain Eclipse SWT widgets cores java. That is generally difficult to do - SWT is one of the more stable Java UIs out there and it dies *hard*.
  3. Probably most important, my shell gets into some wierd sound death-trap. Yes, that's right, I said shell and sound are problems. Alarm bells going off for anyone yet? Basically, the DCOP issues on the Ubuntu forums don't seem to be fixed for me anyway, my shell is trying to do something sound related (even with sould off) and hanging until I start a corresponding shell to recover the first. The scenario looks something like - start System -> Konsole -- see DCOP error message, see Konsole hang. Start System -> Konsole 3 -- watch Konsole work while Konsole 3 hangs. The two seem to be fighting for control of the KDM and one but not both work at a time. I spend ~40% of my compute time in a shell. When something that fundamental doesn't work, I freak out.
  4. FF3 widgets look like crap. That's not really Hardy or KDE4's fault, but it's true. Tabs, drop-down decorations both look simply aweful.
In all fariness, Gusty didn't install properly on this hardware. Still, I'm not seeing how things in XORG land have gotten any better, infact they may have gotten worse. Complain all you want about Windows, at least Vista on the same hardware displayed a UI without me dropping to a rescue console.