What should be in next Restful Java Book?

9 Comments

JAX-RS 2.0 is around the corner. We’re ironing things out in the JSR group and alpha implementations should be out soon along with the public draft. I talked to O’Reilly and the sales of my Restul Java book were good enough to justify a revision. So…

What do you want in Restful Java 2.0?

The obvious things are new spec features, specifically new chapters on:

  • Client API
  • Filters and Interceptors
  • Asynchronous HTTP

There’s a few other minor features that will be sprinkled about in existing chapters of the book.  We’ll also need to update the Java EE integration section as when the book was written, it hadn’t really be finalized yet.

For the filters and interceptors chapter, I was thinking about walking through (with code examples) the use cases that were the inspiration for these features in the spec.

For the asynchronous HTTP chapter, I was thinking of using/implementing  a slimmed down simple version of the HornetQ REST interface.  That way I can throw in bits about Atom as well as some useful restful patterns.

For security, I was thinking of talking a bit more about Resteasy’s S/MIME and DKIM support and how they fit into the security picture.  We could also talk about OAuth too.

What else?  Please comment.

Xoticpc/Sager/7970m Horrible – Mythlogic/680m Great

18 Comments

If you read my last blog you know that I was in the market to get a souped up gaming laptop.  It has been a 2 month long adventure…

Summary

  • Xoticpc is a worthless middleman that provides zero value-add.
  • Sager doesn’t test their machines very well
  • AMD 7970m is not ready for primetime
  • Mythlogic  is a great vendor.  Worth every penny.  Highly recommend.
  • Nvidia 680m works like a charm

The miserable XoticPC/Sager experience

Ordered a sager np9170 with latest and greatest Intel Ivy Bridge CPU and AMD 7970m GPU.  I had a few questions and had a decent, relatively prompt, email exchange with XoticPC sales. Order fulfillment was strange. When I initially placed the order, Xotic emailed me saying they needed me to email a scanned image of both sides of my credit card and driver’s license.  I was a bit uncomfortable doing this, so I refused this request.  I’ve bought computers online for years and years and never have been asked to do something like this.  Xotic calls my credit card company, Bank of America, who tells them to do the reasonable thing:  call me on my home phone and that would be enough to verify my identity.
I got the machine within 2 weeks.  This is when the problems started.  Firstly, the accessories I ordered with the laptop did not ship with the laptop.  I thought this odd, so immediately called XoticPC.  Their response was that accessories are a separate shipment.  Suspiciously, within a few hours of the call, I receive an email that my accessories have shipped along with a UPS tracking number.  I get the accessories a week after this call to find that one of the ordered accessories was missing.  At least one, probably two screw-ups on order processing.

Ok, now onto the laptop itself.  I unpackage it, turn it on.  Within 10 minutes of turning it on as I’m downloading various things I need for the laptop, it crashes.  Basically a screen freeze.  I have to unplug and also remove the battery to re-boot.  Standard stuff.  Computer hangs again 10 minute later just browsing the internet.  Reboot.  I’m ok for another few hours, actually get SWTOR installed and running.  Am playing for like 5 minutes, again…crash.  This time though, the computer will not reboot and can’t even get to the BIOS splash screen….So my nightmare is realized.  I purchased a machine that doesn’t work.

It’s still working hours so I call XoticPC support.  I explain the problem to the support engineer.  My answer is: [total silence for 5 seconds then…]  “Huh….wow….Well, sounds bad.  Not something I can help you with.  Email support@xoticpc.com and they will definitely be able to help you.”  I’m speechless…I hang up and immediately send out that email to support@xoticpc.com.

Since Xotic is a Sager reseller and their 24 hour service number is actually a Sager 1-800 number, I decide to call Sager.  I actually get somebody pretty quickly surprisingly and explain to him the problem.  His response is: “It’s probably the GPU, but maybe also a fan/heat problem.  You’ll have to work with XoticPC and send it in for repair.”  Again, speechless.  How the can Sager send me a laptop that doesn’t work!!!!  Do they have any QA?!?!  This is the same crap I went through with Alienware back in 2006.  How hard is it to send a product that actually works?

I got too much work to do the next day, but I finally get a response back from XoticPC.  After a brief exchange and description of my Sager support conversation, XoticPC agrees that the machine must be sent in for repair.  I tell them I’m not dealing with a defective product or company and say I want a full refund.  Luckily, they get me an RMA pretty quick and I send back the laptop (to a Sager address) on 7/2/12, I have to pay shipping with insurance though, about $125.

On 7/27, I haven’t received my refund yet or any notification from XoticPC, so I email sales.  I get a response that a refund for $65.00 has been processed.  I tell him that that is the refund for the accessory they decided never to ship me.  He tells me that ok, yes, I’m right, and that my laptop refund is still being processed.  7/31, I finally get an email saying my laptop refund has been process.  As of today 8/7, I’m still waiting to see it on my credit card.  So, I email Xotic PC asking WTF is going on.  Their reply is that they have submitted the electronic refund and that it is out of their control and that I have to contact my credit card company.  I ask if there is a way to track this.  Their reply is that they don’t have that information.  So, I call my credit card company they say Visa sometimes takes up to 15days.

The Mythlogic Experience

After sending in the RMA to Xotic/Sager on 7/2, I decide to look for another vendor.  My goal this time is to find somebody that actually tests and QAs their products before sending them out.  I read a bunch and actually post my situation on forum.notebookreview.com.  A few people point me to Mythlogic.  They are not resellers, but instead, actually build their own machines.  After reading a few forum posts about the company and the insane amount of QA they do, I email their sales asking them a few questions about the quality of 7970m  at about 10pm at night.  Surprisingly, I get a response with 2 minutes.  Over the next 3 hours (1:30 am) we exchange a few emails.  I was surprised their guys are up until then!  I’m impressed enough to place my order on 7/3.  The specs are identical to my Xotic order: Intel Core i7-3920XM 2.90GHz, AMD 7970m, and dual Raid 0 Intel 520 SSDs.

On 7/23 I’m still waiting for my machine to get out of the “Pending Parts” phase.  I email Mythlogic asking them what’s going on and get a response within 2 minutes saying that they have had trouble getting the AMD 7970m GPU in stock, but that my machine is scheduled to be built this week.   Later that day my order status changes to burn-in/QA.

Three days later I get this email:

I’m afraid I have some bad news, the 7970M that is in your laptop is performing out of spec (high temperatures, unstable performance) and we are going to have to replace it to enable your laptop to pass QA. Because of the high level of demand for these cards, we do not have any extras on hand, but we are working with our partners and vendors to get a replacement as soon as possible. When we have a specific ETA on when we can get a new card, we will let you know ASAP.

Meanwhile, there are alternate options available if you would like to consider them. If you would like to upgrade to an nVidia 680M, you can do so for $250, and we can have that ordered and through QA by the end of next week.  If you would like to downgrade to an nVidia 675M (performance loss of about 20%), you would receive a refund of $125, and we could continue your build immediately as we have that part on-hand.

This is why I went with Mythlogic!  I wanted a company that would find problems up front to avoid receiving a defective product.  At this point, I’m pretty worried about the AMD 7970m.  Its probably a similar problem to my XoticPC/Sager machine.  I do a bit more research online and find that numerous people are also having problems with the new AMD 7970m.  So, I email Mythlogic back and tell them I’ll upgrade to the NVidia 680m.

My order ships a week later and I got the machine on Monday. One cool thing was that the machine shipped with the results of the QA done on the machine. 4 different 3DMark and PCMark benchmarks were done. Battle Field 3 was played on my machine and graphs of temperature, power, and voltage were taken while the game was played. IOTests were done on external IO ports (USB, etc.). And the display calibration results were attached.

So far the machine works great.  Graphics switching works flawlessly and all my games perform the way I want.  I did have one problem though.  I randomly got a dialog box popping up saying “? Bad quality”.  So, I emailed Mythlogic support at about 7:30pm at night.  Received a response at 3:00am saying that it is a problem with lack of light for my fingerprint reader. What?!?!  Support that actually figures out my problem?!!!  🙂  So, I disable the fingerprint reader and now I’m all set!

[Edited 5 days later] Things still going great. One thing I’ve noticed is how cool, temperature wise, the clevo, intel i7-3970, and nvidia 680m combination runs. In an apples to oranges comparison, my 2009 Macbook Pro ran insanely hot.

Moral of the story

I think it is a matter of probabilities. Normally, people are happy with Xotic/Sager because they got a cheap gaming laptop and because the probability of getting a bad component is really low. So, whether or not Sager’s QA is poor doesn’t really matter because systems are usually built with functioning components…

But, Since such a high number of 7970ms were bad, the probability of building a machine with a bad component shot up dramatically. So, the poorness of Sager’s QA process (or lack of QA) and the coolness/thoroughness of Mythlogic’s QA process were made blatantly obvious.

Edited Tuesday 10/16

Update more than 2+ months later.  My Mythlogic machine is still working great.  I did get a refund from Xotic about 2 weeks after this blog posting.  One more thing, after returning my broken XoticPC/Sager machine 2+ months ago I just got this email today from XoticPC:

“Hi!

We just wanted to check up on the laptop you purchased from Xotic PC.  Since you have now had some time to use your new laptop we would like to get your feedback on how everything has been going. We hope you are happy with your new laptop and the service you received from Xotic PC, and your satisfaction is our utmost priority.   If you can spare a minute please reply back to me that you have received your new system ok, as well as feedback on the service that you received from Xotic PC.  Additionally please let us know if you have any questions,  issues, or concerns about your new system. Good or bad, your feedback helps me, as Service Manager, try to meet your expectations.

 I look forward to hearing from you. Thank you again for choosing Xotic PC for your new computer purchase.

Bleepin idiots….

BTW, here are the final specs of my awesome Mythlogic machine after ditching 7970m/sager/xoticpc:

Mobile Chassis: MYTHLOGIC Nyx 1712 Chassis (Clevo P170EM) with backlit keyboard
Mobile Display: 17.3″ Full HD (1920×1080) Glossy 90% NTSC Color Gamut LED Backlit LCD
Dead Pixel Guarantee: MYTH Pixel Perfect Guarantee
Monitor Calibration: Free MYTH Professional Monitor Color Calibration
CPU: Intel Core i7-3920XM 2.90GHz, 8M L3 Cache, 22nm, DDR3-1600MHz, Extreme Edition Mobile Processor
Thermal Compound: Free IC Diamond Thermal Compound
System Memory: 16GB (2 x 8GB) , PC3-12800, 1600MHz SODIMM (Patriot)
Video Adapter: NVIDIA 680M 4096MB GDDR5 DX11 GPU with Optimus Technology
Optical: Notebook Black 8X DVD+RW/CDRW Combo Drive
RAID [Requires Identical Hard Drive Selections]: RAID 0 | 2 Disk Min. Striped set, improved performance, additional storage drive highly recommended
Hard Drive: Intel 240GB 520 Series SATA III 6Gb/s Solid State Drive Sandforce Powered
Hard Drive: Intel 240GB 520 Series SATA III 6Gb/s Solid State Drive Sandforce Powered
Keyboard: Backlit Chiclet Keyboard – English Only
Network Card: Onboard Gigabit (10/100/1000 Mbits/sec) LAN subsystem
Wireless Card: Intel Centrino Ultimate-N 6300 3*3 802.11 a/g/n 450MB Total Bandwidth
Bluetooth: Integrated Bluetooth 4.0 Only With Intel 2230/6235 AND Killer 1202 Wireless
Wireless Router: Netgear N900 (WNDR4500) 450 + 450 Mbps
Operating System: Windows 7 Home Premium:
Anti-Virus Software: Microsoft Security Essentials
Productivity: Microsoft Office Home and Student 2010
Extra AC Adapter: Extra AC Adapter (Nyx 1712)
MYTHLOGIC Assurance: MYTH Lifetime Assurance with Lifetime Labor + 2 Years Parts Warranty, 2 Yrs 2-Way Shipping Cont US
Phoenix Upgrade Plan: Lifetime Phoenix Upgrade Plan

No 17″ Macbook means I need a different brand

4 Comments

My Macbook Pro 17″ is about 3+ years old and I had great anticipation for WWDC today.  Boy was I disappointed!  No more 17″ Macbook Pro!  17″ is a must for me and their graphics card (as usual) is middle of the road.  The big thing is the Retina display, but you may not be able to see a difference.  I’m actually kind of really pissed off.  So much so, it may be time to ditch Apple.  The only things that may keep me are:

  • High quality product and high quality support.  Apple is 2nd to none in both of those categories (at least in my experience).  I’m willing to pay big bucks for both of these things if they are a reality.
  • Commercial Unix.  The High quality product/support combined with  a unix-based laptop.
  • No-thought/knowledge-required Windows dual-boot (Bootcamp).
  • The awesome touchpad
  • Automatic iphone sync/backup

I’m looking for a gaming laptop alternative, please offer recommendations!

If I have to go back to Windblows, its got to be with a kick-ass gaming laptop.  I took this route back in 2006 and purchased an Alienware beast of a laptop.  I returned the initial shipment because it was not assembled correctly (hard drive wasn’t fully connected) and just broken in general as well.  Got a replacement, but that died in less than 1 year.  I tried to get help from Alienware to fix it (my warranty was still valid), but gave up after 1-2 weeks of getting the run-around from their support.  Bought a Macbook and have been happy every since, until today…Before 2006 it was also an endless string of crappy Dell notebooks.

Can anybody recommend a kick-ass 17″+ gaming notebook that they have bought in the past year that wasn’t broken when you got it and doesn’t have horrible support and is decent quality?  Maybe Alienware has improved?  Asus? Hp Envy?  Its hard to tell who is a good company and who isn’t when dealing with these high-end laptops.  I’ve spent a few hours searching and reading, but can’t really get anything definitive on quality of product/support.

Solar Powered iPhone

Leave a comment

This has got to be the coolest mobile phone accessory ever

 

 

Resteasy 2.3.4 Released

Leave a comment

About 20+ issues fixed and implemented.  Some highlights:

  • Netty integration.  Thanks to Norman Maurer
  • Expanded Atom support for extension elements.  Thanks to Kurt Stam
  • O’Reilly examples implemented on top of JBoss AS7
  • Zip patch that allows you to patch JBoss AS7 with latest Resteasy release
  • Expanded support for @Form that allows prefixed/indexed @FormParam and also collections.  (Docs are clearer on this). Thanks Maarten Winkel

Follow links from main Resteasy page to get to docs, downloads, and release notes.

 

Open Source’s Talent Advantage

1 Comment

Was reading an article on TheStreet.com about Why Wall Street Hates Open Source.  I think one of the things that business people often don’t know about is the talent advantage open source companies have.  Answer this question:  What are our hiring practices?  How do we hire people?

We know they can do the job

Most of the developers that come to the JBoss division of Red Hat were/are contributors to at least one of our open source projects.   Think about that for a second…Before we start paying somebody a dime, we’ve worked with our potential new employees months, sometimes years at a time.  We know what they are capable of.  We know the quality of their work.

We can hire anybody anywhere

The world is our labor market.  We can hire anybody anywhere without having to move them because we already have distributed development model.  A development model that our employee has already participated in.

Our developers have initiative and are self-motivated

Open source developers are uncommon.  Why?  It takes initiative, and lots of it.  You have to have the gumption to download the code and figure out how to build it.  Then you have to have the skills to be able to understand and dive into somebody else’s code so you can add your pet feature or fix a bug that is holding you up.  You have to go beyond the scope of your job description and learn something new.  When we hire a contributor, we know we have somebody that isn’t afraid to take initiative and drive things on their own.

Our developers already know our products

In my experience, the vast majority of our contributors are actually users of our products.  They’ve come to help, because they are missing a feature or bug that hinders the progress of the work they are being paid to do.  They know our products, but more importantly, they know what’s wrong with our products and what they don’t like about our products.

Our developers enjoy what they do

Core contributors often contribute during their free time.  People aren’t willing to give up free time if they don’t a) enjoy what they are doing, b) don’t like our products.

Our developers are part of a movement

Richard Stallman aside, open source is not socialism, yet it is a movement.  A movement most developers are proud to be part of.

Anyways, this is one of the many reasons I think Red Hat is built to last.

Write your own logging abstraction

3 Comments

As software developers we are ingrained to believe that copying and pasting code into multiple places is a bad idea.  As everything in life, you should always question what you’re taught as there are always exception to the rule.  I think logging abstractions are is one of these exceptions.  How many of you have struggled with logging frameworks?  How many times has one project or library used a different framework or version that causes incompatibilities?  How many often do you use a maven exclude for apache commons logging, log4j, or slf4j because each dependency uses a different framework or version of that framework?  Its a pain in the ass and a bleeping mess!

HornetQ was the first project I saw where they said, “To hell with logging abstractions!”.  They wanted to reduce external dependencies and logging was at the top of their list.  They implemented their own logging abstraction that used JUL by default, but that could also delegate to log4j, slf4j, etc.  Generic findClass invocations were done to determine which logging framework was installed in the environment HornetQ was running in.

So, what I’m suggesting is that each project should cut and paste what HornetQ has done and incorporate it into their own projects.  Let each project own their own logging abstraction and reduce their dependencies.  A side effect is they’ve also reduced any potential maven transitive dependency conflicts as well.  We did this very thing in Resteasy last year.  This is one case where copy and pasting is a good thing.

Enjoy.

Creating a JBoss Modules zip

Leave a comment

I’ve extracted some of the build files from AS7 to create a maven project that can create a modules/ directory structure for Resteasy.  I wanted this so that people can easily patch/upgrade AS7 to the latest resteasy release.  It should be fairly easy to use the project as an archetype if you want to do it for other things.

json-home format: resource discovery

7 Comments

Thank you Mark Little for turning me on to the JSON-Home format Internet Draft.  “application/json-home” is a format that describes resources available from a particular site as well as possible hints on how to interact with those services.

   GET / HTTP/1.1
   Host: example.org
   Accept: application/json-home

   HTTP/1.1 200 OK
   Content-Type: application/json-home
   Cache-Control: max-age=3600
   Connection: close

   {
     "resources": {
       "http://example.org/rel/widgets": {
         "href": "/widgets/"
       },
       "http://example.org/rel/widget": {
         "href-template": "/widgets/{widget_id}",
         "href-vars": {
           "widget_id": "http://example.org/param/widget"
         },
         "hints": {
           "allow": ["GET", "PUT", "DELETE", "PATCH"],
           "representations": ["application/json"],
           "accept-patch": ["application/json-patch"],
           "accept-post": ["application/xml"],
           "accept-ranges": ["bytes"]
         }
       }
     }
   }

While I like the format, my own personal opinion is that hints are not needed.  Most(99%?) non-browser clients already know how to interact with the resources.  What they are looking for, really, is the actual URL to the resource.  IMO, a separate format(s) should be defined for resource description and the link relation URL can offer up that representation if it wants to.

Another beef I have with this (and the atom link XML format too) is that the value for the relationship, rel, can be a URL.  I’d much rather define a logical name, and have a separate attribute that specifies a URL that describes the relationship.  For applications, especially intra-net based ones, URLs can change more frequently than their Internet counterparts.  A logic name attribute could remain fixed and the description URL could be more dynamic.

BTW, I’m glad that the powers-that-be at IETF are showing some love to non-browser clients. Json-home is something similar I’ve done for a few of the RESTful services I’ve written.

Mocks are a Mockery

17 Comments

There were some interesting side conversations going on in the comments of my Java EE wins over Spring blog.  In particular, a few people were arguing over the value of Mocks.  I always considered Mocks a bogus pattern.  Only time I ever use them is when I’m initially starting a project and I don’t have full implementations of a particular subsystem and I need to test that something works.  You see to me, your GIT master branch, or your SVN trunk is a sacred place.  I fully believe in the idea of continuous integration.  But to have a pure Trunk, you have to test your code, as close as possible, to the target environment it is supposed to run in.  Mocks go counter to this idea.  And give you false sense of security.

My colleague, Stan Silvert said it best:

When you DO use mocks you are testing in an environment that is biased toward a passing test. An artificial environment will always make invalid assumptions about the behavior and stability of that environment.

What you end up with is a (hard to maintain) mock library that allows your tests to pass and gives you a warm feeling that you’ve done a great job. But you are fooling yourself.

The ONLY reason to use mocks is when test execution in the real environment is unacceptably slow. This used to be the case quite often. But with frameworks like Arquillian and super-fast startup times for app servers this is no longer a frequent concern.

I’ll end with an even more radical assertion. The difference between integration testing and unit testing is purely semantic. Even the smallest, most focused unit test pulls in a lot of the environment (JVM, OS, etc). In-container testing just pulls in more of the target environment and allows you to find more errors sooner.

Test in the real environment and get results that are truly valid. Stop kidding yourself with mocks.

Personally, I’m a very paranoid person when it comes to development.  Earlier in my career I did a lot of demos and live coding in front of an audience.  When you’re in this type of environment you live by the mantra that anything that can go wrong will.  So, when rehearsing, you always mimic as much as possible what your setup will be.  I carried this paranoia to Iona (an Irish company), when I worked on Orbix there.  We had a rule, that if even one test (integration or whatever) failed, you were awarded the Guiness Penalty.  If you broke the build, you had to buy every one on the team a pint of Guiness.  IN this environment, Mocks are a waste of time, both in build CPU and in coding time as you still had to run integration testing before you committed anything (unless of course you just wanted an excuse to have a few beers).

So unless a particular integration test is ungodly slow, don’t use mocks.  Stan again, said it best:

…the days of the 2 hour in-container smoke test are over.
Since mocks no longer provide much of a speed advantage their use is outweighed by the fact that they give you a phony environment, maintenance headaches, and false confidence.

But you do touch on a truth about testing that a lot of people miss. The purpose of testing is to uncover errors. And you will uncover more errors in a real environment than you would in a mock environment.

With projects like Arquillian and fast boot up times like AS7 (1.75 seconds on my laptop), there’s no need to mock anymore.

Older Entries Newer Entries