Tuesday, August 30, 2005

JasperAssistant: first try

Result: NullPointerException when previewing the report, no matter what the datasource is.

This exception was reported in the forum, and I sent the whole stack trace to it. I hope they fix this serious bug soon, but in this meanwhile let's try other tools.

Update: it works with JasperAssistant 2.0, but I found out that it is a commercial software, and you can download an evaluation version for 21 days only.

Monday, August 29, 2005

PNG: superior transparency

After using PNG graphic format (pronounced as "ping") a little, I already noticed its technical advantage. It is patent-free, endorsed by W3C and it is actually meant to replace GIF and TIFF, but it is not yet supported by every application (including browsers). One of the key features, in my opinion, is the alpha transparency, since it allows binary and variable transparency. Therefore, a PNG image will look great on different backgrounds, while a GIF will not. For this reason, that was the format I had chosen for the images I use in my web application, but I hadn't tested it in Microsoft Internet Explorer. I ended up finding out that it does not support PNG alpha transparency, although Firefox and most of other browsers support it. Therefore, I had two options:

a) Use a JavaScript to fix this problem in IE (see link).


b) Change every transparent PNG to be a indexed image with a matte matching the background color I am using.

The former option seemed the most natural, but I din't like the effect it added to the page when it was displayed (it showed the image not transparent and then it made it transparent using some DirectX features). So I had to manually convert the images to make this application work in the most used browser.

Some resources where I found the information mentioned here:

1. The PNG File Format
2. Portable Network Graphics

Want Tomcat to compile JSP with Java 1.5 code?

Check this link.

If you are using Eclipse WST with Java 1.5, it will complain if your JSP does not contain Java 1.5 code. However, Tomcat 5.5, even though it is supposed to run on Java 1.5, only compiles 1.4 code. The above link shows you how to make it.

Eclipse Web Tools Platform

Yesterday I spent part of the afternoon porting my web application development to Eclipse Web Tools Platform. I was developing it as an usual Java project and always creating a war to deploy into Tomcat everytime I wanted to test. Altough I had already used Sysdeo Tomcat plugin and I knew how to set the context to make Tomcat use my work directory, I stick to this option, so I would have a definitive deployment solution when the development was delivered to the customer. My Ant build.xml had very fancy options, like JSP precompilation, Tomcat connection through its management interface (to install, remove or list applications, among other possibilities).

However, even with these nice features, it took too long to test some minor UI changes, so I decided that I had to make my development more efficient. I almost downloaded Sysdeo and got back to the old way, but since I was already using Eclipse WST (actually only the HTML/JSP/XML editors), I decided to port my project to it. Thus I created a Dynamic Web Project and moved all my classes and files. I knew how to configure a servlet container (from some tutorials) and in a few minutes I had the project working. Despite a few bugs that I spent some hours to figure out a workaround, WST is a very good platform for web development. Now all my taglibs are recognized and I have the possibility of debugging my application, besides a much faster way to develop, since every change is automatically auto-deployed. It was great to know that my customized context.xml file (that resides in META-INF directory) was read and promptly configured in the thin Tomcat configuration that WST creates to run only your project.

Surely you should give it a go if you are developing a web application in Java.

Thursday, August 25, 2005

Concertos BankBoston Pinacoteca


No último domingo tive o prazer de assistir a uma apresentação absolutamente excelente de Daniel Guedes (violino), Zygmunt Kubala (violoncelo) e de Flavio Augusto (piano). Todos excelentes intérpretes e com uma química muito bom quando tocando junto.

O programa foi Brahms - Trio n. 1op. 8; Oswald - Romance n. 2; Bocchino - Seresta; Gershwin - Dois Fragmentos da ópera "Porgy and Bess" e Piazzolla - Invierno e Otoño Porteño. Para mim, Gershwin e Piazzolla foram os especiais dessa tarde de domingo.

Parabéns a esse trio e ao BankBoston pela iniciativa. No próximo domingo temos o Quinteto Villa-Lobos.

Web Developer Firefox Extension and Display Taglib

Check these two applications that may make your web developer life easier:

a) Web Developer Firefox Extension

b) Display Taglib

Xdoclet 1.2.3 does not generate hbm2ddl.auto?

Check this bug report:


Download the hibernate-cfg.xdt file and replace it in xdoclet-hibernate-module-1.2.3.jar file.

Saturday, August 20, 2005

Synchronizing Palm and Outlook 2003

In case you want to synchronize your Palm (mine is Tungsten T3) and Outlook 2003, you may run into problems with calendar synchronization. In the end, it was a problem with some corrupted records in the datebook, what I was able to find using "dbscan", that is available at Pimlico Software as a free download. Outlook synchronization seems to require a non-corrupted calendar file, what does not happen with Palm Desktop. Use dbscan to check your datebook file if you have any problems synchronizing it.

Friday, August 19, 2005

Tomcat resource locking in Windows


For those of you that have problems with JAR or Resource locking when using Tomcat on Windows, check the FAQ above:

I want to redeploy web applications, how do I prevent resources from getting locked?

Most locking issues will occur with JARs from /WEB-INF/lib, and are useally caused by access through URLs. Tomcat has mechanisms to allow avoiding locking. In Tomcat 5.0, a mechanism exists to prevent locking when accessing resources using the getResource method of the URL classloader (many applications, such as Xerces, do not set the use of caching to false before opening the URL connection, causing locking). If such a call occurs, resources inside the JARs will be extracted to the work directory of the web application. In Tomcat 5.5, this mechanism is disabled by default (as it has a non negligible influence on startup times, and is often useless), and can be enabled using the antiJARLocking attribute of the Context element. There is another lock prevention mechanism in Tomcat 5.5 (antiResourceLocking attribute), which will cause the web application files to be copied to the temp folder and run from this location. This has a larger impact on web application startup times, but obviously prevents locking on all resources of the web application. This also allows more flexible management operations as none of the web application resources will be locked, even while the web application is running (as a special note, when making changes JSPs without reloading the application, the changes has to be duplicated to the path where the web application resources have been copied in the temp folder).