Diving into Tapestry

Starting this week we started looking at Jakarta Tapestry. The main motivation behind this is the fact that it relies on ordinary HTML tags so we can clearly separate the roles of designer, HTML programmer, and Java developer. It’s been painful to use Struts in graphically rich Web applications and JSF didn’t make it better so far.

We use Tapestry in Action to get started and somehow ToDo list application from chapter 3 didn’t seem to output the list of ToDo items. I didn’t have time to dig the problem and started looking for more examples to find the one that works from Sandcast Software.

Making Apache 2.x with custom-built PHP 4.x happy on FC3 with no original PHP RPMs installed

After uninstalling original PHP 4.x RPMs on FC3 and install a custom-built version, I’ve discovered that our PHP applications don’t work when I try to use them, instead a directory listing or the contents of the PHP files are displayed. This probably has to do with the fact that httpd.conf was updated after removing native FC3 PHP 4.x RPMs to not recognize php files in general and index.php in particular. Adding php.conf to /etc/httpd/conf.d with the following contents solves the problem:

LoadModule php4_module  /usr/lib/httpd/modules/libphp4.so

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php

Adding cyrus-imapd users with only imaps enabled

The first step is to enable non-secure imap. In order to do this, /etc/cyrus.conf should have:

imap cmd="imapd" listen="imap" prefork=5

instead of

#imap cmd="imapd" listen="imap" prefork=5

After this, cyrus-imapd should be restarted with:

/sbin/service cyrus-imapd restart

Now we can connect to non-secure imap service:

cyradm --user cyrus --server localhost --auth plain 

and add a user:

createmailbox user.logon

We are done.

The last thing is to disable regular non-secure imap again in /etc/cyrus.conf:

#imap cmd="imapd" listen="imap" prefork=5

Installing JK Connector on Fedora Core 3 with Tomcat 5.5.x and Apache 2.0.x

In order to build JK Connector on Fedora Core 3, httpd-devel package containing apxs must be installed.

First, download JK Connector sources from http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/

Next, go to jk/native directory and execute the following commands to build the connector:

1
2
3
./configure --with-apxs=/usr/sbin/apxs
make
su -c "make install"

Last, go to /etc/httpd/conf.d and create jk.conf file with the following example contents:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /opt/jakarta-tomcat-5.5.9/conf/workers.properties.minimal
JkLogFile /opt/jakarta-tomcat-5.5.9/logs/mod_jk.log
JkLogLevel debug
Alias /blojsom /opt/jakarta-tomcat-5.5.9/webapps/blojsom
JkMount /blojsom/* ajp13w
<Location "/blojsom/WEB-INF/">
AllowOverride None
deny from all
</Location>
<Location "/blojsom/META-INF/">
AllowOverride None
deny from all
</Location>

You are done!

The last section of jk.conf defines the rules for blojsom web application and is written on per-application basis in this example.

Check out the log file (/opt/jakarta-tomcat-5.5.9/logs/mod_jk.log) to see whether you have any problems.

SEVERE: Error listenerStart

Just found how strangely Tomcat 5.5.9 running on JDK 1.4.x reacts to the fact that a web application was compiled with JDK 5.0 Instead of showing some meaningful error the record in catalina.out looks like this:

Apr 26, 2005 6:29:52 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 26, 2005 6:29:52 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/cm] startup failed due to previous errors

The problem becomes obvious only after looking into localhost log where the following error message can be found:

SEVERE: Error configuring application listener of class cm.common.SessionListener
java.lang.UnsupportedClassVersionError: cm/common/SessionListener (Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code))
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java(Compiled Code))
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java(Compiled Code))
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java(Compiled Code))
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java(Compiled Code))
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3617)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1165)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java(Compiled Code))
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java(Compiled Code))
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java(Compiled Code))
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java(Compiled Code))
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
        at java.lang.Thread.run(Thread.java:567)
Apr 26, 2005 6:35:28 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)

which makes much more sense.

It took quite some time to figure out what was wrong.

Gantt chart issue completely resolved

I finally found how to fix the Gantt chart issue completely. It IS a bug of version 2.0.1 The solution comes from here and is the following (original text preserved):

open modules/tasks/gantt.php an modify line 137 like down below for instance until I have sorted out with the concnering developer what to do:

// This configuration variable is obsolete = line 137
$jpLocale = dPgetConfig( 'jpLocale' );
if ($jpLocale) {
$graph->scale->SetDateLocale( $jpLocale );
}
//$graph->scale->SetDateLocale( $AppUI->user_locale );

dotProject Gantt chart generation problem

The error:

JpGraph Error. You are trying to use locale (en) which your php installation does not support. Hint: Try to use ' ' to indicate default locale for this geographic region.

This can be solved by setting up the JPGraph Locale in ‘System Admin’> ‘System Configuration’. One needs to wait a little bit, maybe log out from dotProject for the settings to take effect. The thing killed several hours of my time.