cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Painter-Wakefield <paint...@mc.duke.edu>
Subject XSP with multiple logicsheet compilation errors
Date Thu, 13 Nov 2003 20:47:23 GMT




Sorry for the cross-posting; I wasn't sure who would best be able to
answer.  We are using C2.0.3 on Tomcat 4.1.  If it is relevant, the problem
most frequently happens on our servers which are Solaris 8, Apache 1.3.x,
mod_jk.

We keep having a problem occasionally in which logicsheets are not properly
applied to our XSP's, resulting in uncompilable code.  We so far cannot
reproduce the problem reliably.  It usually happens at the worst possible
time (e.g., when we have just deployed new software to production, or
during a demo).  Sometimes the problem can be fixed by stopping and
restarting the web application.  Sometimes the problem can be fixed by
mucking with the XSP source code, although I haven't found any reliable way
to fix it.

We make heavy use of logicsheets, and our logicsheets use other
logicsheets, and so forth so that there is often quite a long chain of
logicsheets that must be applied to generate our source, and I'm sure that
contributes to the problem.  However, the intermittent nature of the
problem leads me to believe that it is a "bug" or at least shortcoming in
the XSP generation code.  A typical symptom of the problem is that some
page will not compile, and when we go to look at the source code, the
source has not transformed tags for one or more logicsheets (often ESQL).
Instead, java code is generated that attempts to output the logicsheet
tags.  So, for instance, if you have code like:
      if (<esql:get-int column="id"/> == -1) { .... }
it turns into:
      if (
            this.contentHandler.startElement(
                  "",
                  "esql:get-int",
                  "esql:get-int",
                  xspAttr
            );
            ...
      )
or something like that, and you can see why it wouldn't compile!

Note that these pages do compile most times, so it isn't due to missing
namespace declarations or anything like that.  The problem doesn't appear
to be due to any problems with our code - the same webapp code that
compiled and ran fine on our workstation or on a test server will suddenly
compile wrong on the production server, then fix itself as soon as we
restart tomcat.  Also, we have seen this happen both with the built-in esql
logicsheet as well as our own logicsheets.

Our best theory at this point (and it is only a theory - we don't know
where in the code to even begin looking for this) is that when an
uncompiled page is called twice quickly (as might happen on a production
server), the two calls interfere with some shared queue or some such which
informs the XSP generator which logicsheets to apply, and in which order.
In other words, some shared structure which is not properly protected for a
multi-threaded environment.  The best evidence in favor of this theory, I
think, is the fact that the bug doesn't happen regularly (say 1 time in 10
deployments), even on the exact same code.

Anyway, does anyone have any ideas about this?  I searched the archives and
found nothing, but is this perhaps a known issue?  Is it fixed in a newer
version of Cocoon?  (We do plan to move to C2.1, but have higher priorities
right now; and since we can't reproduce the problem reliably, we can't
quickly test "just to see" right now.)  Can someone who has worked on the
XSP generation code contact me and perhaps suggest some classes to look at,
which control the application of logicsheets to the XSP source?  Any help
greatly appreciated.

-Christopher


Mime
View raw message