Dear all, I'm currently playing around with the portal framework (2.1 M2, jdk 1.3.1, resin 2.0.4). I'm trying to create a configurable coplet. Because the basis for the configuration is dynamic, I want the configuration to be created by an XSP instead of a static XML. However, I get really weird results. Most often it does not work, because I get NullPointerExceptions (from different places, e.g. org.apache.cocoon.environment.AbstractEnvironment, line 511), or the portal simply refuses to show the content of the coplet and keeps showing the configuration (but no errors in the logs). But what's really frustrating: sometimes it works. I have been trying for the last couple of hours to create an easy example for this list that never works, but it seems impossible.
Anyway, this shows basically what I'm trying to do: <?xml version="1.0" encoding="ISO-8859-1"?> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:session="http://apache.org/cocoon/session/1.0"> <page> <session:form name="coplettest" method="POST"> <session:action> <session:getxml context="portal" path="/configuration/uri"/> </session:action> <session:content> <xsp:logic> for(int i=1; i < 4; i++) { <xsp:content> <session:inputxml context="portal" type="text"> <xsp:attribute name="path">/coplet-data/value<xsp:expr>i</xsp:expr></xsp:attribute> <xsp:attribute name="name">Value<xsp:expr>i</xsp:expr></xsp:attribute> </session:inputxml> </xsp:content> } </xsp:logic> </session:content> <input type="submit" value="Change"/> </session:form> </page> </xsp:page> This is the pipeline: <map:generate type="serverpages" src="resources/auth/copletconfig-test.xsp"/> <map:transform type="session"/> <map:transform src="styles/config2html.xsl"/> <map:serialize type="xml"/> This didn't work half an hour ago, now it works... right, I'm just back from lunch, now it doesn't work anymore. I tried it with Cocoon 2.0.4 and ran into the same problems (no NullPointerException yet, but also the refusal to show the content after doing the configuration). Any ideas? Are there any known problems with configuring coplets via XSP? To me, this smells like a race condition, but I have no idea how to pinpoint it. Cheers, Holger -- Holger Dewes