You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thorbjoern Ravn Andersen <ra...@mip.sdu.dk> on 2000/02/20 00:57:31 UTC

More newbie questions for the SQLprocessor.


I have the following snippet of XML for the SQL-processor

 <query
connection="foo_connection" tag-case="lower" row-element="tr" doc-element="table">
<!-- select id, owner, filename, size, MIME from items -->
  select id from incoming
 </query>

If I run it against a mysql 3.22.22 on localhost, I get a rendered table
back.  If I run the same XML-page remotely against a mysql 3.22.32 (with
99% certain that the login parameters are correct) I get the following in
my error log.

java.sql.SQLException: Communication link failure: Bad handshake
        at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:278)
        at org.gjt.mm.mysql.Connection.<init>(Connection.java:230)
        at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
        at java.sql.DriverManager.getConnection(DriverManager.java:76)
        at java.sql.DriverManager.getConnection(DriverManager.java:119)
        at org.apache.cocoon.processor.sql.ConnectionCreator.getConnection(ConnectionCreator.java:76)
        at org.apache.cocoon.processor.sql.ConnectionDefs.getConnection(ConnectionDefs.java:179)
        at org.apache.cocoon.processor.sql.SQLProcessor.process(SQLProcessor.java:139)
        at org.apache.cocoon.Engine.handle(Engine.java:284)
        at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
        at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
        at org.apache.jserv.JServConnection.run(JServConnection.java:188)
        at java.lang.Thread.run(Thread.java)


This is Cocoon 1.6.1 with mm.mysql.jdbc-1.2b.

And a related question.  I would like to change the
<fieldname>aksdjadsf</fieldname> tags around each field to a plain
<td>kdkdkd</td> set, and _then_ render the resulting xml document to
HTML. 

I am still new to this - what are the magic incantations?

-- 
  Thorbjørn Ravn Andersen               "...plus...Tubular Bells!"
  http://www.mip.sdu.dk/~ravn


Re: More newbie questions for the SQLprocessor.

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sun, 20 Feb 2000, Thorbjoern Ravn Andersen wrote:

> On Sat, 19 Feb 2000, christopher baus wrote:
> 
> > Do you have your GRANTS set properly?  By default mySQL allows logins to
> > occur only from the localhost.  Logins are controlled by the host and user
> > fields user table of the mysql database.  This is covered fairly extensively
> > at
> > http://www.mysql.com/Manual_chapter/manual_Privilege_system.html#Privilege_s
> > ystem
> 
> I can do it manually with "mysql -h host -u user -p base", so I thought it
> might be something else.
> 
> I do not have administrative powers over this machine, and it also works
> via Perl.
> 
> 
> In the meantime another problem has shown up with the SQLprocessor.  I
> need to postprocess the output from the SQLprocessor, with an XSLT
> mapping.  Attempts to have two calls to <cocoon-process> (basically like
> 
> <?cocoon-process type="sql"?>
> <?cocoon-process type="xslt"?>
> 
> which is only hinted in the documentatin) which gives an error document
> stating
> 
> Cocoon 1.6.1
>                                       Error found handling the request.
> 
>      Warning: can't output text before document element!  Ignoring...
>              at org.apache.xalan.xslt.XSLTEngineImpl.error(Compiled Code)
>              at org.apache.xalan.xslt.XSLTEngineImpl.error(Compiled Code)
>              at org.apache.xalan.xslt.XSLTEngineImpl.process(Compiled
> 
> I have moved the declarations around in the xml and xsl file, and it
> basically appears to me, that both needs to be there in order to have the
> engine process it twice.

Looks like you've got some bad XSLT you're working with. Does tidy report
that it's really well-formed XML? What happens when you run Xalan by hand
on the generated XML file and the XSLT stylesheet? Do you, in fact, have
an <?xml-stylesheet?> PI in the XML file?

> Is there anyone who have a working sample of a SQLrequest which then gets
> XSLT-processed "as usual"?

Many, yes.

- donald


Re: More newbie questions for the SQLprocessor.

Posted by Thorbjoern Ravn Andersen <ra...@mip.sdu.dk>.
On Sat, 19 Feb 2000, christopher baus wrote:

> Do you have your GRANTS set properly?  By default mySQL allows logins to
> occur only from the localhost.  Logins are controlled by the host and user
> fields user table of the mysql database.  This is covered fairly extensively
> at
> http://www.mysql.com/Manual_chapter/manual_Privilege_system.html#Privilege_s
> ystem

I can do it manually with "mysql -h host -u user -p base", so I thought it
might be something else.

I do not have administrative powers over this machine, and it also works
via Perl.


In the meantime another problem has shown up with the SQLprocessor.  I
need to postprocess the output from the SQLprocessor, with an XSLT
mapping.  Attempts to have two calls to <cocoon-process> (basically like

<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>

which is only hinted in the documentatin) which gives an error document
stating

Cocoon 1.6.1
                                      Error found handling the request.

     Warning: can't output text before document element!  Ignoring...
             at org.apache.xalan.xslt.XSLTEngineImpl.error(Compiled Code)
             at org.apache.xalan.xslt.XSLTEngineImpl.error(Compiled Code)
             at org.apache.xalan.xslt.XSLTEngineImpl.process(Compiled

I have moved the declarations around in the xml and xsl file, and it
basically appears to me, that both needs to be there in order to have the
engine process it twice.

Is there anyone who have a working sample of a SQLrequest which then gets
XSLT-processed "as usual"?

-- 
  Thorbjørn Ravn Andersen               "...plus...Tubular Bells!"
  http://www.mip.sdu.dk/~ravn


Re: More newbie questions for the SQLprocessor.

Posted by christopher baus <ch...@baus.net>.
Do you have your GRANTS set properly?  By default mySQL allows logins to
occur only from the localhost.  Logins are controlled by the host and user
fields user table of the mysql database.  This is covered fairly extensively
at
http://www.mysql.com/Manual_chapter/manual_Privilege_system.html#Privilege_s
ystem

Also make sure you "FLUSH PRIVILEGES;" after changing grants.


----- Original Message -----
From: Thorbjoern Ravn Andersen <ra...@mip.sdu.dk>
To: <co...@xml.apache.org>
Sent: Saturday, February 19, 2000 3:57 PM
Subject: More newbie questions for the SQLprocessor.




I have the following snippet of XML for the SQL-processor

 <query
connection="foo_connection" tag-case="lower" row-element="tr"
doc-element="table">
<!-- select id, owner, filename, size, MIME from items -->
  select id from incoming
 </query>

If I run it against a mysql 3.22.22 on localhost, I get a rendered table
back.  If I run the same XML-page remotely against a mysql 3.22.32 (with
99% certain that the login parameters are correct) I get the following in
my error log.

java.sql.SQLException: Communication link failure: Bad handshake
        at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:278)
        at org.gjt.mm.mysql.Connection.<init>(Connection.java:230)
        at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
        at java.sql.DriverManager.getConnection(DriverManager.java:76)
        at java.sql.DriverManager.getConnection(DriverManager.java:119)
        at
org.apache.cocoon.processor.sql.ConnectionCreator.getConnection(ConnectionCr
eator.java:76)
        at
org.apache.cocoon.processor.sql.ConnectionDefs.getConnection(ConnectionDefs.
java:179)
        at
org.apache.cocoon.processor.sql.SQLProcessor.process(SQLProcessor.java:139)
        at org.apache.cocoon.Engine.handle(Engine.java:284)
        at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
        at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
        at org.apache.jserv.JServConnection.run(JServConnection.java:188)
        at java.lang.Thread.run(Thread.java)


This is Cocoon 1.6.1 with mm.mysql.jdbc-1.2b.

And a related question.  I would like to change the
<fieldname>aksdjadsf</fieldname> tags around each field to a plain
<td>kdkdkd</td> set, and _then_ render the resulting xml document to
HTML.

I am still new to this - what are the magic incantations?

--
  Thorbjørn Ravn Andersen               "...plus...Tubular Bells!"
  http://www.mip.sdu.dk/~ravn


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



Re: More newbie questions for the SQLprocessor.

Posted by Donald Ball <ba...@webslingerZ.com>.
That's almost certainly a JDBC issue, not something specific to
SQLProcessor. Try using JDBC by 'hand' and see if you can make it work.
Perhaps you're using an old version of the JDBC driver?

- donald

On Sun, 20 Feb 2000, Thorbjoern Ravn Andersen wrote:

> 
> 
> I have the following snippet of XML for the SQL-processor
> 
>  <query
> connection="foo_connection" tag-case="lower" row-element="tr" doc-element="table">
> <!-- select id, owner, filename, size, MIME from items -->
>   select id from incoming
>  </query>
> 
> If I run it against a mysql 3.22.22 on localhost, I get a rendered table
> back.  If I run the same XML-page remotely against a mysql 3.22.32 (with
> 99% certain that the login parameters are correct) I get the following in
> my error log.
> 
> java.sql.SQLException: Communication link failure: Bad handshake
>         at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:278)
>         at org.gjt.mm.mysql.Connection.<init>(Connection.java:230)
>         at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
>         at java.sql.DriverManager.getConnection(DriverManager.java:76)
>         at java.sql.DriverManager.getConnection(DriverManager.java:119)
>         at org.apache.cocoon.processor.sql.ConnectionCreator.getConnection(ConnectionCreator.java:76)
>         at org.apache.cocoon.processor.sql.ConnectionDefs.getConnection(ConnectionDefs.java:179)
>         at org.apache.cocoon.processor.sql.SQLProcessor.process(SQLProcessor.java:139)
>         at org.apache.cocoon.Engine.handle(Engine.java:284)
>         at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
>         at org.apache.jserv.JServConnection.run(JServConnection.java:188)
>         at java.lang.Thread.run(Thread.java)
> 
> 
> This is Cocoon 1.6.1 with mm.mysql.jdbc-1.2b.
> 
> And a related question.  I would like to change the
> <fieldname>aksdjadsf</fieldname> tags around each field to a plain
> <td>kdkdkd</td> set, and _then_ render the resulting xml document to
> HTML. 
> 
> I am still new to this - what are the magic incantations?
> 
> -- 
>   Thorbj�rn Ravn Andersen               "...plus...Tubular Bells!"
>   http://www.mip.sdu.dk/~ravn
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>