cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark McGettrick" <...@chromavoid.com>
Subject Re: new spin on old xsp error?
Date Tue, 08 May 2001 02:20:03 GMT
> > ok, i've read many old posts dealing with the following error:
> >
> > java.lang.Exception: XSP Java Compiler: Compilation failed for
_profile.java
> > 43: ')' expected.
> >     xspParentNode = xspCurrentNode;
> >
> > i have Cocoon 1.8.2 installed on redhat-7.0
> > is there an easy fix for this?
>
> yeah, fix your xsp, it's probably not valid. you might want to post (a
> subset of) it.

you mean my file? it's valid and works fine if i cut the java out and run it
as part of a java app... it seams like this specific problem was very common
with an older version of cocoon so i felt like it was natural to figure that
there might still be a similar problem...

however there very well could be a problem with my code. any help would be
greatly appreciated. the error is:

java.lang.Exception: XSP Java Compiler: Compilation failed for _profile.java
43: ')' expected.
    xspParentNode = xspCurrentNode;
                                  ^
1 error


	at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJa
vaProcessor.java, Compiled Code)
	at org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java,
Compiled Code)
	at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
	at org.apache.cocoon.Cocoon.service(Cocoon.java, Compiled Code)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
	at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java,
Compiled Code)
	at org.apache.tomcat.core.Handler.service(Handler.java, Compiled Code)
	at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java,
Compiled Code)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java,
Compiled Code)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java, Compiled Code)
	at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
Compiled Code)
	at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
	at java.lang.Thread.run(Thread.java:484)


it's generated by this code:

<?xml version="1.0"?>
<xsl:stylesheet
    version = "1.0"
    xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:db="http://www.snotgoth.net/NS/db-taglib"
>
    <xsl:template match="xsp:page">
        <xsp:page>
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
            </xsl:copy>
            <xsp:structure>
                <xsp:include>java.sql.*</xsp:include>
            </xsp:structure>
            <xsp:logic>

        /* get a profile - nUid is temporarily not used. */
    private static String getProfile(Int nUid) {
        String url = OMMITTED;
        String user = OMITTED;
        String pass = OMITTED;
        String sQuery = "SELECT * FROM users WHERE id = 1";

        try {
            Class.forName("org.gjt.mm.mysql.Driver");
            Connection c = DriverManager.getConnection (url,user,pass);
            Statement s = c.createStatement();
            ResultSet rs = s.executeQuery(sQuery);
            while (rs.next()) {
                StringBuffer sbCols = new StringBuffer();
                sbCols.append(<fname>);
                sbCols.append(rs.getString(2));
                sbCols.append(</fname>);
                sbCols.append(<lname>);
                sbCols.append(rs.getString(3));
                sbCols.append(</lname>);
                sbCols.append(<email>);
                sbCols.append(rs.getString(4));
                sbCols.append(</email>);
            }
            rs.close();
            s.close();
            c.close();

            return sbCols.toString();
        }
        catch (SQLException e) {
            System.out.println("SQLException: " + e.getMessage());
            System.out.println("SQLState:     " + e.getSQLState());
            System.out.println("VendorError:  " + e.getErrorCode());
        }
        catch (ClassNotFoundException e) {

        }
    }

        </xsp:logic>
            <xsl:apply-templates/>
        </xsp:page>
    </xsl:template>
    <xsl:template match="db:getProfile">
        <xsp:expr>
            getProfile("<xsl:value-of select="@uid"/>")
        </xsp:expr>
    </xsl:template>
    <xsl:template match="@*|node()" priority="-1">
        <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
    </xsl:template>
</xsl:stylesheet>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message