Random thoughts about my interests in Java, consulting, scripting in Java and software development (especially for small and medium size organizations).
Monday, December 1, 2008
iUI Web Development with Grails article
Wednesday, November 26, 2008
Columbus iPhone Developers User Group (CIDUG)
Wednesday, November 5, 2008
Announcing Grails iUI plug-in
You can find more details about the Grails iUI plug-in and how to use it at the iUI Plug-in page. Also keep a look out for an upcoming indepth iPhone Web Development article in GroovyMag.
Eclipse World 2008 Slides
Develop Better Java EE Applications With Eclipse Web Tools Platform (tutorial)
Step by Step: Making Enterprise JavaBeans With J2EE Standard Tools
Beat Those Java Dependencies: Extend the Web Tools Platform With Facets
Interacting With Relational Databases
Thursday, October 16, 2008
Please Be Safe
This is an interesting way to protect your investment. Notice the large cats in the background.
Sunday, August 10, 2008
Enabling the AJAX Spinner in Grails
To enable the Grails AJAX spinner you must include the Prototype or script.acolo.us JavaScript typically using the
If you are using the default layout found in main.gsp, you can declare the Prototype or script.acolo.us inclusions in one of two places. You can either make the declarations in the header section of an individual view such as in this example:
Or in the header section of the main.gsp prior to the application declaration such as in this example.
<head>
<title>Make and Model</title>
<meta equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="layout" content="main">
<g:javascript library="scriptaculous"/>
</head>
If you are not using the standard layout just make sure you put the Prototype or script.acolo.us tag prior to the application tag and include the following or similar div tag found in the default layout.
<head>
<title><g:layoutTitle default="Grails" /></title>
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'main.css')}" />
<link rel="shortcut icon" href="${createLinkTo(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
<g:layoutHead />
<g:javascript library="scriptaculous" />
<g:javascript library="application" />
</head>
<div id="spinner" class="spinner" style="display:none;">
<img src="${createLinkTo(dir:'images',file:'spinner.gif')}" alt="Spinner" />
</div>
Friday, August 8, 2008
Groovy Programming Review
I recommend every serious Groovy and Java developer read at least the second half of the book so congradulations Venkat on an excellent book.
Tuesday, August 5, 2008
Beginning Groovy and Grails is Apress' eBook Deal of the Day
Saturday, July 26, 2008
NFJS COSS 2008 1st Day Wrap Up
I really enjoyed Jared Richardson's, author of Ship It! A Pratical Guide to Successful Software Projects, keynote called Career 2.0. He announced he was writing a book of the same name that he expects to finish in January. In his keynote, he encouraged us to take control of our careers by improving our visibility in the industry. Some of his suggestions for getting started were writing, speaking and contributing to open source. He recommended setting goals but starting with simple steps like writing a blog, giving lunch and learns in your office or contributing documentation to your favorite open source project or maybe one you want to learn more about.
I have to agree with Jared completely. During my exit interview from college with my advisor, I was asked what I wanted to do with my career. I told her I don't know. But I did know there were two things I did not want to do. I did not want to write and I did not want to teach. 12 years, 4 books, several articals, numerous technical classses, many conferences and COJUG presentations I can say that was a very narrow minded view. I have found those are two of my favorite things to do and doing them have opened so many doors including free trips to Europe. I also discovered that contributing and observing open sources has really improved my disipline as a developer. It has allowed me to be exposed to more projects and practices then I could even be exposed to in my consulting practice. It allows me to see more of what works and what doesn't.
I also attended Scott Davis's, author of Groovy Recipes, Blue Pill and Red Pill presentations I had heard so much about from Java One. I was not dissappointed. I think it was a great introduction to Groovy for Java developers.
Friday, July 18, 2008
Validate legacy databases with Grails
By the way, to turn off the version column you will need to set version to false in the domain class mappings. To prevent the id column from being created, you will need to map id to the primary key column of your table.
Wednesday, July 16, 2008
Eclipse 3.4 (Ganymede) is more friendly to Maven Users
Let me start of by explaining what Eclipse Classpath Variables are. As you probably already know, fully qualified paths in code or configurations are a sign of a code smell. It often leads to comments like “It works on my machine”. In Eclipse projects, this commonly happens in adding Libraries to the classpath. Many developers use the Project > Properties > Java Build Path > Libraries and press the Add External Jars button to add jars. This causes a fully qualified path to the jar to be put in the Eclipse .classpath file. If other developers on the team do not have the exact same path, sharing the .classpath file via version control does not work. So I have seen many teams choose to not version control the file to get around the problem. Unfortunately that is not the answer because it takes longer to set up new developers and also leads to “It compiles and runs on my machine” since everybody is using a different library configuration. Another problem that often happens is one developer adds a new library dependency and other team members start getting ClassNotFoundExceptions or code from version control no longer compiles because they didn’t know a new jar dependency was added.
Classpath Variables can solve this by configuring a variable starting point in the classpath and then using the Add Variable button on the Libraries tab of Java Build Properties rather than the Add External Library button, jars can be added in a much more flexible way. As a mater of fact, just two weeks ago when I presented my 10 Eclipse Productivity Tips at COJUG somebody said we had that problem on my last project so we stopped checking in that file because one person didn’t want to conform. After the presentation she realized Classpath Variables could have solved that.
For Maven users a Classpath Variable of M2_REPO is often used and configured to the top of their local Maven repository. Unfortunately, maven repositories can often get very deep and may contain multiple copies of the same or similar jars in different locations. So, navigating the directory structure to add many dependencies can be very time consuming. This is where the new Classpath Variable feature comes in. A new filename filter was added making it easier to see all the jars at once or farther narrowing can be done.
Thursday, July 3, 2008
Free Groovy and Grails training and copy of Beginning Groovy and Grails
Eclipse ${project_loc} errors during Grails development
This is caused by the fact that certain actions can cause Eclipse to loose focus of the current project. To resolve the issue, simply select your current project in the Package Explorer or Navigator and repeat task that caused the error. This can get annoying so another alternative is to replace ${project_loc} with ${workspace_loc}\project_name if your project in your workspace directory.
Monday, June 30, 2008
Tip: Causes of java.lang.ClassNotFoundException
- If you are loading a class by name either using Class.forName() or an Inversion of Control container like Spring it may be as simple as the class name was spelled incorrectly. Validate the fully qualified class name is spelled correctly. The best way is to use the Eclipse “Copy Qualified Name” feature or copying and pasting the package name and class name directly from the source file.
- The mostly likely culprit is the class can not really be found. This can be caused by the directory or jar file containing class not being included in the JVM classpath. The other common cause when multiple class loaders are involved such as in a web container or application server is a visibility problem. For example classes in an ejb-jar do not have access to classes in the war file for the majority of application servers. But classes in the war file have access to classes in the ejb-jar. The reason is the war file typically has its own class loader which is a child class loader of the ear class loader. The basic rule is children class loaders have access to their parents but not visa versa. For this error, check your application server’s class loading documentation and make sure the class that is trying to access the not found class has the acceptable access.
- The most challenging cause to debug is a dependency issue during initialization of a class. During initialization if a class can’t find certain resources it depends on such as other classes or files, this may result in a ClassNotFoundException. To resolve this, you may need to validate all dependencies are available. If you have the code, you can look at the class imports and any static initilization. If you don’t, you might need to reverse engineer the class to determine the dependencies.
Thursday, June 26, 2008
Announcing Beginning Groovy and Grails Book
Virtualization on the Mac; VMWare Fusion vs. Parallels
I bought my first Mac, a Mac Book Pro, just over a year ago. I immediately purchased a copy of Parallels because at the time it was the only viable virtualization option available for Mac. I successfully used Parallels for about 9 months on OS X 10.4 Tiger. I endured some minor annoyances which I will discuss later but over all I was extremely pleased. Then I upgraded to OS X 1.5 Leopard by backing up my whole machine, formatting the hard drive and reinstalling the OS and all my software. After that, I started running into some stability problems which I will describe later. That made me start evaluating other options. After discovering how my friends enjoyed VMWare Fusion, and based on my experience with other VMWare products, I made the switch. So for the past four months, I have been creating all new VMs in VMWare and using Parallels for my existing VMs.
I think both solutions are excellent and I will be the first to admit that some of my issues with Parallels could be self-inflicted. But this experience encouraged me to provide a comparison of the features and things I like and dislike about both products. I hope it helps if you are trying to evaluate virtualization solutions for the Mac.
VMWare Fusion
Over all, I have found VMWare Fusion to be extremely stable and simple which is why it is now my primary VM solution. However, it lacks many of the Mac integrations I enjoy in Parallels and does not have very many configuration options.
+ Stable, works well on OS X 10.5 Leopard and with Spaces
+ Larger community
+ Many reconfigured images
+ VMs can be shared between Windows and Mac versions of VMWare
+ VM is stored in a single stand alone file
- Not very may configurations, including changing a VM name - the solution for that feels very hacky
- Poor integration with the Mac - integration between the Mac and VM is the same as having two separate machines on a network.
- Start up performance from sleep seems slower than Parallels, but that might be because it uses an overlay until the machine is ready so it may just be perceived performance
- Making a clone is just copying a file. When you start the new VM copy, it prompts you as to whether this is a move or a clone which feels very reactive not proactive.
- Virtual library window stays up in the background after the VM is started
- Sound doesn’t work even after following forum and tech tips
Parallels Desktop for Mac
Over all, Parallels excels in Mac integration.
+ Great Mac integration - I love the fact it shows up as a device like any disk image
+ Parallels explorer enables you to see file contents of a VM with out starting it up which can save time when you just need a file
- Unstable with OS X 1.5 especially when using Spaces
- Constantly crashes my whole machine when I plug in a projector while it is running
- Prompts me with warnings of missing devices every time the VM starts up after removing the original base VM I cloned from
- I can not stand that the applications running in the VM are added to my dock. This needs to be changed to a configurable option
- Some times it does not want to shut down without forcing it when certain applications are running
- With Spaces turned on after my Mac wakes up, I get horrible screen painting issues in my VM
Wednesday, June 18, 2008
My Biggest Fan
Saturday, June 14, 2008
Eclipse Productivity Tips
Friday, June 13, 2008
eApps is great for Grails hosting
In episode 58 of the Grails Podcast, Glen and Sven spoke about a Grails hosting service that costs about a dollar a day if used in production. So, I thought I would share my experiences in hosting Grails applications. For the past year I have used eApps for my Java, PHP and Grails hosting. I have been extemely happy with them from a support, feature and price perspective. I have used many hosting services in the past including other Java hosting services and eApps is definitely the best. My Beginning Groovy and Grails co-authors, Joseph Nusairat and Jim Shingler also use them for hosting as well.
eApps starts Java hosting at $20 a month for Tomcat and a offers a $30 option for JBoss or Glassfish which is less than a dollar a day. It also includes database options of MySQL, PostgreSQL or
I personally use the JBoss option while Joseph and Jim are using the Tomcat option.
Wednesday, April 30, 2008
Doughnut Token
This week we experienced a new challenge. Two team members brought donuts in on the same day. There were so many donuts we could not finish them all in one day. So to prevent this tragedy from happening in the future, we started a new practice based on our agile experience. We implemented the first ever donut token. Now we should be able to spread out our donut enjoyment. Unfortunately, there are no known open source donut tokens available. If anybody is inclined to create one, make sure it includes a mobile component so the token can be checked from a Krispy Kreme parking lot.
Tuesday, April 29, 2008
Agile Web Development with Groovy and Grails at ITX Forum
Monday, April 21, 2008
Posted my Agile Development with Groovy and Grails presentation
In addition, I offer to freely give this presentation to any companies or organizations interested in Groovy and Grails in the central Ohio area.
Announcing Polyglot Programming interview with Neal Ford
You can find the interview at the COJUG website.
Thursday, April 17, 2008
Mounting HP Photosmart All-In-One printer SD cards on Mac OS X
Well after a year, I have solved my frustration. I figured out that HP was just using sharing to access the printer and the card became a drive on that share. Below is how I now mount my card without running the HP software.
Mounting SD Cards on HP Photosmart All-In-One Printers
1. Put card in appropriate slot on printer.
2. From Finder choose Go > Connect to Server.
3. Enter smb://
4. Press Connect.
5. When prompted for user name and password select Guest and press Connect.
At this point, your printer should be added as a share and if you are lucky iPhoto will auto start.
Firefox 3 beta 5 Rocks
Saturday, April 5, 2008
Grails Integrated Framework Documentation
Groovy - User Guide - API & GDK
Spring Framework - User Guide - API
Hibernate - User Guild - API
SiteMesh - User Guide - API
Jetty - User Guide - API
HSQLDB - User Guide - API
JUnit - User Guide - API
Ant - User Guide
script.aculo.us - User Guide - API
Prototype - User Guide - API
OpenRico - Demos
Wednesday, April 2, 2008
New g-wizMOBILE CTO
Wednesday, March 19, 2008
Groovy Meta Libraries
Thursday, March 13, 2008
I might be getting this DSL stuff
I took this simple example written in Groovy that only a programmer could love.
println this.class.getResourceAsStream('readme.txt').getText()
This example only reads a file found in the classpath and then prints it to standard out. It might look pretty standard to developers but to anybody else it looks like a cryptic foreign language. This example is even in Groovy which simplifies the code a lot compared to a Java equivalent. (I actually started writing a Java equivalent for this post but it was too painful after writing the Groovy solution so I stopped.)
So after looking at this example, I set out to write the same functionality in a human readable format. In all the DSL sessions I have attended, they always say start of with the end in mind and make it look like a sentence.
So, I came up with "write readme.txt contents". In code it looks like the following example:
write 'readme.txt'.contents()
Not to bad for my first DSL. I think the intent is pretty clear. Next is how I implemented it.
String.metaClass.contents = {
this.class.getResourceAsStream(delegate).getText()
}
def write = { file ->
println file
}
write 'readme.txt'.contents()
You can see I used a little bit of Groovy's MOP (Meta-Object Programming) to add a contents method to the String class that does the resource loading base on the delegate which is the object on which the message was passed which in this case is the 'readme.txt' String. Next I defined a write closure that does a println on the parameter passed. Note using Groovy's optional parentheses makes it flow much more like a natural sentence.
Now that I have reached this milestone, I am afraid all standard code is going to repulse me. I know I am stuggling to write Java code after having used Groovy.
Other advantages to Apple distribution model for iPhone apps
Wednesday, March 12, 2008
Apple's iPhone application deployment model is fair
I happen to think this model is quite fair. Here is a list of things included with sharing 30% with Apple:
- distribution
- credit card transactions
- marketing
- platform
I also can't believe the Standard Developer Program is only $99. I have been developing J2ME application for several years now. Whenever you deploy you typically need to sign the J2ME app it can be $500 for a single deployment option because of certificates. If want to make your application available through several carriers you might have to have several certificates which cost additional money and add to the packaging and deployment complexity.
But the final benefit is the program includes free distribution for free apps. So if you don't want to share 30% with Apple, there is a missed revenue opportunity in Apple's plan. I have not heard or seen anything relate to participating in sharing for any other monetization options. So if you give away your application for free but sell ads, you can save it all :)
Finally, if you are looking for iPhone developers please contact me, I am very excited about the platform and would love the opportunity to work on this new frontier.
Monday, March 10, 2008
Free Groovy and Grails lunch and learn
Groovy Ant task is for Groovy Scripts
final GroovyShell groovy = new GroovyShell(classLoader, new Binding(), configuration);This behavior was unexpected since it does not follow the normal Ant convention and because the documentation states the src attribute is a File containing Groovy statements rather than stating it expects a Groovy Script.
try {
final Script script = groovy.parse(txt, scriptName);
script.setProperty("ant", new AntBuilder(this));
// code removed for brevity
script.setProperty("args", cmdline.getCommandline());
script.run();
}
Tuesday, March 4, 2008
Excellent cell phone browsing experience with Opera Mini
Tuesday, February 26, 2008
Announcing FallME 0.6.0
Sunday, February 17, 2008
Will Grails Hurt the Spring and Hibernate Brands?
Could Grails cause Spring and Hibernate to become the BASF of the Java community and adopt the tag line of "We don't make a lot of the products you develop with. We make a lot of the products you develop with better". It is hard to tell at this point. But it is probably a good idea for the companies offering Spring and/or Hibernate services to take a hard look at Grails and consider providing Grails services as well.
Tuesday, February 12, 2008
Amazon Web Services at COJUG
Amazon Elastic Compute Cloud (Amazon EC2)
Amazon Flexible Payments Service (Amazon FPS)
Amazon SimpleDB
Amazon Simple Storage Service (Amazon S3)
Amazon Simple Queue Service (Amazon SQS)
Mike made a great business case for each of these services and how then can really benefit different types of scaling concerns at an unbelievable price. He also stressed their incredibly high level of security and redundancy. He told us the government uses them for storage because of their high level of physical and data security as well as how auditors aggressively test disaster recovery.
I am very impressed with what I heard and saw. I have not seen any other infrastructure in my travels that can compare. Amazingly enough, I heard two other podcasts today that talked about these services unrelated to any Amazon propaganda. I hope I get to work with some of these technologies in the near future.
Monday, February 4, 2008
Grails Encourages Best Practices
Another example is tag and controller integration tests automatically inject mock request, response and session objects. I have seen many projects with no unit tests for the web components or unit tests that require deploying the application because they do not use mock objects. By automatically including mock objects developers no more have to download and add jars for mock web frameworks or even create instances of the mock objects. This should save time and help improve unit tests.
Wednesday, January 30, 2008
Announcing FallME
Thursday, January 24, 2008
Touch is a PDA not an iPod
Thursday, January 10, 2008
Open source of the week - PDFCreator
Tuesday, January 8, 2008
Rod Johnson is coming to COJUG
AWS EC2 Hibernate Java SDK v2 Example
I recently wanted to automate the creation of developer VMs in AWS using EC2 instances. To improve the developer experience (DX), I didn...
-
In May of 2009, I wrote the blog post The Ultimate Enterprise Java Build Solution . Over the past 7 years since I wrote the post I have help...
-
Early in my career I took on the role of setting up and operating the build infrastructure of many of the projects I have consulted on. I st...
-
Class loading issues are a common frustration for many Java developers. The dreaded java.langClassNotFoundException means they can forget a...