I have now found out what happens when we browse Jetspeed with a UserAgent on which the CapabilityValveImpl returns wml as the mediatype.
1. the line that causes the nullpointer is like you pointed out:
absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ".vm",
2. The reason is that jpt.getTemplate is in fact returning null.
3. The cause of point 2 is that the JetspeedPowerToolImpl.getTemplate(path, templateType, locator, descriptor) runs the following code in which returns null:
TemplateDescriptor template = locator.locateTemplate(descriptor);
This is due to the fact that the descriptor is using mediaType="wml" which again makes Jetspeed look for a template.vm located at apache-tomcat-5.5.20/webapps/jetspeed/WEB-INF/templates/layout/wml/en/US/layout.vm
This template does not exist.
I must admit that I cannot find out how to disable the WML support in Jetspeed when it is not needed. In my opinion the standard install should also default to XHTML and not HTML, but this is another discussion.