Juniper VPN on Ubuntu 11.10 64 bit

I just went the hassle of connecting to a Juniper VPN on Ubuntu 11.10 with a 64 bit operating system. It turns out I was getting “Failed to load the ncui library.” because the 64 bit Java would not link with the 32 bit library. When I loaded the 32bit Java

sudo apt-get install ia32-sun-java6-bin

I also ran the update-alternatives on java

sudo update-alternatives --config java

Set the environment variable:

export JDK_HOME=/usr/lib/jvm/ia32-java-6-sun

I cleared my JAVA_HOME variable which was pointing to the 64 bit version, although it isn’t clear to me that mattered. Relavent links:

  • http://www.rz.uni-karlsruhe.de/~iwr91/juniper/
  • https://launchpad.net/~ferramroberto/+archive/java

Another couple of options I haven’t investiaged:

  • http://code.google.com/p/juniper-sslvpn-nojava/updates/list
  • http://mad-scientist.us/juniper.html

Oracle/Sun Java on Ubuntu

Ubuntu 11.10 does not offer Oracle’s Java because OpenJDK supposedly replaces it.  My guess is the OpenJDK “properly” implements Java such that it doesn’t work with any problem.  I find it highly annoying, most programs don’t run with it.

You can install Oracle’s Java 6.2 from this PPA (Private Package Archive).
Please see ppa:ferramroberto/java… 

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-cache search sun-java6
sudo apt-get install –reinstall sun-java6-jre sun-java6-plugin sun-java6-fonts

Then set java-6-sun as default. Choose java-6-sun/jre/ from the list. This step is important:
sudo update-alternatives –config java

This command does it directly without asking:
sudo update-alternatives –set java /usr/lib/jvm/java-6-sun/jre/bin/java

Roses and Thorns: Java/Spring/Wicket/Hibernate Union Membership Management

It is hard not to focus on the negatives on these projects although most of them went pretty well. Sometimes the thorns are actually the roses because we overcame some problem. The union member management application we worked on is a good example of this.

Our thorn on this project was automating functional tests. It is hard to get good code coverage with Java Spring they way you can with unit tests in RoR. Automating functional tests are also extremely difficult with Wicket because Wicket generates ids for all the HTML elements and they change, so they are impossible to target. What we ended up doing was adding name attribute to every element we wanted to target. Targeting by name is a little more difficult, but it worked well for automating these tests.

Roses and Thorns: Flex Speech Therapy Project

Our first and only Flex project was a speech therapy application. The customer had an application written in C++, but it didn’t work very well. We salvaged the portion of the C++ code that read and analyzed the speech data from the microphone and rewrote everything else. There were also a lot of features that we added.

Flex was a good choice for this application because the long range goal was to make the project complete web based, but the first phase was for a package that could be installed on a therapists computer. Flex was easy to learn and it easily followed the Model/View/Controller pattern. We kept the C++ microphone reader because it would of taken time to develop the code in Flex and as I recall Flex didn’t support reading from the microphone very well at the time.

The thorns for this project were customer management. We weren’t involved in customer management on the job, but I kind of doubt we would of done a better job. The customers were not technical and one customer didn’t look at anything until the very end and then requested all sorts of change. We were delivering updates at the completion of iterations and it would of really helped if feedback was earlier. The final product really enforced too much procedure that should of been enforced by the therapist.

Another thorn for the project was testing Flex was not as easy at testing RoR projects.

Roses and Thorns: Java/Spring/Wicket/Hibernate Device Manager

The next project we worked on was a device manager written in Java/Spring/Wicket/Hibernate. Actually, there were a couple projects for this customer, but the general architecture was the same. The applications run in the cloud and use Terracotta to share information between instances. There were several devices supported, but generally, the devices were Zigbee gateways and the gateway controlled other devices. These devices might be in a smart home or installed in an industrial environment to monitor equipment or resources.

The roses here were the interesting technology used. Java/Spring/Wicket/Hibernate and Zigbee devices are interesting. Were were also implementing SMS and satellite interfaces for devices that were not connected to the Internet, so those were fun problems to solve.

Now I think Java is a great language and I have a lot more enthusiasm for it than Ruby as a language, but Java model/view controller (MVC) is nothing to RoR MVC. There is no natural enforcement for controllers and I don’t think hibernate lends itself to putting logic in the models as it does in RoR. Part of the problem was the application started before Hibernate annotations, so they used XML and generated POJOs. Terracotta also provided a new set of problems for us. It is all about learning how to set up Terracotta, but you think everything is great because your unit tests pass and your functional tests run fine, but when you spin up multiple instances of servers, things blow up.

Roses and Thorns: Various RoR Applications

The next bunch of Rails applications we worked on were for a Video Relay Service (VRS) provider. VRS providers have a call center where deaf or hard of hearing people call in to the call center via a video phone call and the operator will read the sign language and speak the message to the person the customer needs to communicate with. The operator translates in both directions. We did several RoR projects for this company and they were using an interesting architecture which was ahead of the time.

The first project we did was a couple of RoR applications to read and update configuration information from various video phones. The next RoR application updated 911 information for their customers so that emergency personnel would be dispatched to the correct address. The next application read and updated an ENUM database so that calls from a customer of one VRS provider could be routed to a customer for another VRS provider. All of this work was very interesting and generally a Rose as was their architecture. Each one of these little applications would run on its own VMWare image and they were doing this before cloud computing really got popular. It was nice in that they ran a lot of little easy to understand applications that were loosely coupled.

I really can’t say there were any thorns to working on these projects.

Roses and Thorns: Ruby on Rails Questionaire

One of our next projects was developing a Ruby on Rails application which would allow users to answer a bunch of questions to evaluate them for a job. Sounds like the perfect things for a RoR application, but it had its good and bad parts.

This was my first RoR project and I was very impressed with how quickly we could develop the application and I really enjoyed working with Rails. Another Rose for the project was Selenium which was just a fantastic way to automate functional testing for the application. Selenium is just another strength for using RoR for web application development.

The thorns to any Rails project are very similar to the thorns we had:

  • Slow queries to the database because you are querying multiple tables multiple times. In the end you write one nasty SQL statement that gets it done in a fraction of the time
  • The Rails magic is sometimes hard to follow. Who knows what actually provides some functionality until you spend hours trying to figure it out.
  • The authentication and authorization plugin we used was pretty klunky, but this was early on in the RoR days. I’m sure there is better now

Overall, this was a great application to write in Rails.