Posts

Nexus 7 by Asus

I bought my wife an Asus Nexus 7 back in mid February.  A few weeks ago it stopped working.  The unit would not come on at all.  After looking around for help on the web, we called both Google and Asus and ultimately had to RMA it back to Asus shipping on us via FedEx. Apparently this is not an uncommon problem . The phone calls to both Google and Asus involved a great deal of time and some effort to walk through the various attempts at diagnosis and revival.  These included charging cycles and button pushing/holding combinations none of which brought the brick back to life. I will note that the courtesy and sympathy levels of the Google folks seemed much higher than anyone I spoke to at Asus. Today the brick arrived at our home via FedEx in a non-working state.  Asus wants to reopen the RMA and have us send it back once again.  This time shipping is on them. We will be without this device for at least one month.  It would be nice to have a w...

New express

Last week was Google IO 2013.  I have to admit that although I have never attended Google IO, connecting with the keynotes and sessions via the web leaves me with a renewed sense of energy.  I have attended a significant number of other conferences and the positive, can-do attitude of the presenters goes a long way in my book. Sometimes in the day-to-day and week-to-week routine of our jobs we can lose a bit of the enthusiasm that comes with learning something new.  Regardless of one's profession, continuing eduction in a variety of formats is a very good thing indeed.  All this and no jet-lag. With Google IO fresh on my mind and the associated energy, I had a chance to play with a relatively new effort from Exadel  now called RESTXpress .  This software interests me on a couple of different levels and I applaud their initiative in releasing it as free software but I would like to see it as open sourced as well. If you have not yet seen this sof...

Endorsed

After writing my last post we had a short discussion about the endorsed directory and I realized I had neither fully explained the concept nor did I provide enough reference material so that it could be easily understood. This page  from Java 6 documentation technical notes explains it nicely.  The idea is you have a jar file which contains classes that you know should be used in place of the ones which are part of a particular version of Java. When I explained this in that short conversation I included the word "hack" because I was trying to convey the mess we may be creating: there is the very real possibility that other applications will be impacted because we are changing the Java runtime if Java is upgraded the "fixed" application may break again and the "fix" may be forgotten The bottom line is while I am glad Java has a convenient way to replace classes, I liken it to what I was taught about sudo'ing on Unix/Linux.  Respect it, use...

ClassCastException: JAXB

Image
A particular Java application I co-developed leverages both SOAP/WSDL and REST web services.  We use maven to manage the build process of this application which has been in production for a few years now.  It's been around long enough to have moved from Java 5 to Java 6 and now Java 7 (with limited testing using Java 8).  We have also had the experience of initially including JAXB jar files with our application and dealing with the "endorsed" directory because JAXB versions were a bit of a moving target for a while. Now that JAXB is neatly included with Java as it should be so we no longer include it.  I thought all of this was behind us (and unfortunately somewhat forgotten) until recently when we added Jersey 1.17 to the application to call some newer REST services. When trying to connect to the server, my stack trace included this: Caused by: java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.internal.bin...

Raspberry Pi, motion, more Python, and stuff

Image
Things have been a little busy for me lately on many fronts.  There are a variety of projects at work which have my attention and this seems to be a time of year when things pick up before we head into the summer months. I have however been able to work a bit more with my Raspberry Pi lately and the power of the little guy continues to amaze me.  I decided to give motion a try along with, at least for now, one ip camera.  Before I get into motion on the Pi I must say I wonder how this package escaped my radar for as long as it did.  I have over the years written a few programs which detect motion by comparing images and I have looked at the work of others but somehow I missed motion.  The first thing I noticed about motion once it was up and running was the very nice CPU utilization given the capture/comparison loop. Motion works out of the box and while that should be the norm, the bottom line is that some software which has not yet approached mainstr...

JDeveloper on OS X

Image
When I have time I try to keep up with a variety of IDEs.  JDeveloper is one I have mentioned before (and encountered OS X installation difficulty before as well).  I don't disklike it although it still seems a bit bloated to me but I have not yet tried to tweak the settings. This time ADF was my main reason to give JDeveloper another look.  I downloaded the Generic version because I intended to run it on a Mac (running OS X 10.8.3).  Being a command-line guy my first attempt was a simple java -jar jdevstudio11123install.jar Unfortunately after the initial splash screen, this resulted in a small dialog box with a Exit button.  I could not maximize it to complete the installation process. Next I tried to launch the jar file via the GUI which gave the same results.  Looking around the web, I did find several solutions for this problem but some seemed complicated while others did not address this particular issue.  [My own previous soluti...

A bit of Python and some nice arguments

I really don't  use scripting languages on a regular basis but I do like to use the right tool for a job.  Or at least recognize that technologies with which we are most familiar are not always the best choice for any given use.   Python  is not a difficult language.  I have heard for years that it's the new Perl  which I find funny because of those I know using Perl, I have yet to learn of one contemplating a switch to Python. Depending on what you read, Google seems to like Python.  At least enough to create some course materia l and a whole lot of examples for their various efforts. It's been a good while since I looked at Python but it only took a short time today to write a simple script to call a REST service (as well it should).  Finding a nice little library, I chose  argparse , for the command line parameter processing ultimately required the most time (probably an hour after spending a lot less on the actual need).  This wa...

Dropwizard and some memories

Not too long ago I was catching up on some Java Posse episodes and I came across the Dot War (what is it good for?) episode. This episode, recorded live at the Roundup, was not what I expected.  Maybe I was not paying attention before I started listening but I thought a Java/.Net discussion was coming.  Instead I was pleasantly surprised to hear the guys talk about container-less application development. Initially I was not so much interested in using any particular technology among those discussed.  It was the idea that we should not necessarily build software using a specific pattern, framework or technology because it's popular or because we know it (insert "hammer-nail" analogy here).  We should, as we once said, do some analysis and design work (a little learning is not a bad idea). What first came to mind was that portion of the software development heritage which took us from single user applications to the internet.  Roughly speaking the single u...

OS X 10.8.2 ENV help

I tend to use a MacBook for most of my daily computing.  Apple, like many computer companies, tends to change little things that sometimes impact a minority of users and therefore the changes don't get much press. Recently I had the need to set a couple of environment variables on a computer running OS X 10.8.2.  There was a change in how environment variables are set or at least respected by some applications. This can be done manually and I was doing so until recently...today that is.  I found EnvPane  which is a very nice little utility.  I was using another one but it had not been updated for 10.8.2.

Trying hard enough?

This morning I am in an airport preparing to fly halfway across the country.  The airport, destination, and airline does not matter because what I observed this morning is something to which I believe most can relate outside of air travel.  After I made my way through the parking, luggage check, and security checkpoint, I prepared to sit down and check my email and maybe write a bit of code while I wait to board. When I sat down adjacent to one of the gate desks looking for a power outlet, I noticed a uniformed individual who was working at the desk or perhaps should have been working.  This individual was talking on a cell phone.  A few things struck me as I noticed him.  First off was his posture.  He was leaning on the side of the counter in full view of any passerby.  He was on a cell phone as opposed to one of the desk phones.  And finally one did not have to be close to him to get the impression that this was a personal call parts of which...

JDeveloper installation on Mac OS X Mountain Lion

Let's get the "why?" out of the way first - Personally I like to know what IDE's are alive and well for any for any Java development I might be doing especially if it's something new or something I have not done for a while. Currently NetBeans is my first choice.  Certainly Eclipse is a great standby for any Java development (and a whole lot of non-Java stuff for that matter).  I have tried to get into the in some circles extremely popular Intellij IDEA IDE but so far I am not a fan. JDeveloper , from Oracle, has an interesting history (I think back to my JBuilder days any time it's mentioned).  It still exists and I assume is well respected or at least used by those in Oracle shops because it does seem to integrate nicely with (or is at least aware of) all things Oracle. Recently I wanted to check out some functionality specific to JDeveloper and decided I needed to install it on a relatively new MacBook Pro running OS X 10.8.2 (aka Mountain Lion). ...

P2V fun?

We have a good number of servers which are being moved from physical to virtual.  In our case VirtualBox is the virtualization solution.  If you have not heard of VirtualBox, as a result of the Sun acquisition, it is an Oracle product. In my opinion VirtualBox has certainly not suffered since Oracle rebranded it.  It is still available free of charge and is updated on a regular basis.  In addition to overall stability, running on Windows, Linux, and OS X hosts is an attractive, and in our shop, needed feature. Moving physical CentOS servers to VirtualBox proved to be a bit of a challenge.  There are a lot of good blog posts and HOWTOs on this subject.  If minimal downtime is a must, this and other rsync-based solutions is worth reading. As it turns out regardless of the solution I used, ultimately I could not boot the resulting virtual server without using a "linux rescue" or "live distro" and then chroot'ing or mounting the converted filesystems. ...

Dart FUD

Given that I currently do little to no programming specifically for the browser or should I say actually writing JavaScript code, I had, until recently, all but completely ignored Google's Dart language .  It's been about a year since Google released it and I recall reading that it was a non-standard JavaScript replacement which was only to be supported by Google's Chrome browser and it was history repeating itself (in a bad way) reminding folks of VB script or maybe ActiveX. Not to rehash the whole of the criticism but basically Google was accused of trying to do what Microsoft did with their own proprietary browser technologies which unfortunately led to a set of badly fragmented web "standards."  Given that I don't love JavaScript, tending to be more of a static-typed guy, replacing, or trying to replace, JavaScript with a variety of alternatives does not sound totally unreasonable to me. While I have never attended a Google I/O conference, I try to dig...

JavaFX, Maven, and Executables

I am glad to see Maven getting more attention from JavaFX folks. These are a couple of good recent posts: JavaFX and Maven  and more recently Create JavaFX executables with maven I created a project using the pom from the second post on OS X running Java 1.7.0_06-ea-b19 and had some, but what now is very little, trouble. In addition to having to precede the {java.home} and {javafx.version} variables with a dollar sign, I ran into and Ant issue which was solved for me with this:   Ant tasks that use the JDK .  After getting the project to build and package (that packaging part is cool especially the first time you see it) I had one more problem.  The IDE, in my case NetBeans, despite successful builds, would not run or debug the program. Now it's obvious that NetBeans could not find the JavaFX runtime which I solved by adding a symbolic link in the extensions directory.  Here is the command I used  from the /Library/Java/Extensions directory ...

maven 3 site building

We recently moved some projects from maven 2 to 3 and ran into some issues on our CI server.  Most issues while a bit time-consuming were easy enough to figure out given the error messages.  One, in particular, took a bit longer to track down for some reason.  Looking back it should have been obvious but google searches were not much help...perhaps it's just because today is Monday. The error had to do with building the site.  One of the messages, among others, is below: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:2.2:deploy (default-cli) on project projectname : Unsupported protocol: 'scp' Now, this is obvious to me but when I encountered it I thought something had changed in the distributionManagement support settings. As it turns out, the maven-site-plugin needs to have ssh/scp support made available to it. Adding the dependency to the site plugin will correct this problem. A...

Android and JavaFX

This brief post is not about running JavaFX on Android...something I really hope does happen and soon would be nice.  JavaOne announcement? It is about a quick comparison between a native Android application and a JavaFX FXML application. If I recall correctly, one of the books I used as a reference for Android development used code-only to explain "hello world" type examples.  After that simple stuff it was quickly pointed out that Android development is typically done using XML as the markup language to create views.  It is possible, although not advised, to use Java-only because the XML separates the design from the code. JavaFX 2.0 seems to be getting a great deal of press now and perhaps it's gaining in popularity.  In my opinion Jim Weaver and Stephen Chin joining Oracle as evangelists is a great for JavaFX.  I know I have been working with it a good bit lately.  At this point it seems like there are more code-only examples than FXML based exa...

JAX 2012 San Francisco

Throughout my career as a programmer I have been to a wide variety of developer conferences but today concludes four days of one I have never previously attended.  JAX, which originated in Europe and has been around since 2001 is focused on Java, other JVM languages, and anything that touches Java technologies.  The JAX conference is small when compared to JavaOne and others but the number of attendees is not a reflection of the quality of the conference. If you have been around the Java community for any length of time you would recognize a significant number of the speakers.  We were fortunate enough to attend sessions lead by Stephen Chin, Neal Ford, Ted Neward,  Kohsuke  Kawaguchi, Arun Gupta, Rich Hickey, and Charles Nutter.  In my opinion, one or two of these guys makes it worth the price of admission but that's not even a complete list.  The material presented at JAX is both practical stuff you can take home and begin using in your development...

Time saving Java development

I recently ran into some issues with a commercially support product that reduces development time by eliminating the need for recompile/deployment after every code change.  When it's working, this can save hours with a variety of Java development spaces and is well worth checking out. The commercial product for this purpose is indeed a very good one and worthy of the praise it has gotten but alternatives and competition can be good.  Having said that, Javeleon  is a free tool developed by a group of researchers at the  University of Southern Denmark. While I know my way around Eclipse and will use Intellij if and when I must, I happen to be a NetBeans fan at this point in time.  With respect to Javeleon, that's a good thing because the NetBeans plugin is a breeze to install and configure in an application.  [Javeleon has a standalone version of their product and there is a third party Eclipse plugin which I have not yet tried.] Most of my Java develop...

Talking to Swing

We recently saw the need to create an interface to an older Java Swing application.  We don't have access to the backend and currently there is no standards-based interface (e.g. web services) or immediate plans to create one. The application in question was designed for and is delivered with Java 1.3.  This fact limited the possibilities of using off-the-shelf or even pieces of other open source solutions such as Swing testing code. Ultimately we decided to create Swingomatic .  The code is still in development but it is working well enough to consider it viable.  The architecture involves the use of an older release of the  Java Accessibility  and a mini HTTP server which accepts a string of component instructions as an XML string. The project is maven based.  It includes a client library which allows a Swingomatic client to be built in a current version of Java.
Getting JavaFX going on NetBeans on OS X First off JavaFX, like many features in NetBeans, is disabled by default. The first time you create or open an existing JavaFX project it will be enabled. Unfortunately, at least for now, there's no way I could find to add JavaFX to an existing Java platform. Here's a workable solution: create another "Java Platform" (sort of) I created a symbolic link to the current platform and appended _javafx to the name Specifically from the directory /System/Library/Java/JavaVirtualMachines I did "sudo ln -s 1.6.0.jdk 1.6.0.jdk_javafx" Then from within NetBeans Tools->Java Platforms Add Platform choose directory pointed to by newly created symbolic link (in my case /System/Library/Java/JavaVirtualMachines/1.6.0.jdk_javafx/Contents/Home) Now that we have a newly created Java Platform (albeit a copy of the other one) we get the JavaFX option tab Because I unzipped my javafx to /opt I used these values: JavaFX SDK: /opt/javafx...