Wednesday, May 28, 2008

Great Seam Security Article for 2.1.0GA

Check out the link below for a great article that discusses the new security features in Seam 2.1.0GA!

http://shane.bryzak.com/blog/articles/seam_security_gets_an_upgrade

Friday, May 23, 2008

Java SE 7 - What would you like to see?

As always, The Java Posse had another great interview in show #187.  This time, they interviewed Danny Coward who is "Chief Architect of Sun's Client Software, and Sun's Java SE/EE representative on the Executive Committee for the JCP".  I highly recommend listening if you are interested in learning about the future of Java SE and what SE 7 may bring.

One of the interesting topics in the interview was about what will be included with Java SE 7.  I thought I'd start a blog post to capture some of the community's ideas about what should be included in the release.  

What would you like to see in the release of Java SE 7?

Wednesday, May 14, 2008

Jython Monthly Call for Articles - May 2008

Let's get Jython back in the spotlight!  Send in some articles about Jython for distribution in this month's newsletter.

Please post all articles/tutorials in the following area:  http://wiki.python.org/jython/JythonMonthly/Articles/May2008

All contributions are welcome!

Tuesday, May 13, 2008

Netbeans 6.1 - Facelets and Seam Support!

It is not official yet, but I learned that you can download and build the facelets and seam support projects for Netbeans while reading today's Netbeans newsletter.  I will give a thumbs up in the affirmative as I have followed the directions within the blog and successfully achieved Facelets and Seam support within 6.1!

Thanks for the excellent blog and for the time which was put forth in working on these projects!

Wednesday, April 30, 2008

Java 1.6 on OSX

I love my Mac even more today...Java SE 6 version 1.6.0_05 has finally been released (as if you hadn't already heard).  This is great news for any Mac Java developer!
Just remember, if you had installed a beta version of 1.6 then you will have to manually remove /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0 before you can get the update via Software Update.

Tuesday, April 29, 2008

Netbeans 6.1 - Out of the Box

I really haven't gotten too far into it yet, but I've just installed Netbeans 6.1 final edition.  So far, I can say that the start up time seems good, and I am glad that all of my libraries were migrated out-of-the-box.  I simply used the import prompt to grab all of my settings from 6.1 and I was good to go.  This is great news...it means that I can just start using Netbeans 6.1 with no additional configuration overhead.  

That's all for now...I'm looking forward to using another great product from the Netbeans team!

Wednesday, April 23, 2008

Grails - Coding and Accessing a simple custom controller method

If you've ever worked with Grails, then you know how easy it is to create domain classes which map to database tables. Similarly, it is easy to access the database via the automatically generated conroller methods that are available (create, list, delete, save, edit, show). However, if you need to perform a particular operation against the database which is not accomplished by using any of these automatically generated methods, it is still easy...but perhaps not very intuative. Once you learn how to accomplish this task then the entire power behind using hibernate and accessing your database is at your hands.

It really is as easy as 1, 2, 3 to create additional controller methods...especially if you know how to use the Groovy language itself. I will show you how to create a simple finder method which takes a parameter and searches a particular database table for the value of that parameter...then it returns the results.

As you already know, the list method for each Grails controller is already created for you...let's look at my list method for the "Test" domain class (database table):

def list = {

if(!params.max) params.max = 10
[ testList: Test.list( params) ]
}


This is all well and good, but it returns the entire dataset for the Test database table. What if I only wish to return all of the records which have foreign key id of 35? Let's say that our foreign key id variable is fkId to make it simple. So what we want is to return all members of the list returned using the "list" method above which have fkId == 35.

We need to first obtain the complete list of results, and then filter it out accordingly. This is where the power of Groovy comes into play. We could use Java and write a filter so that we iterate through each of the items in the complete list of results searching for instances where fkId == 35 and then adding those matching objects to another list. That would be lots of code though. Let's use a Groovy closure to accomplish the same thing. Take a look at the "find" method which does just that:

def find = {
def testList = Test.list( params)
[testSearch : testList.findAll{it.fkId == Integer.valueOf(params.fkId)}]

}

Ok, simplicity at it's finest! We first obtain the complete list from the database table into the testList object. Then, we use the Groovy "findAll" method to search that list for all instances where fkId == the value of our parameter which is passed in (params.fkId)...let's assume that the parameter equals 35. We store our results in the testSearch list.

Now, how do we access this method? Well, we have to create a Groovy Server Page named find.gsp to show our results. We also need to pass the fkId parameter to this method somehow. Here is a simple find.gsp which will iterate through all of the objects which are returned within the testSearch list.  Of course...this is just a quick page with ugly results...but you can clean it up to suit your needs.

find.gsp:

<g:each in="${testSearch}" status="i" var="test">
   FieldOne:  ${test.fieldOne}
   FieldTwo: ${test.fieldTwo}
</g:each>

Now, what is the URL which we use in order to access our new controller and page?  Assume that our application name is "site" and we are passing a parameter of fkId = 35...

http://localhost:8080/site/test/find?fkId=35

Easy enough, but it took me a bit of time to figure out when I first tried it.  Hopefully this post will save you some time and get you adding some much needed functionality to your standard Grails app.



Friday, April 18, 2008

Groovy - Grails Work

Onto new stuff...I have been working a lot with Grails lately. This is the technology that I have chosen to use for the implementation of the gathereventplanning.com website. While Grails is easy to use out of the box, I have found myself searching the net for information regarding customization. No doubt about it, unless you are creating your own simple CRUD application, you will want to customize the program in one way or another.

There have been many articles and blogs written about creating Grails applications and customizing them, but perhaps one of the best I have found so far is the Mastering Grails series...it has been quite helpful thus far.

I'm not going to get too technical in this brief post, but I will say that I have found a bug already. The issue resides in the Grails 1.0.2 release. I had created and customized a tiny CRUD application for testing purposes using the embedded database that comes with Grails. All was good until I attempted to "hook" my program to a PostgreSQL database instead. At that point the application was in read-only mode as it was unable to perform any batch inserts or updates to the database. Each time I tried to insert or update data, I received a stack trace stating that there was a SQL Grammar error.

I scratched my head for days on this one, looked at lots of hibernate documenation (since this is used behind the scenes in Grails), and even tried to change my domain model a bit to see if that would work. Eventually, I ended up downloading Grails 1.0.1 and trying to do the same thing. It works perfectly...no issues as yet. I have been able to successfully re-create my small application and use a PostgreSQL database without issues.

My guess is that this will be resolved with Grails 1.0.3 release, but we will see. So far, I love Grails as it is quite powerful and easy to use. Other than the bug I found, the only complaint I have is that Grails is so involved...many plug-ins are available and the Grails documentation is huge as it is. If you really want to become an expert Grails developer, you will be doing a lot of studying...but learning new technology like this is fun stuff.

Monday, April 14, 2008

Netbeans 6.1 Beta - Subtle Issues

I've been using Netbeans 6.1 beta for most of my development since it has become available. Until recently, I hadn't noticed any issues while using it. Late last week I think I've encountered a subtle, but time consuming issue.

I am in the process of migrating my Seam applications from 1.x to 2.0.1 at this time. In doing so, I am also adjusting libraries within Netbeans as necessary. As you may know, when moving from older versions of Seam you must update all JSF pages to comply with JSF 1.2 standards...so these libraries must be updated as well.

The issue arose when I attempted to deploy one of my applications to my test environment which is running Glassfish V2. Many class not found issues appeared in the server log each time I tried to deploy. At the bottom of the stack trace I received a misleading message stating that there were "Errors in the EjbDescriptor". This led me searching my ejb-jar.xml, pages.xml, and web.xml files looking for issues. As none were found, I tried to give it the old clean, rebuild, and deploy once again...same issue.

At this point I began comparing with another successful Seam 2.0 migration and there were really no apparent differences. I spotted the problem when I went to the file system and looked in the application's dist directory. None of my Seam 2.0 libraries were being packaged with the deployment.

As it turns out, if you repackage and change libraries for an existing application within Netbeans 6.1 beta, then you must do the following:

1) Right click on the project, and choose properties.

2) Navigate to Libraries and make necessary changes.

3) YOU MUST check and uncheck the package checkbox within the libraries configuration...even if it is checked by default. This must update the build script for Netbeans because this was checked by default, but my libraries were not included.

After I unchecked the library package box and then re-checked it everything worked fine. The necessary JAR files that are contained within my included Netbeans libraries were deployed with my app and it works fine now.

Not a big issue, but an issue that is definitely not obvious and took me some time to figure out. I still recommend Netbeans 6.1...but I am not moving to RC1 at this time. I will probably wait for the production release because I do not want to migrate my libraries manually...

Happy NetBeaning....

Monday, April 07, 2008

Shameless Self-Advertising

Time for a bit of shameless self-advertising. I'd like to let everyone know about a new hosting service I've started to assist individuals in event planning. If you or anyone you know needs to plan an event sometime soon, please take a look at my site and see if it will help out. Gather Event Planning offers individuals their own dedicated web site for organizing an event. The website includes a news blog, member registration, member forum, email contact lists, and much more to help aid in the process of planning an organized event.

There is no fee to try the service...only an email address is required. If you use the service for less than 30 days then it is free. This will allow anyone to plan a short-term event (such as a surprise party) without incurring any charges. There are plans available for those who wish to host a long-term event site for class reunions and such.

Enough gabbing about the service, feel free to give it a try and then let me know what you think.

Visit the site at http://www.gathereventplanning.com for more details.

SeamFramework.org - In case you did not know...

I wanted to let everyone know about another great JBoss SEAM resource, it is the seamframework.org website. This site includes a lot of documentation, as well as a community for SEAM developers.

Another good reason to use the SEAM framework!

Jython Monthly Call for Articles - April 2008

The April 2008 edition of the Jython Monthly newsletter is scheduled for distribution on April 15, 2008.

Please post any articles or contributions for the April 2008 distribution of the Jython Monthly newsletter at the following link:

http://wiki.python.org/jython/JythonMonthly/Articles/April2008

Visit http://wiki.python.org/jython/JythonMonthly/Articles/Submitting for details regarding newsletter artical submittals.

All contributions are appreciated! Please feel free to contact me if you have any questions.

Tuesday, April 01, 2008

Groovy Netbeans Plugin

After searching for a while to find information regarding the Groovy and Grails Netbeans plugin, I determined that it is only available if you download and use a nightly build. You must download a nightly build and then go to the plugin manager to find it.

Ok, that is good news, so now I will get to try out the plugin and see how it works. One slight reminder though, if you download and use a Netbeans nightly build then none of your created libraries will be carried forward. I've got too many libraries created so I plan on using the nightly build to evaluate the Groovy plugin only...I will continue my day-to-day development on the NB 6.1 release.

I wonder if a Jython plugin is in the future? One would think that since a couple of Jython gurus have been hired by Sun, we may have some hope for good Jython support in a future Netbeans release...let's hope so!

Wednesday, March 19, 2008

Netbeans 6.1 Beta

I've downloaded the latest Netbeans 6.1 beta release and installed it on my Mac today. I haven't had too much time to work with it as yet, but thus far I have found the following to be nice:

- No need to manually set up libraries or import projects, ALL of my settings from 6.0.1 have been imported successfully!

- Javascript support is nice

- Startup time has been greatly reduced!

These are some of the improvements I've seen within the last few minutes of looking around. It also seems like my applications build faster and deploy to Glassfish V2 with improved speed...

I have found one negative point so far...Facelets support is completely gone from what I can see. My facelets support plugin https://nbfaceletssupport.dev.java.net/ which worked in 6.0.1 does not load anymore. All XHTML documents now look like plain old JSP...but I cannot say whether code completion for facelets will work or not as I have not really had a chance to test thus far.

If you are looking to see improvements and don't mind losing the facelets plugin support, I recommend giving it a try.

Tuesday, March 11, 2008

Jython Monthly Call for Articles - March 2008

The March 2008 edition of Jython Monthly is scheduled to be distributed next Tuesday, March 18th. Everyone would definitely like to see more articles and/or tutorials, so if you have any content that you'd like to share then please submit it to the following area:

http://wiki.python.org/jython/JythonMonthly/Articles/March2008

Thanks in advance for all contributions!

P.S - Way to go Frank!! Good luck at Sun!

Tuesday, February 12, 2008

Jython Monthly Call for Articles - February 2008



Please submit new articles and/or tutorials for the Feburary 2008 distribution of Jython Monthly. Feel free to write or teach about any topic that is Jython related...the more articles the better!

Thanks in advance for your participation!

Monday, February 11, 2008

JavaFX Script - An Excellent Read

I finished reading the JavaFX Script book by James Weaver a couple of days ago. I ordered this book from Amazon last November, and it just arrived last month. I have to say that I was getting a bit impatient about the delay, but it really was worth the wait.

If you are new to JavaFX like me, then you will find this to be an excellent starting point. The book is really geared towards developers who are interested in authoring small Swing-like applications. I'd have to say that it helped to have a good background in Swing prior to reading this book...but I think that anyone could pick it up and just start from scratch. James does a great job from start to finish as he builds upon concepts as the book goes on. It really is a start-to-finish book, but at 200 pages, that is not very rough to read straight through. It really is a quick read, and quickly jumps into the basics and works up from there. I was also impressed with the example applications used in the book as they gave me a great sense of what the language is capable of doing.

This book is definitely worth the read if you are interested in learning JavaFX basics and beyond.

Thursday, January 24, 2008

EJB 3.1 - Significant Changes Sound Promising

Being a big fan of the EJB 3.0 specification, I read this new EJB 3.1 New Features article published by Serverside right away. Clearly, the current EJB spec is much simpler to use and maintain than previous generations. Building upon that logic, the upcoming EJB 3.1 specification looks even better.

Real quick, I just wanted to point two of the features I found most interesting about this article. First, it sounds like interfaces will be made optional. This could be viewed as a bonus or a downfall, depending upon the way you look at it. Certainly removing the need for interfaces will simplify the writing of EJB code immensely. However, the benefits of using the loose-coupled approach may make EJB more difficult in some circumstances. If you enjoy unit testing of EJB code, this may make a big difference. However, since the specification plans to make this an optional feature then it will leave the implementation to the coder. Therefore, this seems to be a feature that can greatly benefit those who do not wish to write EJB interfaces.

Second, the article briefly mentions support for stateful web services and EJB timer service enhancements to support scheduling and/or deployment-time timer creation. I will be interested to hear more about these.

Give the article a read if you are interested in EJB...it is worth the time.

Thursday, January 10, 2008

Oracle JDeveloper 11g Technology Preview 3 Released

I recently downloaded the new JDeveloper 11g Tech Preview 3 for my Mac, and I am impressed. While I primarily use Netbeans for Java application development, the JDeveloper IDE is great for developing PL/SQL and Java Stored Procedures.

All of the new features in this technology preview are amazing. I understand that if you develop Java applications within the JDeveloper IDE then there have been many enhancements and improvements as well. For instance, the SOA and Web Services modules have had some significant adjustments.

My primary use of the JDeveloper IDE is for PL/SQL and Java Stored Procedure development. If you are looking to create and/or maintain any PL/SQL, then this tool can help you greatly. The new editor is nice, package body and header separation is a plus, and the automatic SQL command window is nice to have. One no longer needs to open a SQL Worksheet to invoke an SQL statement, it opens automatically when a database connection is selected. Of all the great SQL IDEs available today, I do not think any are better than JDeveloper for managing Oracle Java Stored Procedures. Straightforward and easy to manage, developing Java Stored Procedures for the Oracle database has never been easier.

I recommend downloading the technology preview and giving it a try. Even if you do not develop any SQL or PL/SQL code, you may find that it has some nice features to benefit your Java development.

Tuesday, January 08, 2008

Glassfish - A Noteworthy Application Server

I've been running across quite a few blogs lately speaking about Glassfish. It appears that this great application server is being used by more people and gaining some real popularity. I've been using Glassfish since version one. Actually, prior to Project Glassfish, I used the Sun Java Application Server version 8.

I have nothing bad to say about Glassfish. It is an excellent choice for a JavaEE application server. Powerful and easy to use, this application server should not be overlooked if you are in the business of Java web development.

I have not yet tried out version 3, but I plan to do so very soon. I've been working primarily with Glassfish version 2 for the past few months. I've found it very easy to deploy JBOSS Seam applications to Glassfish even though there is no direct IDE deployment option for this setup as yet.

I will post any issues or concerns with using Glassfish V3 and JBOSS Seam...