You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Geelen <st...@hotmail.com> on 2004/02/14 07:49:37 UTC
HELP PLEASE: Language Exception when compiling XSP page
HI,
looking at the myaccount_details_xsp.java source it seems that the error is
caused by:
this.contentHandler.startElement ? :
start error (lines 131-131) "Syntax
> > error on keyword "this"; "boolean", "void", "byte", "short", "int",
> > "long", "char", "float", "double", "Identifier", "interface", "class"
> > expected" this.contentHandler.startElement( // end error ??
I included below the complete .java file.
Does anyone have any idea (using 2.1.3) ?
Thx very much in advance !
package org.apache.cocoon.www.xmlmill.xsp;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
//import java.net.*;
import java.util.Date;
import java.util.List;
import java.util.Stack;
//import org.w3c.dom.*;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
//import org.apache.avalon.framework.*;
import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.ComponentSelector;
import org.apache.avalon.framework.context.Context;
//import org.apache.avalon.framework.util.*;
import org.apache.cocoon.Constants;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.generation.Generator;
//import org.apache.cocoon.util.*;
import org.apache.cocoon.components.language.markup.xsp.XSPGenerator;
import org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper;
import
org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper;
import
org.apache.cocoon.components.language.markup.xsp.XSPResponseHelper;
import
org.apache.cocoon.components.language.markup.xsp.XSPSessionHelper;
/* User Imports */
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.PreparedStatement;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Struct;
import java.sql.SQLException;
import java.sql.Clob;
import java.sql.Blob;
import java.text.SimpleDateFormat;
import java.text.DecimalFormat;
import java.io.StringWriter;
import java.io.PrintWriter;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.ListIterator;
import java.math.BigDecimal;
import java.sql.Struct;
import java.sql.Types;
import org.apache.cocoon.components.language.markup.xsp.EsqlHelper;
import
org.apache.cocoon.components.language.markup.xsp.AbstractEsqlQuery;
import
org.apache.cocoon.components.language.markup.xsp.AbstractEsqlConnection;
import
org.apache.cocoon.components.language.markup.xsp.Cocoon2EsqlConnection;
import org.apache.cocoon.components.language.markup.xsp.XSPUtil;
/**
* Generated by XSP. Edit at your own risk, :-)
*/
public class myaccount_details_xsp extends XSPGenerator {
// Files this XSP depends on
private static File[] _dependentFiles = new File[] {
};
// Initialize attributes used by modifiedSince() (see
AbstractServerPage)
{
this.dateCreated = 1076739690085L;
this.dependencies = _dependentFiles;
}
/* Built-in parameters available for use */
// context - org.apache.cocoon.environment.Context
// request - org.apache.cocoon.environment.Request
// response - org.apache.cocoon.environment.Response
// parameters - parameters defined in the sitemap
// objectModel- java.util.Map
// resolver - org.apache.cocoon.environment.SourceResolver
/* User Class Declarations */
private Stack _esql_connections = new Stack();
private Cocoon2EsqlConnection _esql_connection = null;
private Stack _esql_queries = new Stack();
private AbstractEsqlQuery _esql_query = null;
private SQLException _esql_exception = null;
private StringWriter _esql_exception_writer = null;
this.contentHandler.startElement(
"",
"sql-list",
"sql-list",
xspAttr
);
xspAttr.clear();
xspAttr.addAttribute(
"",
"pos",
"pos",
"CDATA",
String.valueOf(j.nextIndex())
);
this.contentHandler.startElement(
"",
"sql-list-item",
"sql-list-item",
xspAttr
);
xspAttr.clear();
this.contentHandler.endElement(
"",
"sql-list-item",
"sql-list-item");
this.contentHandler.endElement(
"",
"sql-list",
"sql-list");
this.contentHandler.startElement(
"",
"sql-set",
"sql-set",
xspAttr
);
xspAttr.clear();
this.contentHandler.startElement(
"",
"sql-set-item",
"sql-set-item",
xspAttr
);
xspAttr.clear();
this.contentHandler.endElement(
"",
"sql-set-item",
"sql-set-item");
this.contentHandler.endElement(
"",
"sql-set",
"sql-set");
XSPObjectHelper.xspExpr(contentHandler, obj);
/**
* Generate XML data.
*/
public void generate() throws SAXException, IOException,
ProcessingException {
this.contentHandler.startDocument();
AttributesImpl xspAttr = new AttributesImpl();
this.contentHandler.startPrefixMapping(
"xml",
"http://www.w3.org/XML/1998/namespace"
);
this.contentHandler.startPrefixMapping(
"xsp",
"http://apache.org/xsp"
);
this.contentHandler.startPrefixMapping(
"xspdoc",
"http://apache.org/cocoon/XSPDoc/v1"
);
this.contentHandler.startPrefixMapping(
"esql",
"http://apache.org/cocoon/SQL/v2"
);
this.contentHandler.startElement(
"",
"page",
"page",
xspAttr
);
xspAttr.clear();
this.characters("\n ");
this.contentHandler.startElement(
"",
"p",
"p",
xspAttr
);
xspAttr.clear();
this.characters("");
this.contentHandler.endElement(
"",
"p",
"p"
);
this.characters("");
this.characters("");
this.contentHandler.endElement(
"",
"page",
"page"
);
this.contentHandler.endPrefixMapping(
"xml"
);
this.contentHandler.endPrefixMapping(
"xsp"
);
this.contentHandler.endPrefixMapping(
"xspdoc"
);
this.contentHandler.endPrefixMapping(
"esql"
);
this.contentHandler.endDocument();
}
}
this.contentHandler.startElement
----- Original Message -----
From: "John L. Webber" <Jo...@jentro.com>
To: <us...@cocoon.apache.org>
Sent: Friday, February 13, 2004 8:56 AM
Subject: Re: Language Exception when compiling XSP page
> Hi Stefan,
>
> Perhaps someone else has a more specific idea what the problem is, but
> as a general Cocoon debugging technique have you looked at the generated
> Java file (myaccount_details_xsp.java)? That's usually a good place to
> start solving such error messages. The generated java files should be
> under the work directory of your Tomcat installation (probably a path
> like
>
work\Standalone\localhost\yourwebappname\cocoon-files\org\apache\cocoon\www\
xmlmill\xsp\).
>
> I haven't used esql, so I don't know if that could be causing the problem.
>
> John
>
> Stefan Geelen wrote:
>
> > Hi,
> >
> > I have following XSP page:
> > -------------------------------------
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
> > xmlns:esql="http://apache.org/cocoon/SQL/v2" >
> > <page>
> > <p>TEST</p>
> > </page>
> > </xsp:page>
> >
> > When called it generates folllowing error:
> > ----------------------------------------------------------
> > Failed to execute pipeline.
> >
> > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> > org.apache.cocoon.ProcessingException: Language Exception:
> > org.apache.cocoon.components.language.LanguageException: Error
> > compiling myaccount_details_xsp: ERROR 1
> > (org\apache\cocoon\www\xmlmill\xsp\myaccount_details_xsp.java): ...
> > private SQLException _esql_exception = null; private StringWriter
> > _esql_exception_writer = null; // start error (lines 131-131) "Syntax
> > error on keyword "this"; "boolean", "void", "byte", "short", "int",
> > "long", "char", "float", "double", "Identifier", "interface", "class"
> > expected" this.contentHandler.startElement( // end error "",
> > "sql-list", "sql-list", xspAttr ... Line 131, column 0: Syntax error
> > on keyword "this"; "boolean", "void", "byte", "short", "int", "long",
> > "char", "float", "double", "Identifier", "interface", "class" expected
> >
> > If I remove the xmlns:esql="http://apache.org/cocoon/SQL/v2" it does
> > work. So the problem has apparently to do with the esql logisheet ?
> >
>
> --
> ---------------------------------------------------------
> Jentro Technologies GmbH
> John L. Webber, Software Development
> ---------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: SOLVED: Language Exception when compiling XSP page
Posted by Stefan Geelen <st...@hotmail.com>.
Hi All,
just to let you know I solved the problem:
Appareantly it is quite important to use the xalan and xerces version
delivered with cocoon 2.1.3
I first used xalan: 2.4.D1 and xerces: 2.0.0 and appareantly this was
causing the error.
Replacing these with the xercesImpl-2.5.0.jar and xalan-2.5.2.jar did make
the error go away.
Note also that I needed to place these files in to the cocoon\WEB-INF\lib
dir .
Regards,
Stefan
----- Original Message -----
From: "Stefan Geelen" <st...@hotmail.com>
To: <us...@cocoon.apache.org>
Cc: <ri...@apache.org>
Sent: Saturday, February 14, 2004 7:49 AM
Subject: HELP PLEASE: Language Exception when compiling XSP page
> HI,
>
> looking at the myaccount_details_xsp.java source it seems that the error
is
> caused by:
>
> this.contentHandler.startElement ? :
>
> start error (lines 131-131) "Syntax
> > > error on keyword "this"; "boolean", "void", "byte", "short", "int",
> > > "long", "char", "float", "double", "Identifier", "interface", "class"
> > > expected" this.contentHandler.startElement( // end error ??
>
>
> I included below the complete .java file.
>
> Does anyone have any idea (using 2.1.3) ?
>
> Thx very much in advance !
>
> package org.apache.cocoon.www.xmlmill.xsp;
>
> import java.io.File;
> import java.io.IOException;
> import java.io.StringReader;
> //import java.net.*;
> import java.util.Date;
> import java.util.List;
> import java.util.Stack;
>
> //import org.w3c.dom.*;
> import org.xml.sax.InputSource;
> import org.xml.sax.SAXException;
> import org.xml.sax.helpers.AttributesImpl;
>
> //import org.apache.avalon.framework.*;
> import org.apache.avalon.framework.component.Component;
> import org.apache.avalon.framework.component.ComponentException;
> import org.apache.avalon.framework.component.ComponentManager;
> import org.apache.avalon.framework.component.ComponentSelector;
> import org.apache.avalon.framework.context.Context;
> //import org.apache.avalon.framework.util.*;
>
> import org.apache.cocoon.Constants;
> import org.apache.cocoon.ProcessingException;
> import org.apache.cocoon.generation.Generator;
> //import org.apache.cocoon.util.*;
>
> import org.apache.cocoon.components.language.markup.xsp.XSPGenerator;
> import
org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper;
> import
> org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper;
> import
> org.apache.cocoon.components.language.markup.xsp.XSPResponseHelper;
> import
> org.apache.cocoon.components.language.markup.xsp.XSPSessionHelper;
>
> /* User Imports */
>
> import java.sql.DriverManager;
>
> import java.sql.Connection;
>
> import java.sql.Statement;
>
> import java.sql.PreparedStatement;
>
> import java.sql.CallableStatement;
>
> import java.sql.ResultSet;
>
> import java.sql.ResultSetMetaData;
>
> import java.sql.Struct;
>
> import java.sql.SQLException;
>
> import java.sql.Clob;
>
> import java.sql.Blob;
>
> import java.text.SimpleDateFormat;
>
> import java.text.DecimalFormat;
>
> import java.io.StringWriter;
>
> import java.io.PrintWriter;
>
> import java.io.BufferedInputStream;
>
> import java.io.InputStream;
>
> import java.util.Set;
>
> import java.util.List;
>
> import java.util.Iterator;
>
> import java.util.ListIterator;
>
> import java.math.BigDecimal;
>
> import java.sql.Struct;
>
> import java.sql.Types;
>
> import org.apache.cocoon.components.language.markup.xsp.EsqlHelper;
>
> import
> org.apache.cocoon.components.language.markup.xsp.AbstractEsqlQuery;
>
> import
> org.apache.cocoon.components.language.markup.xsp.AbstractEsqlConnection;
>
> import
> org.apache.cocoon.components.language.markup.xsp.Cocoon2EsqlConnection;
>
> import org.apache.cocoon.components.language.markup.xsp.XSPUtil;
>
>
> /**
> * Generated by XSP. Edit at your own risk, :-)
> */
> public class myaccount_details_xsp extends XSPGenerator {
>
> // Files this XSP depends on
> private static File[] _dependentFiles = new File[] {
>
> };
>
> // Initialize attributes used by modifiedSince() (see
> AbstractServerPage)
> {
> this.dateCreated = 1076739690085L;
> this.dependencies = _dependentFiles;
> }
>
> /* Built-in parameters available for use */
> // context - org.apache.cocoon.environment.Context
> // request - org.apache.cocoon.environment.Request
> // response - org.apache.cocoon.environment.Response
> // parameters - parameters defined in the sitemap
> // objectModel- java.util.Map
> // resolver - org.apache.cocoon.environment.SourceResolver
>
> /* User Class Declarations */
> private Stack _esql_connections = new Stack();
> private Cocoon2EsqlConnection _esql_connection = null;
> private Stack _esql_queries = new Stack();
> private AbstractEsqlQuery _esql_query = null;
> private SQLException _esql_exception = null;
> private StringWriter _esql_exception_writer = null;
>
>
> this.contentHandler.startElement(
> "",
> "sql-list",
> "sql-list",
> xspAttr
> );
>
> xspAttr.clear();
>
>
>
> xspAttr.addAttribute(
> "",
> "pos",
> "pos",
> "CDATA",
> String.valueOf(j.nextIndex())
> );
>
>
> this.contentHandler.startElement(
> "",
> "sql-list-item",
> "sql-list-item",
> xspAttr
> );
>
> xspAttr.clear();
>
>
>
> this.contentHandler.endElement(
> "",
> "sql-list-item",
> "sql-list-item");
>
>
>
>
> this.contentHandler.endElement(
> "",
> "sql-list",
> "sql-list");
>
>
>
>
> this.contentHandler.startElement(
> "",
> "sql-set",
> "sql-set",
> xspAttr
> );
>
> xspAttr.clear();
>
>
>
> this.contentHandler.startElement(
> "",
> "sql-set-item",
> "sql-set-item",
> xspAttr
> );
>
> xspAttr.clear();
>
>
>
> this.contentHandler.endElement(
> "",
> "sql-set-item",
> "sql-set-item");
>
>
>
>
> this.contentHandler.endElement(
> "",
> "sql-set",
> "sql-set");
>
>
>
>
> XSPObjectHelper.xspExpr(contentHandler, obj);
>
>
> /**
> * Generate XML data.
> */
> public void generate() throws SAXException, IOException,
> ProcessingException {
>
>
>
> this.contentHandler.startDocument();
> AttributesImpl xspAttr = new AttributesImpl();
>
>
>
> this.contentHandler.startPrefixMapping(
> "xml",
> "http://www.w3.org/XML/1998/namespace"
> );
>
> this.contentHandler.startPrefixMapping(
> "xsp",
> "http://apache.org/xsp"
> );
>
> this.contentHandler.startPrefixMapping(
> "xspdoc",
> "http://apache.org/cocoon/XSPDoc/v1"
> );
>
> this.contentHandler.startPrefixMapping(
> "esql",
> "http://apache.org/cocoon/SQL/v2"
> );
>
>
> this.contentHandler.startElement(
> "",
> "page",
> "page",
> xspAttr
> );
> xspAttr.clear();
>
>
> this.characters("\n ");
>
>
> this.contentHandler.startElement(
> "",
> "p",
> "p",
> xspAttr
> );
> xspAttr.clear();
>
>
> this.characters("");
>
>
> this.contentHandler.endElement(
> "",
> "p",
> "p"
> );
>
>
> this.characters("");
>
> this.characters("");
>
>
> this.contentHandler.endElement(
> "",
> "page",
> "page"
> );
>
>
> this.contentHandler.endPrefixMapping(
> "xml"
> );
>
> this.contentHandler.endPrefixMapping(
> "xsp"
> );
>
> this.contentHandler.endPrefixMapping(
> "xspdoc"
> );
>
> this.contentHandler.endPrefixMapping(
> "esql"
> );
>
>
> this.contentHandler.endDocument();
>
>
>
> }
> }
>
>
> this.contentHandler.startElement
> ----- Original Message -----
> From: "John L. Webber" <Jo...@jentro.com>
> To: <us...@cocoon.apache.org>
> Sent: Friday, February 13, 2004 8:56 AM
> Subject: Re: Language Exception when compiling XSP page
>
>
> > Hi Stefan,
> >
> > Perhaps someone else has a more specific idea what the problem is, but
> > as a general Cocoon debugging technique have you looked at the generated
> > Java file (myaccount_details_xsp.java)? That's usually a good place to
> > start solving such error messages. The generated java files should be
> > under the work directory of your Tomcat installation (probably a path
> > like
> >
>
work\Standalone\localhost\yourwebappname\cocoon-files\org\apache\cocoon\www\
> xmlmill\xsp\).
> >
> > I haven't used esql, so I don't know if that could be causing the
problem.
> >
> > John
> >
> > Stefan Geelen wrote:
> >
> > > Hi,
> > >
> > > I have following XSP page:
> > > -------------------------------------
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > > <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
> > > xmlns:esql="http://apache.org/cocoon/SQL/v2" >
> > > <page>
> > > <p>TEST</p>
> > > </page>
> > > </xsp:page>
> > >
> > > When called it generates folllowing error:
> > > ----------------------------------------------------------
> > > Failed to execute pipeline.
> > >
> > > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> > > org.apache.cocoon.ProcessingException: Language Exception:
> > > org.apache.cocoon.components.language.LanguageException: Error
> > > compiling myaccount_details_xsp: ERROR 1
> > > (org\apache\cocoon\www\xmlmill\xsp\myaccount_details_xsp.java): ...
> > > private SQLException _esql_exception = null; private StringWriter
> > > _esql_exception_writer = null; // start error (lines 131-131) "Syntax
> > > error on keyword "this"; "boolean", "void", "byte", "short", "int",
> > > "long", "char", "float", "double", "Identifier", "interface", "class"
> > > expected" this.contentHandler.startElement( // end error "",
> > > "sql-list", "sql-list", xspAttr ... Line 131, column 0: Syntax error
> > > on keyword "this"; "boolean", "void", "byte", "short", "int", "long",
> > > "char", "float", "double", "Identifier", "interface", "class" expected
> > >
> > > If I remove the xmlns:esql="http://apache.org/cocoon/SQL/v2" it does
> > > work. So the problem has apparently to do with the esql logisheet ?
> > >
> >
> > --
> > ---------------------------------------------------------
> > Jentro Technologies GmbH
> > John L. Webber, Software Development
> > ---------------------------------------------------------
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org