cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Becker" <jonnybec...@hotmail.com>
Subject Weird logicsheet problem
Date Mon, 27 Oct 2003 15:27:11 GMT
Hi,

I'm having problems getting my logicsheet to work. It always throws errors.
I had these errors with the same code before in xsp's, but they don't occur 
anymore.
This code works fine in an xsp.


My logicsheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xsp="http://apache.org/xsp" xmlns:party="http://jonny.de/">
	<xsp:structure>
		<xsp:include>org.apache.cocoon.components.language.markup.xsp.XSPUtil</xsp:include>
		<xsp:include>org.apache.avalon.framework.context.ContextException</xsp:include>
	</xsp:structure>
	<xsl:template match="jonny:test">
		<xsp:logic>
			  File uploadDir = null;
			  public void contextualize(Context context) throws ContextException {
			    uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);
			  }
           		String[] filelist = uploadDir.list();
		</xsp:logic>
			 <xsp:expr>filelist[1]</xsp:expr>
		</xsl:template>
	<xsl:template name="get-nested-content">
		<xsl:param name="content"/>
		<xsl:choose>
			<xsl:when test="$content/*">
				<xsl:apply-templates select="$content/*"/>
			</xsl:when>
			<xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="@*|*|text()|processing-instruction()">
		<xsl:copy>
			<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>

The error:
An Error Occurred
Language Exception

org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling 
zufall_xsp: ERROR 1 (org\apache\cocoon\www\logicsheet\zufall_xsp.java): ... 
this.characters("\n\t\t"); File uploadDir = null; // start error (lines 
107-107) "Syntax error on token "(", ";" expected" public void 
contextualize(Context context) throws ContextException { // end error 
uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR); } String[] 
filelist = uploadDir.list(); ... Line 107, column 0: Syntax error on token 
"(", ";" expected

cause: org.apache.cocoon.components.language.LanguageException: Error 
compiling zufall_xsp: ERROR 1 
(org\apache\cocoon\www\logicsheet\zufall_xsp.java): ... 
this.characters("\n\t\t"); File uploadDir = null; // start error (lines 
107-107) "Syntax error on token "(", ";" expected" public void 
contextualize(Context context) throws ContextException { // end error 
uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR); } String[] 
filelist = uploadDir.list(); ... Line 107, column 0: Syntax error on token 
"(", ";" expected

full exception chain stacktrace[hide]

Original Exception: org.apache.cocoon.components.language.LanguageException: 
Error compiling jonny_xsp:
ERROR 1 (org\apache\cocoon\www\logicsheet\zufall_xsp.java):
...
        this.characters("\n\t\t");
			  File uploadDir = null;


// start error (lines 107-107) "Syntax error on token "(", ";" expected"
			  public void contextualize(Context context) throws ContextException {


// end error
			    uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);

			  }

           		String[] filelist = uploadDir.list();
...
Line 107, column 0: Syntax error on token "(", ";" expected

	at 
org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(JavaLanguage.java:236)

	at 
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:208)

	at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loadProgram(ProgramGeneratorImpl.java:427)



Regards
Jonny

_________________________________________________________________
5 neue Buddies = 50 FreeSMS. http://messenger-mania.msn.de MSN Messenger 
empfehlen und kräftig abräumen!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message