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....

No comments:

Post a Comment

Please leave a comment...