David R. Heffelfinger

  Ensode Technology, LLC

 

NetBeans in an Old Clunker


For the past few months I've been working with a new client that does not allowed personal hardware to be plugged into their network. They provide the hardware for their consultants and employees to use.

The only computer they had available for me was a laptop with great specs (five years ago), 1 GB of RAM, and a 1.6 Gz (single core, but I think it goes without saying) processor.

On this laptop I've had to run NetBeans, alongside with JBoss or GlassFish (one of the projects I'm working on uses JBoss another one uses GlassFish).

I've always had the fortune of having access to fairly modern hardware, and although I had heard complaints about NetBeans performance, it was always good on the hardware I had available. This situation gave me an opportunity to use NetBeans in, let's just say, "less than ideal" hardware.

What I have noticed is that NetBeans takes a very long time to initialize, but once it does, it works fine, for the most part. The most noticeable annoyance I have seen is that opening files via the "SHIFT+ALT+O" shortcut is slow, many times I finish typing the file name before the list to pick from pops up.

Even with substandard hardware, for the most part I've found that NetBeans performs fairly well.

 
 
 
 

New Version of IceFaces NetBeans Plugin Out


A couple of days ago I noticed that the NetBeans IceFaces plugin had been updated. I wrote my initial impressions about the plugin a while back.

I've been wanting to take the updated version for a spin, but other commitments have been preventing me from trying it out. Today I had a few minutes to spare so I gave it a try.

I am happy to report that most of the issues I found with the plugin are now fixed.

Pages developed with the plugin now work with GlassFish 3 effortlessly.

Additionally, I can drop components into the navigator view to avoid the CSS absolute positioning that happens when dropping components directly in the page, please note that I only tried this under Linux, which wasn't broken to start with; in my previous test I used both a Windows and a Linux box, and only under Windows I wasn't able to drop components in the navigator.

I was also very glad to be able to change the default package where the automatically generated JSF managed beans get created, it was awful having all of these classes in a package named "WebApplication5" or something along those lines before.

There are a couple of issues that still persist.

The "label" attribute of IceFaces components is still ignored. The weird thing is, it works fine when using Facelets (without visual editing, of course) why doesn't it work with JSPs with Visual Web is anyone's guess. When JSF 1.2 came out, I was so glad that we had an easy way to display user friendly error messages, it has been frustrating not to be able to easily use this feature, first with Woodstock and now with IceFaces

Another issue that is still present is that ctrl+shift dragging from a label or message component into an input component does not yet set the "for" attribute like it was possible with Woodstock. The mouse pointer changes into a crosshair when doing this, also the target component is highlighted when hovering over it, therefore I believe this issue is a bug and not an omission of the feature.

It looks like the folks at IceFaces are making some progress getting this plugin up to speed. Hopefully in the near future the remaining issues will be addressed.

 
 
 
 

NetBeans IceFaces Plugin First Impressions


Recently Sun announced that there will be no further development for Project Woodstock. Some maintenance will be done in the project, but no new features are planned.

This announcement affects NetBeans Visual Web projects, since they use Project Woodstock JSF components behind the scenes.

Sun is now recommending that current Woodstock applications be migrated to IceFaces. An IceFaces plugin has been available for a while to develop JSF applications visually using the IceFaces components, the plugin works in a way that is very similar to the standard Visual Web JSF NetBeans plugin.

Since Woodstock will no longer be developed, I figured now is a good time to take the NetBeans IceFaces plugin for a spin, to see how well it works, turns out, it doesn't work very well, at least the current version available from the NetBeans Plugin Manager.

The first issue I ran into is that the Java package for managed beans defaults to the project name and cannot be changed. The project name never adheres to standard Java package naming conventions (i.e. com.mycompany.packagename), therefore we end up with classes in nonstandard packages.

Under Windows, I wasn't able to drag components from the palette into the navigator page, this it is possible using NetBeans standard Visual Web JSF functionality (oddly enough, I was able to do this under Ubuntu Linux). I prefer dropping the components in the navigator page instead of directly in the JSP design view, since dropping the components in the design view results in CSS absolute positioning. I'd rather use the JSF standard way of placing components, which is using a panel grid for layout right inside a JSF form component. This issue can be worked around, by placing a grid in the design view then manually removing its "style" attribute, but it feels cleaner to just drop components in the navigator page.

Also, applications developed using IceFaces cannot be run under GlassFish 3. Maybe there is some faces-config.xml or web.xml incantation that needs to be done in order to make this work, I didn't try and didn't research it, all I did was develop a simple test application and try to deploy it.

Here is a partial stack trace from the GlassFish 3 log when attempting to deploy an IceFaces application developed using the NetBeans Plugin:

SEVERE: Can't find TLD for location [http://java.sun.com/jsf/core]. JAR containing the TLD may not be in the classpath
SEVERE: Can't find TLD for location [http://java.sun.com/jsf/html]. JAR containing the TLD may not be in the classpath
SEVERE: Failed to execute JSP lifecycle.
java.lang.IllegalStateException: ICEfaces parser unable to determine JSF implementation ViewTag class.
        at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:152)
        at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:528)
        at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159)

Additionally, when working with standard Visual Web JSF, the "for" attribute of labels and message components can be set by ctrl+shift dragging from the label or message component to the target component. This functionality is not available in the IceFaces visual plugin.

One thing I was looking forward to was finding out if IceFaces wouldn't suffer from my Woodstock pet peeve. In JSF 1.2, the "label" attribute was added to all standard JSF input components. This attribute results in user friendly error messages. The JSF message and messages components by default use the component id to identify a validation error in a component, which is meaningless to the user. The label attribute allows the error message to use a user friendly label, as opposed to the component ID.

Woodstock components have a label attribute that, in addition to enabling user friendly error messages as described in the previous paragraph, actually adds a label to the component. Kind of neat, but it also makes it very difficult to right align all the components and left align all the labels like it is usually done in web applications. Therefore, when using Woodstock, there was always this catch-22 between user friendly error messages and ease of component alignment.

One of the first things I tried when testing the IceFaces NetBeans plugin was to set the "label" attribute on an input text component, and set the component's "required" attribute to "true". I ran the application, submitted the page (purposefully leaving the required input field blank) braced myself and bam! The component id is still shown in the error message, as opposed to my user friendly label, bummer!

I googled a bit and read some people had success with the label attribute using Facelets. I installed the NetBeans Facelets plugin and redid my simple application using Facelets. This time the label attribute "kicked in" and worked as expected.

Although I am not afraid to code things by hand, especially with excellent code/tag completion support like the one found in NetBeans, Visual web provides a nice way to preview a page while working with it, this functionality is lost when using Facelets with NetBeans.

I guess the plugin is "almost there", but the fact that the "label" attribute is ignored is a big bummer. Also, I miss the ability to drop components from the palette into the navigator window, bypassing CSS absolute positioning.

Other functionality we are used to from Visual Web JSF is still there. A request scoped managed bean is created for each IceFaces visual page we create (one caveat, the default package for these managed beans can't be changed, it defaults to the project name, which does not adhere to standard java package naming conventions). Also, double clicking on a command button automatically creates a method on the managed bean to handle its action event.

Although I don't have a lot of experience with this plugin, my impression is that it is better than coding JSF applications by hand, but I really miss some of the missing features from the standard Visual Web JSF functionality.

I would also like to clarify that this entry is not meant to knock IceFaces. I've seen the IceFaces demo apps and I can see that it eases creation of very sophisticated and elegant web applications, I just found some issues with the IceFaces NetBeans plugin that I hope will be addressed in the near future.

Update: a new version of the plugin came out, I tested the new version and wrote my thoughts here.

 
 
 
 

NetBeans Podcast Interview Just Finished


My NetBeans Podcast Interview just finished a few minutes ago.

We talked about NetBeans, Java EE and my book.

There were some interesting questions regarding NetBeans and Java EE, in addition to questions about how I got involved with my publisher, Packt Publishing, and how I got the idea of writing a book about NetBeans.

The podcast is scheduled to come out sometime this month.

 
 
 
 

NetBeans Podcast Interview


I was just invited to be interviewed in the next NetBeans Podcast. Geertjan Wielenga and Lloyd Dunn will be asking me questions about my new book, Java EE 5 Development with NetBeans 6

I'm very excited about the opportunity to be a part of an episode of the NetBeans podcast, I've been listening to it for the past several month to keep up to date on what is going on in the NetBeans world.

 
 
 
 

BlackBerry Bold, Google Maps and GPS


One of the main reasons I upgraded my old BlackBerry device to a BlackBerry bold is because the Bold has GPS. AT&T Navigator is the default GPS application that comes with the device. Although I haven't actually tried it, it seems like a nice application, with turn by turn directions and automatic rerouting. AT&T Navigator comes with a 30 day free trial, after that it adds $10 a month to the cell phone bill.

Although I drive in unfamiliar territory frequently enough that a GPS can be useful, it is not frequently enough to justify the extra $10 a month on the bill. Thankfully there is an alternative. mobile Google Maps on the BlackBerry can take advantage of the device's GPS functionality.

Yesterday I had to make a 50 mile trip, although the trip was on familiar territory, I decided to try out the GPS functionality of the BlackBerry and Google Maps.

One nice thing about Google Maps is that it can provide directions from your current location to wherever you are going. Therefore if hopelessly lost it can find your way for you. Directions "from" and "to" can be entered, or the current location can be used as the starting point.

Once "from" and "to" addresses have been entered, Google Maps will highlight the route in the map, showing clearly where turns need to be made. Where the GPS comes into place, a blue dot will be shown in your current location, therefore you know at all times where you are in the map.

Pressing "I" on the BlackBerry Bold's keyboard will zoom in the map, where "O" will zoom out. I found that the default zoom is sometimes too zoomed in, letting you know about an exit about two seconds before you need to take it. The ability to easily zoom out was very useful. The disadvantage of zooming out is that the street names may become unreadable.

The Google Maps help states that the number "6" needs to be pressed to see the next turn, and the number "4" needs to be pressed to see the previous turn. I thought this would be cumbersome since on the BlackBerry the "alt" key needs to be pressed to punch in numbers. Thankfully it is not necessary to do press "alt" to get the previous and next turns, simply pressing "S" (which with "alt" is the number 4) and "F" (which with "alt" is the number 6) takes you to the previous/next turn, respectively.

Pressing "0" will take you to your current location in the map.

If using the GPS frequently enough, it may be a good idea to invest in a car charger, as leaving the screen on for a long time to look at the GPS takes a toll on the battery.

Although I wish Google Maps would provide spoken turn by turn directions, it really isn't a bad application for those times when GPS functionality is needed, and the price certainly cannot be beat.

 
 
 
 

Installing Amazon MP3 Downloader under Ubuntu 64 bit


Being a child of the 80's, I love listening to music I grew up with. Unfortunately, it seems most of the 80's compilation CDs out there made a conscious effort to find the suckiest songs of the 80's and put them together in a CD. It seemed like the really good music from that era had just but disappeared.

Today while browsing Amazon I ran into some MP3 downloads for some songs I hadn't heard in about 20 years, the good stuff that I thought had dissappeared, I, of course, became very eager to add these songs to my collection.

When downloading individual songs in Amazon, no special software is needed, however, the Amazon MP3 downloader is needed to download complete albums.

They have a few Linux versions for Fedora, Debian, OpenSUSE and Ubuntu. The only version of Ubuntu they support is Gutsy Gibbon, which is two versions behind the latest, Intrepid Ibex.

Feeling brave, I tried to install the Ubuntu Gutsy Gibbon Amazon MP3 Downloader under Intrepid Ibex, unfortunately the installer failed, telling me that the architecture was wrong. The deb package available on Amazon is for i386, and I run the 64 bit version of Ubuntu Linux.

I googled around to see if there was a way to install 32 bit packages under 64 bit Ubuntu, I ran into getlibs.

getlibs is a script that downloads any missing libraries for any installed package.

In summary, what I had to do to install the Amazon MP3 Downloader under 64 bit Ubuntu was to get getlibs from http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb. Simply clicking on the link results in the package opening in GDebi, it should install without issues.

Once getlibs is installed, the Amazon MP3 Downloader needs to be installed, passing a parameter to ignore the architecture difference:

sudo dpkg -i --force-architecture amazonmp3.deb

This will install the package, it will be placed under /usr/bin/amazonmp3, however at this time it won't run properly because of missing libraries. In order to get the libraries, we need to run the getlibs script:

sudo getlibs /usr/bin/amazonmp3

At this point the application should be "good to go" and able to download MP3 albums from Amazon MP3 Downloads.

NetBeans 6.5 Final Now Available


It has come to my attention that NetBeans 6.5 final is now available.

It can be downloaded from the NetBeans web site.

If you would like to learn the ins and outs of enterprise Java development, my book, Java EE 5 Development with NetBeans 6, may help.

 
 
 
 

Streaming Internet Radio on BlackBerry


For a few years, I have been listening to internet streaming radio with Shoutcast, there are several programs in Linux that I can use to listen to the streams, I currently use Rhythmbox, but in the past I have used Audacious and XMMS, they all work great to listen to internet streaming radio on my laptop.

I have been wanting to be able to listen to internet radio on my BlackBerry for a while, but I hadn't been able to find any software to do it. I had seen some references to Radio Bee, but I hadn't been able to get it to work.

Yesterday I decided to look once again, and I bumped into FlyCast, I downloaded it over the air, and it installed flawlessly. The first time I ran it, it asked me to register by providing my email address. Once I did that I was able to run it, and lo and behold, I was listening to streaming internet radio on my BlackBerry Bold!

So far I have only used it with a WiFi connection, and it works great, very little or no buffering. I have yet to try it under 3G or edge, so I have yet to see how well it works when a WiFi connection is not available.

FlyCast's web site does not specify if the software is free, if there is a trial period or if you have to register. I was expecting some kind of nag screen or a point where it would ask me for my credit card information, but so far it hasn't happened, although I've only been using FlyCast for two days. When most songs play, the album cover for the song is displayed on the BlackBerry screen, clicking on it with the trackball takes you to the Amazon site and gives you the opportunity to buy the CD. I assume that is how FlyCast will make its money, by being an Amazon affiliate.

Update: I was able to try FlyCast out over 3G recently and it still works great.

 
 
 
 

Blackberry Bold and Google Sync Gotcha


Like I mentioned recently, I just upgraded my old BlackBerry to a BlackBerry bold.

One very nice application I had in my old BlackBerry is Google Sync, it allows seamless synchronization between the BlackBerry calendar and Google calendar.

Of course, one of the first things I did when I got my new BlackBerry was to install Google Sync. Well, yesterday I added a new appointment to Google calendar, and when I check the appointment on my BlackBerry Bold I noticed that the time for the appointment is wrong, it is set to 5 hours later than the correct time.

Turns out that the BlackBerry Bold comes preset to Greenwich Mean Time (GMT), but of course I am not in that timezone, instead I am on Eastern Standard Time (EST). When synchronizing between Google Calendar and the BlackBerry bold, the timezone conversion was done automatically.

Once I found out what the issue was the solution was trivial, set up the timezone in the BlackBerry bold to EST by going to Settings | Options | Date/Time and setting the correct time zone.

 
 
 
 

Synchronizing Contacts Between Two Blackberries Under Ubuntu Intrepid


I just upgraded my old Blackberry to a Blackberry Bold. I of course wanted to transfer all my old contacts to my new device. I transferred all my contacts to the sim card and installed the sim card in the new phone, however that is a less than ideal solution since the sim card splits the contacts, that is, if a contact has home, phone and work numbers, that one contact appears as three different contacts in the sim card. Also, email addresses are lost when using this technique.

It is no secret that I am a Linux user, however I do keep a spare Windows partition around for the rare cases that I need to use Windows. Today was one of those days.

Blackberries come bundled with Windows software to install applications, synchronize with outlook, perform backups, so on and so forth. I wanted to run the Blackberry software to transfer the address book from my old device to my new Bold.

I booted to Windows vista and ran the installer, while it was running a million security updates and popups were showing up, and windows kept asking me to reboot my laptop. I refused to reboot as I simply wanted to transfer my addressbook to my new bold. Once the Blackberry desktop installer completed, lo and behold, it asked me to reboot. I gave in and rebooted, only to have Windows Vista prevent me from logging in again once it came back up.

When I tried to log in, a Windows Activation dialog window showed up, complaining about the license store containing inconsistent data or something like that. The dialog box had a link to contact HP, my laptop's manufacturer. I clicked on it and I was able to chat with HP customer support. After a lot of back and forth what HP told me is that I would have to do a full system restore, which I refuse to do since it would wipe out my Ubuntu Intrepid Ibex installation.

I googled around for a solution to Windows vista preventing me from logging in to no avail. I tried to transfer the addressbook via bluetooth, but for some reason I don't get the option when I select the Bold from my old Blackberry (I do get the option when I select my bluetooth headset, go figure).

At this point I turned my attention to trying to transfer the addressbook using Linux. I had heard of a utility called Barry that may help me with my issue.

I found Ubuntu deb packages here, unfortunately the most recent version they support at this time is Hardy, I saw no packages for intrepid. I felt brave and installed the packages for Hardy under Intrepid, they installed with no obvious issues.

From the list of packages, barrybackup-gui looked promising. I installed it by simply clicking on the link from Firefox and opening the downloaded file directly in GDebi. There were some unresolved dependencies, which at the moment I can't remember exactly, but all the dependencies are listed in the same page. I simply installed the dependencies and tried again, until all dependencies were satisfied (I only had to install two or three dependencies).

At this point I plugged my old Blackberry to one of the USB ports in my laptop, and executed barrybackup, it detected the blackberry, asked me to identify it. At this point I configured barrybackup to backup only the address book by going to Edit | Config, then clicking the configure button.

I only wanted the addressbook, therefore I clicked "Deselect All", followed by activating the "Address Book" database. I OK'ed my way out of there and clicked on "Backup". After a couple of seconds, I had an addressbook backup in my Linux box.

At this point I unplugged my old blackberry from the USB port, plugged my new one and re-ran barrybackup, it recognized the new device and asked me to identify it. After doing so I clicked restore and it started copying my backups to the bold (word to the wise, it deletes all entries in the existing addressbook before restoring). Unfortunately there was a problem and it only restored a partial number of the entries in my addressbook.

It left out about 20 or so entries, luckily a lot of those I don't need anymore, therefore I ended up having to enter only a few by hand.

Although the Ubuntu/Barry combination wasn't perfect, it sure was a better solution to my problem than Windows vista with the official Blackberry desktop software

 
 
 
 

Installing and Configuring a New MySQL Installation on Ubuntu


I recently got involved in a project that uses MySQL as its RDBMS. I am not a DBA, nor I pretend to be, but I wanted to set up a local MySQL database on my Ubuntu 8.10 Intrepid Ibex laptop.

I ran into some issues that were primarily because of my lack of experience installing or administering MySQL, I assume others trying to do the same will run into the same issues, therefore I decided to write this entry recording what I had to do to get MySQL going for the benefits of others (and possibly some time in the future I might forget the solutions my issues, therefore I can refer to this entry myself if I ever need to setup MySQL again).

The first problem I ran into was that MySQL does not show up in the "Add/Remove Applications" GUI tool, sure there are MySQL clients, but the RDBMS itself is nowhere to be found.

I tried "sudo apt-get mysql" and it turned out there was no package mysql to be installed, at this point I started to suspect that the Desktop version of Ubuntu I have does not include MySQL, not even in the repositories.

Luckily I turned out to be wrong, after some research I found out that the correct package to install is mysql-server, a "sudo apt-get mysql-server" took care of installing MySQL.

Creating a new database worked without issue. I issued the following query to create the database:

CREATE DATABASE somedatabase;

It worked without issues.

The next thing I wanted to do was to create a regular, non administrator user to use MySQL. Following the instructions at the MySQL 5.0 Reference Manual created a user allright.

The following query:

CREATE USER someuser IDENTIFIED by 'password';

did the trick "someuser" is the new mysql login name for the new user "password" is the user's mysql password. Originally I forgot to enclose the password in single quotes, rookie mistake, I corrected the mistake and the query worked without a problem.

Next I wanted to grant the newly created user all privileges on my newly created database, in order to do so, I issued the following query:

GRANT ALL on 'somedatabase' to 'newuser';

At this point I thought I was "good to go", I attempted to log in to mysql by issuing the following command in the command line:

mysql -u newuser -p

At which point I was prompted for a password, I entered the correct password and was denied access.

After a lot of googling and hair pulling, I found out that my grant statement did not work for "localhost", I had to issue a different grant statement to be able to log in using my newly created user.

The following query did the trick:

GRANT ALL on somedatabase to newuser@localhost

It turns out I had to specify use the username@hostname syntax to be able to log in from the same server where mysql is running.

After doing this I was finally able to log in as my newly created user and create the tables I needed for the application I am working on.

 
 
 
 

JavaRanch Book Promotion Over


The JavaRanch book promotion we had this week for my new book, Java EE 5 Development With NetBeans 6 is now over.

There were many good questions over the week about the book and NetBeans in general.

I would like to personally congratulate all the "Java Ranchers" that won a free copy of the book:

  • renu richard
  • Peter Johnson
  • Rogerio Kioshi
  • Ankit Garg
Congratulations to all!
 
 
 
 

Project WebSynergy First Impressions


After blogging about my OpenPortal First Impressions, I was contacted by Eduardo Pelegrí-Llopart, he suggested I take a look at Project WebSynergy, a joint venture between Sun Microsystems and Liferay. Project WebSynergy includes code from Liferay and OpenPortal.

I downloaded it and took it for a spin, here is what I found:

Out of the box, it is much more aesthetically pleasing than OpenPortal

Project WebSynergy Screenshot

Tabs can be created directly from the user interface.

Project Synergy Add Page

Similarly, hovering over a tab results in a little red icon showing up, clicking on it allows the user to delete a tab: Project WebSynergy delete tab

Of course a confirmation dialog asks the user to confirm the deletion of the tab.

Project WebSynergy delete tab confirmation

Project WebSynergy certainly seems to include a lot of built in functionality that may have to be manually coded when using OpenPortal. The advantages I found for OpenPortal was the tight integration it provided with GlassFish and NetBeans.

Although Project WebSynergy is not available from the GlassFish Update center, it can be downloaded bundled with GlassFish. That is what I did to try it out, I'm not sure how easy it would be to deploy it on an existing GlassFish installation.

As of NetBeans, the portlet plugins available in the NetBeans Plugin Manager do not integrate with Project WebSynergy, however, the NetBeans PortalPack 3.0 (milestone 2 is the latest available at the time of writing) does. Simply downloading the plugins from the NetBeans Portal Pack page and installing them on NetBeans (I tried on NB 6.5 RC2) provides the same integration that is provided with OpenPortal by the portlet plugins in the NetBeans Plugin Manager.

All in all my overall impression of Project WebSynergy is favorable, my one concern is that neither the NetBeans plugins nor Project WebSynergy itself are officially released, therefore they cannot be considered stable yet. In my admittedly simple tests they worked fine, but I can't be sure there aren't any issues waiting to be discovered if/when we start using it for real work.

 
 
 
 

NetBeans Book Now Available From Amazon


It has come to my attention that my newly released NetBeans Book is now available through Amazon.

Java EE 5 Development With NetBeans 6 amazon link
Java EE 5 Development With NetBeans 6

It is also available directly from Packt Publishing.

 
 
 
 
 

« April 2024
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today

 
© David R. Heffelfinger