Bug 40113 - [PATCH] Build failing for Lenya 1.4 latest svn trunk
Summary: [PATCH] Build failing for Lenya 1.4 latest svn trunk
Status: RESOLVED FIXED
Alias: None
Product: Lenya
Classification: Unclassified
Component: Build System (show other bugs)
Version: 2.0
Hardware: All Windows XP
: P2 major
Target Milestone: 2.0
Assignee: Lenya Developers
URL:
Keywords:
: 40017 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-26 11:59 UTC by Rakesh Midha
Modified: 2007-07-16 01:58 UTC (History)
1 user (show)



Attachments
patch for src/targets/modules-build.xml (991 bytes, patch)
2006-08-05 20:26 UTC, Michael Wohlfart
Details | Diff
patch for module build process (5.88 KB, patch)
2007-04-24 19:50 UTC, Josias Thoeny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rakesh Midha 2006-07-26 11:59:47 UTC
I download the svn trunk today of the Lenya 1.4 and I tried again to run the
build for Tomcat deploy but it fails with following error

prepare-modules:
Processing C:\marquis1\lenya1.4_2607\lenya-1.4.x\build\lenya\temp\modules.xml to
 C:\marquis1\lenya1.4_2607\lenya-1.4.x\build\lenya\temp\modules-build.xml
Loading stylesheet C:\marquis1\lenya1.4_2607\lenya-1.4.x\src\resources\build\mod
ules2build.xsl
C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/resources/build/modules2build.xsl:66:1
09: Warning! Can not load requested doc: Programmer's Error!  putDocumentInCache
 found reparse of doc: file:///C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/modules
/bxe/module.xml
C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/resources/build/modules2build.xsl:66:1
09: Warning! Can not load requested doc: Programmer's Error!  putDocumentInCache
 found reparse of doc: file:///C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/modules
/cforms/module.xml
..............................................................
98: Warning! Can not load requested doc: Programmer's Error!  putDocumentInCache
 found reparse of doc: file:///C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/pubs/de
fault/modules/defaultusecases/module.xml
C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/resources/build/modules2build.xsl:106:
98: Warning! Can not load requested doc: Programmer's Error!  putDocumentInCache
 found reparse of doc: file:///C:/marquis1/lenya1.4_2607/lenya-1.4.x/src/pubs/de
fault/modules/homepage/module.xml
Processing C:\marquis1\lenya1.4_2607\lenya-1.4.x\build\lenya\temp\modules.xml to
 C:\marquis1\lenya1.4_2607\lenya-1.4.x\build\lenya\temp\modules.xconf
Loading stylesheet C:\marquis1\lenya1.4_2607\lenya-1.4.x\src\resources\build\mod
ules2patch.xsl
Processing: C:\marquis1\lenya1.4_2607\lenya-1.4.x\build\lenya\temp\modules.xconf

Writing: C:\marquis1\lenya1.4_2607\lenya-1.4.x\build\lenya\webapp\WEB-INF\cocoon
.xconf

BUILD FAILED
C:\marquis1\lenya1.4_2607\lenya-1.4.x\src\targets\webapp-build.xml:163: The foll
owing error occurred while executing this line:
C:\marquis1\lenya1.4_2607\lenya-1.4.x\src\targets\modules-build.xml:66: The foll
owing error occurred while executing this line:
Syntax Error: Depend attribute for target "patch-modules-test" has an empty stri
ng for dependency.
Comment 1 Oliver Schalch 2006-07-27 07:18:00 UTC
I've just tried to compile latest trunk without having any errors on Windows
Plattform.
Comment 2 Michael Wohlfart 2006-07-27 08:03:02 UTC
this is strange, 
i had problems with JDK 1.5 on XP some days ago 
and patched a patch for that which hasn't been integrated 
yet as far as i know :-/
http://issues.apache.org/bugzilla/show_bug.cgi?id=34191
Comment 3 Thorsten Scherler 2006-07-27 15:53:05 UTC
The zones server is buiding fine as well. 

Please make a backup copy of your local.build.properties and create a new on
based on the build.properties aka
cp local.build.properties local.build.properties.bck
cp build.properties local.build.properties

I can remember having to do this on the zones server.
http://lenya.zones.apache.org:9999
Comment 4 Michael Wohlfart 2006-08-05 19:51:17 UTC
I can reproduce this error on two different winXP/JDK1.5 machines,
seems like a windows problem in the modules2build.xsl stylesheet.

Fumbling with local.build.properties doesn't help me at all.

In modules2build.xsl there are two Variables generated:
compileDependencyList and testDependencyList, both are compiled in 
similar for-each loops containing a select="document(..)" expression
however in the second loop the document() doesn't return any xml 
fragment. 
I changed the order of the for-each loops, it seems to be always the 
second call to document() with the same file that doesn't work :-/

someone seen something similar, i have no clue what's going wrong here.
Comment 5 Michael Wohlfart 2006-08-05 20:26:31 UTC
Created attachment 18680 [details]
patch for src/targets/modules-build.xml

adding the xslt transformer factory seems to solve this issue,
looks like i got the wrong transformer in my environment

can someone please review and commit my patch
Comment 6 Markus Angst 2006-08-30 16:49:05 UTC
I have the exact same problem (Windows XP Java 1.5.0_06 or 1.5.0_08) and
Michael's patch works for me. Thanks!
Comment 7 J 2006-09-22 13:19:41 UTC
is this still an issue?
i have no clue about the build system and running on windows/tomcat - maybe
someone else can look into it?
in any case, this does not look like a lenya bug to me.
Comment 8 Andreas Hartmann 2006-09-24 18:36:56 UTC
I committed the patch, thanks a lot!
I doubt this is a Lenya bug as well, but nevertheless we need the workaround.
Comment 9 Jonathan Addison 2007-02-08 14:20:44 UTC
The build has been failing for me on Java 1.4/WinXP ever since this patch was
committed several months ago, and I just noticed it again after doing a fresh
checkout.

If I revert this patch then Lenya builds with no problems.

More info here:
http://marc.theaimsgroup.com/?l=lenya-dev&m=115929860901491&w=2
Comment 10 Andreas Hartmann 2007-04-23 00:53:52 UTC
What should we do here? Any hints?
Comment 11 Markus Angst 2007-04-23 13:24:47 UTC
Back in August 2006 I debugged this and came to the same conclusion as Michael
Wohlfahrt in comment #4. The patch has fixed this for me under Windows XP and
Java 1.5 / 1.6 (but according to comment #9 it seems to be broken for other
people now...).
Comment 12 J 2007-04-24 03:59:54 UTC
if i interpret that workaround correctly, it is a bug in the default
transformer,        not in lenya. still, a workaround would make sense, but it
should not be a blocker bug.
can the people who were seeing problems please confirm:
* you have been building for tomcat like the original poster
* you were having the same issues, and the patch fixes it for you, or
* you were not having issues, and the patch broke things (jonathan, you seem to
be the only one for whom the patch does not work, 2 people report success. tell
your problem to be a good democrat and go away!)

Comment 13 Markus Angst 2007-04-24 07:13:36 UTC
> can the people who were seeing problems please confirm:
>
> * you have been building for tomcat like the original poster

No, sorry, I have been building for Jetty. Doesn't seem to make a difference.

> * you were having the same issues, and the patch fixes it for you

Yes.  (see comments #6 and #11)
Comment 14 Jonathan Addison 2007-04-24 07:34:35 UTC
Actually I am not the only one who experienced problems, as you can see by
reading the link I posted in comment #9.

I just tried again with a fresh checkout and received the same error as before:

prepare-modules:
Processing C:\src\lenya-1.4.x\build\lenya\temp\modules.xml to
C:\src\lenya-1.4.x\build\lenya\temp\modules-build.xml
Loading stylesheet C:\src\lenya-1.4.x\src\resources\build\modules2build.xsl
: Error! null
: Fatal Error! Could not compile stylesheet
Failed to process C:\src\lenya-1.4.x\build\lenya\temp\modules.xml

BUILD FAILED
C:\src\lenya-1.4.x\src\targets\webapp-build.xml:168: The following error
occurred while executing this line:
C:\src\lenya-1.4.x\src\targets\modules-build.xml:42: Fatal error during
transformation


Commenting out this line in modules-build.xml fixes the problem:
<!--<factory name="org.apache.xalan.xsltc.trax.TransformerFactoryImpl" />-->

I am using Java 1.4/WinXP.

I have tried with both Tomcat and Jetty, but it does not matter since the error
occurs during the build process.
Comment 15 Josias Thoeny 2007-04-24 19:50:53 UTC
Created attachment 20033 [details]
patch for module build process

I can confirm the problem that Jonathan reported (java 1.4 on WinXP).

The proposed patch is a workaround, it changes the build process for modules in
a way that the xsl document() function is never used more than once for each
module. 
It adds an intermediate step to the build process which aggregates all module
config files into the file build/lenya/temp/modules-config.xml, and then feeds
this file to modules2build.xsl.

I tested this with java1.4/WinXP, java5/WinXP, java1.4/Linux and it seemed to
work.
Comment 16 Andreas Hartmann 2007-04-25 02:26:17 UTC
I'd consider this a blocker, and we should definitely apply the patch before
releasing RC1.
Comment 17 J 2007-04-26 07:32:06 UTC
*** Bug 40017 has been marked as a duplicate of this bug. ***
Comment 18 J 2007-07-12 06:41:23 UTC
ok, we're trying to debug this one. iiuc:

* originally, we did not have a <factory/> entry that explicitly declares a
transformer.
* the build failed for people on windows with java 1.5+
* the <factory/> was added.
* now the build fails for people using java 1.4.x
* building on linux/jkd1.5 works both with and without the factory.

josias has identified a likely bug in the document() function of the xslt
processor (which surfaces only under windows), that will return an empty node
set if document() is called twice on the same document within an xslt.

his patch introduces an intermediate processing stage that works around the issue.

i have committed the patch now for easier testing. please report.

this is not a lenya bug, and it should not block an RC, hence i'm downgrading it. 
Comment 19 J 2007-07-12 07:12:54 UTC
jürgen ragaller reports success with josias' patch on winxp running java1.6.
martin ginter just compiled it successfully on winxp with jdk 1.4.2-2.

Comment 20 Jonathan Addison 2007-07-12 08:26:16 UTC
This patch works for me as well on WinXP/Java 1.4.2_08.

Thanks Josias!
Comment 21 J 2007-07-12 09:09:13 UTC
martin has also tried with java 1.5 on his winxp box, and it also works. i'm
closing this one, please reopen if you run into problems. thanks josias for the
workaround!

Comment 22 Thorsten Scherler 2007-07-16 01:58:31 UTC
Renaming Lenya 1.4 to 2.0