You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de> on 2002/07/01 15:43:40 UTC

Re: Problems with Database Tutorial

On 28.Jun.2002 -- 09:19 AM, Bobby Mitchell wrote:
> I'm using Cocoon 2.1-dev, IBM JDK 1.3, running on RedHat 7.2, and using 
> Sybase 11.9.2.
> 
> I can't add or update users in the DB. I can only delete them. I tried 
> this with both Sybase and Hsqldb and the results are the same.

AFAIK there's a pending bug that the treeprocssor (which interpretes
the sitemap for 2.1-dev per default) does not allow to nest actions in
an action-set. Hence using db-add inside form-val does not work with
that release and the tutorial is broken.

With 2.0.2 and 2.0.3 (not released, yet, available from CVS, branch
cocoon_2_0_3_branch) it should work.

> While using Sybase I had to remove the <esql:parameter> begin and end 
> tags in order to actually edit the entry, otherwise I get an sql error 
> stating that "SELECT name, department_id FROM employee WHERE id = ? " is 
> an error. The id is being passed as a ? so it causes an error. When 
> using Hsqldb I made no changes to the code.

This is standard JDBC syntax for a prepared statement that takes
parameters. Maybe the original error message provides more information?

> Has anyone ever seen this before? Where do I look in the log files for 
> debug info, such as tracking what is taking place behind the scenes? Are 
> there debug parameters that I can pass to Cocoon and receive more debug 
> info.

That is spread among several files. Most interesting are probably
core.log and sitemap.log. This can be configured in logkit.xconf.

> My wish list:
>    A debug feature that outlines each move Cocoon makes, so I can trace 
> what my code is producing and more importantly where it fails.

The java code produced from an XSP is located
$TOMCAT/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/path/relative/to/context/name_xsp.java 

It often helps a lot to have a look at it.

	Chris.

Please follow up summarizing your problem and which suggested solution /
information worked for you. Add "SUMMARY: " to the subject line. This
will make FAQ generation and searching the list easier. In addition,
it makes helping you more fun. Thank you.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


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

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


Re: Réf. : Language Exception

Posted by Dan Jones <dj...@hotmail.com>.
Thanks Othman

but I am actually using the default cocoon sitemap. I haven't changed
anything at all in the configuration or setup as yet. Merely trying to
get the initial Cocoon welcome page up.

I guess maybe Cocoon is still a little buggy when it comes to JDK1.4, as
1.3 seems to work fine. Might go back to an earlier JDK.

Cheers

Dan

Othman Haddad wrote:

> hi,that means that you've something wrong in your sitemap.xmap...try
  to use the default sitemap of cocoon2 before using your own
  one..hope it helps
  -------Message original-------

  De : cocoon-users@xml.apache.org
  Date : mercredi 10 juillet 2002 03:27:09
  A : cocoon-users@xml.apache.org
  Sujet : Language Exception
   Hi

  I'm a total newbie with cocoon and am getting this error when I try
  to access
  http://localhost/cocoon (I've set up Tomcat so I don't need to use
  the :8080),
  using cocoon 2 and Tomcat 4.03 with JDK1.4, under Windows 2000
  professional.

  I've installed it on another machine using the same OS, servlet
  engine and cocoon
  version, but with JDK1.3.0 and I'm presented with the cocoon
  homepage when I
  enter the previous URL.

  Here is the error message I'm receiving. Is there a quick fix for
  this? Didn't
  seem to be any mention of it in the FAQ.

  Many thanks

  Dan

  type fatal

  message Language Exception

  description org.apache.cocoon.ProcessingException:

  Language Exception:
  org.apache.cocoon.components.language.LanguageException:
  Error compiling sitemap_xmap:
  Line 0, column 0: could not parse error message:
  error: Invalid class file format in
  G:\JDK1.4\jre\lib\rt.jar(java/io/OutputStream.class).
  The major.minor version '48.0' is too recent for this tool to
  understand.



  ---------------------------------------------------------------------

  Please check that your question has not already been answered in the

  FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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


  .
> ________________________________________________________________
>     IncrediMail - La messagerie électronique a enfin évolué - Cliquer
> ici



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

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


Réf. : Language Exception

Posted by Othman Haddad <oh...@neomalogic.com>.
hi,
that means that you've something wrong in your sitemap.xmap...
try to use the default sitemap of cocoon2 before using your own one..
hope it helps

-------Message original-------

De : cocoon-users@xml.apache.org
Date : mercredi 10 juillet 2002 03:27:09
A : cocoon-users@xml.apache.org
Sujet : Language Exception

Hi

I'm a total newbie with cocoon and am getting this error when I try to
access
http://localhost/cocoon (I've set up Tomcat so I don't need to use the
:8080),
using cocoon 2 and Tomcat 4.03 with JDK1.4, under Windows 2000 professional.

I've installed it on another machine using the same OS, servlet engine and
cocoon
version, but with JDK1.3.0 and I'm presented with the cocoon homepage when I
enter the previous URL.

Here is the error message I'm receiving. Is there a quick fix for this? Didn
t
seem to be any mention of it in the FAQ.

Many thanks

Dan

type fatal

message Language Exception

description org.apache.cocoon.ProcessingException:

Language Exception:
org.apache.cocoon.components.language.LanguageException:
Error compiling sitemap_xmap:
Line 0, column 0: could not parse error message:
error: Invalid class file format in
G:\JDK1.4\jre\lib\rt.jar(java/io/OutputStream.class).
The major.minor version '48.0' is too recent for this tool to understand.



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

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


.

Re: Language Exception

Posted by Dan Jones <dj...@hotmail.com>.
Thanks very much.

That solved the problem real quick :)

Cheers

Dan

Vadim Gritsenko wrote:

> > From: Dan Jones [mailto:dj2216@hotmail.com]
> >
> > Hi
> >
> > I'm a total newbie with cocoon and am getting this error when I try to
> access
> > http://localhost/cocoon (I've set up Tomcat so I don't need to use the
> :8080),
> > using cocoon 2 and Tomcat 4.03 with JDK1.4, under Windows 2000
> professional.
> >
> > I've installed it on another machine using the same OS, servlet engine
> and
> > cocoon
> > version, but with JDK1.3.0 and I'm presented with the cocoon homepage
> when I
> > enter the previous URL.
> >
> > Here is the error message I'm receiving. Is there a quick fix for
> this? Didn't
> > seem to be any mention of it in the FAQ.
> >
> > Many thanks
> >
> > Dan
> >
> > type fatal
> >
> > message Language Exception
> >
> > description org.apache.cocoon.ProcessingException:
> >
> > Language Exception:
> > org.apache.cocoon.components.language.LanguageException:
> > Error compiling sitemap_xmap:
> > Line 0, column 0: could not parse error message:
> > error: Invalid class file format in
> > G:\JDK1.4\jre\lib\rt.jar(java/io/OutputStream.class).
> > The major.minor version '48.0' is too recent for this tool to
> understand.
>
> Quick fix: either upgrade compiler to version 1.4, or use rt.jar from
> the JDK of the compiler.
>
> Explanation: you can't use JDK1.4 libraries (rt.jar) with older compiler
> (say, 1.3). Compiler resides in WEB-INF, and its name is javac.jar. When
> in JDK, this is lib/tools.jar file. JDK and compiler must match (unless
> you are using alternate compiler - pizza - default in latest cocoon
> releases)
>
> Vadim
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>



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

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


RE: Language Exception

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Dan Jones [mailto:dj2216@hotmail.com]
> 
> Hi
> 
> I'm a total newbie with cocoon and am getting this error when I try to
access
> http://localhost/cocoon (I've set up Tomcat so I don't need to use the
:8080),
> using cocoon 2 and Tomcat 4.03 with JDK1.4, under Windows 2000
professional.
> 
> I've installed it on another machine using the same OS, servlet engine
and
> cocoon
> version, but with JDK1.3.0 and I'm presented with the cocoon homepage
when I
> enter the previous URL.
> 
> Here is the error message I'm receiving. Is there a quick fix for
this? Didn't
> seem to be any mention of it in the FAQ.
> 
> Many thanks
> 
> Dan
> 
> type fatal
> 
> message Language Exception
> 
> description org.apache.cocoon.ProcessingException:
> 
> Language Exception:
> org.apache.cocoon.components.language.LanguageException:
> Error compiling sitemap_xmap:
> Line 0, column 0: could not parse error message:
> error: Invalid class file format in
> G:\JDK1.4\jre\lib\rt.jar(java/io/OutputStream.class).
> The major.minor version '48.0' is too recent for this tool to
understand.

Quick fix: either upgrade compiler to version 1.4, or use rt.jar from
the JDK of the compiler.

Explanation: you can't use JDK1.4 libraries (rt.jar) with older compiler
(say, 1.3). Compiler resides in WEB-INF, and its name is javac.jar. When
in JDK, this is lib/tools.jar file. JDK and compiler must match (unless
you are using alternate compiler - pizza - default in latest cocoon
releases)


Vadim


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

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


Language Exception

Posted by Dan Jones <dj...@hotmail.com>.
Hi

I'm a total newbie with cocoon and am getting this error when I try to access
http://localhost/cocoon (I've set up Tomcat so I don't need to use the :8080),
using cocoon 2 and Tomcat 4.03 with JDK1.4, under Windows 2000 professional.

I've installed it on another machine using the same OS, servlet engine and cocoon
version, but with JDK1.3.0 and I'm presented with the cocoon homepage when I
enter the previous URL.

Here is the error message I'm receiving. Is there a quick fix for this? Didn't
seem to be any mention of it in the FAQ.

Many thanks

Dan

type fatal

message Language Exception

description org.apache.cocoon.ProcessingException:

Language Exception:
org.apache.cocoon.components.language.LanguageException:
Error compiling sitemap_xmap:
Line 0, column 0: could not parse error message:
error: Invalid class file format in
G:\JDK1.4\jre\lib\rt.jar(java/io/OutputStream.class).
The major.minor version '48.0' is too recent for this tool to understand.



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

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


Re: SUMMARY: Re: Problems with Database Tutorial

Posted by Bobby Mitchell <bo...@niac.usra.edu>.
Bad patch file!!!!

Bobby Mitchell wrote:

> 
> 
> Christian Haul wrote:
> 
>> On 02.Jul.2002 -- 11:36 AM, Bobby Mitchell wrote:
>>
>>>>> While using Sybase I had to remove the <esql:parameter> begin and 
>>>>> end tags in order to actually edit the entry, otherwise I get an 
>>>>> sql error stating that "SELECT name, department_id FROM employee 
>>>>> WHERE id = ? " is an error. The id is being passed as a ? so it 
>>>>> causes an error. When using Hsqldb I made no changes to the code.
>>>>>
>>>>>
>>> This behaviour is the same as before. Here is the error message:
>>>
>>>
>>> org.apache.cocoon.ProcessingException: Exception in 
>>> ServerPagesGenerator.generate(): java.lang.RuntimeException: Error 
>>> executing statement: SELECT name, department_id FROM employee WHERE 
>>> id = ? : com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion 
>>> from datatype 'CHAR' to 'INT' is not allowed. Use the CONVERT 
>>> function to run this query.
>>>
>>
>> Yep, error message says it all. The example is attempting to use a
>> String to set an int column. It looks like HSQLDB is more forgiving in
>> this. Change it to
>>
>>             <esql:query>
>>               SELECT name, department_id FROM employee
>>               WHERE id = <esql:parameter 
>> type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
>> name="id" default="0"/>)</xsp:expr></esql:parameter>
>>             </esql:query>
>>
>> and convert the string explicitly to an integer. I've set a default of
>> "0" in case the parameter is non-existent to prevent a NPE or
>> NumberFormatException.
>> It would be great if you could go through the tutorial and look for
>> other, similar changes, that would be required to run it e.g. on
>> sybase and file a bug in bugzilla with patches.
>>
>>     Chris.
> 
> 
> 
> I applied the changes and everything works fine. I am including a patch 
> file and I will also file a report on bugzilla. Thanks for the help.
> 
> patch file for the directory cocoon/tutorial/docs:
> **************************************************************************
> diff -Naur tutorial/docs/edit-dept.xsp tutorial/docs.sybase/edit-dept.xsp
> --- tutorial/docs/edit-dept.xsp  Tue Jul  9 09:50:57 2002
> +++ tutorial/docs.sybase/edit-dept.xsp Tue Jul  9 09:47:56 2002
> @@ -24,7 +24,7 @@
>              <esql:execute-query>
>                <esql:query>
>                  SELECT name FROM department
> -                WHERE id = <esql:parameter><xsp-request:get-parameter 
> name="id"/></esql:parameter>
> +               WHERE id = <esql:parameter 
> type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
> name="id" default="0"/>)</xsp:expr></esql:parameter>
>                </esql:query>
>                <esql:results>
>                  <esql:row-results>
> diff -Naur tutorial/docs/edit-empl.xsp tutorial/docs.sybase/edit-empl.xsp
> --- tutorial/docs/edit-empl.xsp  Tue Jul  9 09:50:57 2002
> +++ tutorial/docs.sybase/edit-empl.xsp Tue Jul  9 09:54:39 2002
> @@ -23,7 +23,7 @@
>            <esql:execute-query>
>              <esql:query>
>                SELECT name, department_id FROM employee
> -              WHERE id = <esql:parameter><xsp-request:get-parameter 
> name="id"/></esql:parameter>
> +             WHERE id = <esql:parameter 
> type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
> name="id" default="0"/>)</xsp:expr></esql:parameter>
>              </esql:query>
>              <esql:results>
>                <esql:row-results>
> ***************************************************************************

Here's another:
Cut and paste the following patch into a file.
cd to the directory cocoon/tutorial and execute
patch -p0 < patchfile
***************************************************************************
diff -Naur docs/edit-dept.xsp docs.sybase/edit-dept.xsp
--- docs/edit-dept.xsp  Tue Jul  9 19:53:18 2002
+++ docs.sybase/edit-dept.xsp Tue Jul  9 19:50:37 2002
@@ -24,7 +24,7 @@
              <esql:execute-query>
                <esql:query>
                  SELECT name FROM department
-                WHERE id = <esql:parameter><xsp-request:get-parameter 
name="id"/></esql:parameter>
+               WHERE id = <esql:parameter 
type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
name="id" default="0"/>)</xsp:expr></esql:parameter>
                </esql:query>
                <esql:results>
                  <esql:row-results>
diff -Naur docs/edit-empl.xsp docs.sybase/edit-empl.xsp
--- docs/edit-empl.xsp  Tue Jul  9 19:53:18 2002
+++ docs.sybase/edit-empl.xsp Tue Jul  9 19:50:19 2002
@@ -23,7 +23,7 @@
            <esql:execute-query>
              <esql:query>
                SELECT name, department_id FROM employee
-              WHERE id = <esql:parameter><xsp-request:get-parameter 
name="id"/></esql:parameter>
+             WHERE id = <esql:parameter 
type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
name="id" default="0"/>)</xsp:expr></esql:parameter>
              </esql:query>
              <esql:results>
                <esql:row-results>
***************************************************************************







> 
> 
>>
>> Please follow up summarizing your problem and which suggested solution
>> / information worked for you when you consider your problem
>> solved. Add "SUMMARY: " to the subject line. This will make FAQ
>> generation and searching the list easier. In addition, it makes
>> helping you more fun. Thank you.
>>
>>
> 
> 


-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638



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

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


SUMMARY: Re: Problems with Database Tutorial

Posted by Bobby Mitchell <bo...@niac.usra.edu>.

Christian Haul wrote:

> On 02.Jul.2002 -- 11:36 AM, Bobby Mitchell wrote:
> 
>>>>While using Sybase I had to remove the <esql:parameter> begin and end 
>>>>tags in order to actually edit the entry, otherwise I get an sql error 
>>>>stating that "SELECT name, department_id FROM employee WHERE id = ? " is 
>>>>an error. The id is being passed as a ? so it causes an error. When 
>>>>using Hsqldb I made no changes to the code.
>>>>
>>>>
>>This behaviour is the same as before. Here is the error message:
>>
>>
>>org.apache.cocoon.ProcessingException: Exception in 
>>ServerPagesGenerator.generate(): java.lang.RuntimeException: Error 
>>executing statement: SELECT name, department_id FROM employee WHERE id = 
>>? : com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from 
>>datatype 'CHAR' to 'INT' is not allowed. Use the CONVERT function to run 
>>this query.
>>
> 
> Yep, error message says it all. The example is attempting to use a
> String to set an int column. It looks like HSQLDB is more forgiving in
> this. Change it to
> 
>             <esql:query>
>               SELECT name, department_id FROM employee
>               WHERE id = <esql:parameter type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter name="id" default="0"/>)</xsp:expr></esql:parameter>
>             </esql:query>
> 
> and convert the string explicitly to an integer. I've set a default of
> "0" in case the parameter is non-existent to prevent a NPE or
> NumberFormatException. 
> 
> It would be great if you could go through the tutorial and look for
> other, similar changes, that would be required to run it e.g. on
> sybase and file a bug in bugzilla with patches.
> 
> 	Chris.


I applied the changes and everything works fine. I am including a patch 
file and I will also file a report on bugzilla. Thanks for the help.

patch file for the directory cocoon/tutorial/docs:
**************************************************************************
diff -Naur tutorial/docs/edit-dept.xsp tutorial/docs.sybase/edit-dept.xsp
--- tutorial/docs/edit-dept.xsp  Tue Jul  9 09:50:57 2002
+++ tutorial/docs.sybase/edit-dept.xsp Tue Jul  9 09:47:56 2002
@@ -24,7 +24,7 @@
              <esql:execute-query>
                <esql:query>
                  SELECT name FROM department
-                WHERE id = <esql:parameter><xsp-request:get-parameter 
name="id"/></esql:parameter>
+               WHERE id = <esql:parameter 
type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
name="id" default="0"/>)</xsp:expr></esql:parameter>
                </esql:query>
                <esql:results>
                  <esql:row-results>
diff -Naur tutorial/docs/edit-empl.xsp tutorial/docs.sybase/edit-empl.xsp
--- tutorial/docs/edit-empl.xsp  Tue Jul  9 09:50:57 2002
+++ tutorial/docs.sybase/edit-empl.xsp Tue Jul  9 09:54:39 2002
@@ -23,7 +23,7 @@
            <esql:execute-query>
              <esql:query>
                SELECT name, department_id FROM employee
-              WHERE id = <esql:parameter><xsp-request:get-parameter 
name="id"/></esql:parameter>
+             WHERE id = <esql:parameter 
type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter 
name="id" default="0"/>)</xsp:expr></esql:parameter>
              </esql:query>
              <esql:results>
                <esql:row-results>
***************************************************************************


> 
> Please follow up summarizing your problem and which suggested solution
> / information worked for you when you consider your problem
> solved. Add "SUMMARY: " to the subject line. This will make FAQ
> generation and searching the list easier. In addition, it makes
> helping you more fun. Thank you.
> 
> 


-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638



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

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


Re: Problems with Database Tutorial

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 02.Jul.2002 -- 11:36 AM, Bobby Mitchell wrote:
> >>While using Sybase I had to remove the <esql:parameter> begin and end 
> >>tags in order to actually edit the entry, otherwise I get an sql error 
> >>stating that "SELECT name, department_id FROM employee WHERE id = ? " is 
> >>an error. The id is being passed as a ? so it causes an error. When 
> >>using Hsqldb I made no changes to the code.
> >>
> This behaviour is the same as before. Here is the error message:
> 
> 
> org.apache.cocoon.ProcessingException: Exception in 
> ServerPagesGenerator.generate(): java.lang.RuntimeException: Error 
> executing statement: SELECT name, department_id FROM employee WHERE id = 
> ? : com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from 
> datatype 'CHAR' to 'INT' is not allowed. Use the CONVERT function to run 
> this query.

Yep, error message says it all. The example is attempting to use a
String to set an int column. It looks like HSQLDB is more forgiving in
this. Change it to

            <esql:query>
              SELECT name, department_id FROM employee
              WHERE id = <esql:parameter type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter name="id" default="0"/>)</xsp:expr></esql:parameter>
            </esql:query>

and convert the string explicitly to an integer. I've set a default of
"0" in case the parameter is non-existent to prevent a NPE or
NumberFormatException. 

It would be great if you could go through the tutorial and look for
other, similar changes, that would be required to run it e.g. on
sybase and file a bug in bugzilla with patches.

	Chris.

Please follow up summarizing your problem and which suggested solution
/ information worked for you when you consider your problem
solved. Add "SUMMARY: " to the subject line. This will make FAQ
generation and searching the list easier. In addition, it makes
helping you more fun. Thank you.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


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

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


Re: Problems with Database Tutorial

Posted by Bobby Mitchell <bm...@niac.usra.edu>.
Christian Haul wrote:

>On 28.Jun.2002 -- 09:19 AM, Bobby Mitchell wrote:
>
>>I'm using Cocoon 2.1-dev, IBM JDK 1.3, running on RedHat 7.2, and using 
>>Sybase 11.9.2.
>>
Now I'm using Cocoon 2.0.3-dev, Sun J2SDK 1.4.0, Tomcat 4.0.2.

>>
>>
>>I can't add or update users in the DB. I can only delete them. I tried 
>>this with both Sybase and Hsqldb and the results are the same.
>>
>
>AFAIK there's a pending bug that the treeprocssor (which interpretes
>the sitemap for 2.1-dev per default) does not allow to nest actions in
>an action-set. Hence using db-add inside form-val does not work with
>that release and the tutorial is broken.
>
>With 2.0.2 and 2.0.3 (not released, yet, available from CVS, branch
>cocoon_2_0_3_branch) it should work.
>

I cownloaded 2.0.3 from cvs using the installation documentation. I had 
to make the following changes (unix):

   1. Enter "cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -z3
      checkout -r HEAD xml-cocoon2". This will create a directory called
      "xml-cocoon2" where the Cocoon2 source will be stored.


      to

   1. Enter "cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -z3
      checkout -r cocoon_2_0_3_branch xml-cocoon2". This will create a
      directory called "xml-cocoon2" where the Cocoon2 source will be
      stored.


All of the database functions work properly, but ...

>
>>While using Sybase I had to remove the <esql:parameter> begin and end 
>>tags in order to actually edit the entry, otherwise I get an sql error 
>>stating that "SELECT name, department_id FROM employee WHERE id = ? " is 
>>an error. The id is being passed as a ? so it causes an error. When 
>>using Hsqldb I made no changes to the code.
>>
This behaviour is the same as before. Here is the error message:


org.apache.cocoon.ProcessingException: Exception in 
ServerPagesGenerator.generate(): java.lang.RuntimeException: Error 
executing statement: SELECT name, department_id FROM employee WHERE id = 
? : com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from 
datatype 'CHAR' to 'INT' is not allowed. Use the CONVERT function to run 
this query.

Original exception : java.lang.RuntimeException: Error executing 
statement: SELECT name, department_id FROM employee WHERE id = ? : 
com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from datatype 
'CHAR' to 'INT' is not allowed. Use the CONVERT function to run this 
query. at 
org.apache.cocoon.www.tutorial.docs.edit_empl_xsp.generate(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/tutorial/docs/edit_empl_xsp.java:991) 
at 
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:258) 
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:250) 
at 
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:399) 
at 
org.apache.cocoon.www.tutorial.sitemap_xmap.matchN100BC(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/tutorial/sitemap_xmap.java:1271) 
at 
org.apache.cocoon.www.tutorial.sitemap_xmap.process(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/tutorial/sitemap_xmap.java:757) 
at 
org.apache.cocoon.www.tutorial.sitemap_xmap.process(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/tutorial/sitemap_xmap.java:684) 
at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at 
org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at 
org.apache.cocoon.www.sitemap_xmap.matchN102F1(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3411) 
at 
org.apache.cocoon.www.sitemap_xmap.process(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:2640) 
at 
org.apache.cocoon.www.sitemap_xmap.process(/var/tomcat4/work/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:2538) 
at org.apache.cocoon.sitemap.Handler.process(Handler.java:224) at 
org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at 
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154) 
at org.apache.cocoon.Cocoon.process(Cocoon.java:575) at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) 
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) 
at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) 
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) 
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) 
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) 
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) 
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) 
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) 
at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) 
at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012) 
at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107) 
at java.lang.Thread.run(Thread.java:536)

I took out the <esql:parameter> tags and it works fine. I'm using the 
jdbc driver jConnect-5_5, the latest version.

It works, but it is not standard. Are there any problems that could 
arise by leaving out these tags?


>
>This is standard JDBC syntax for a prepared statement that takes
>parameters. Maybe the original error message provides more information?
>
>>Has anyone ever seen this before? Where do I look in the log files for 
>>debug info, such as tracking what is taking place behind the scenes? Are 
>>there debug parameters that I can pass to Cocoon and receive more debug 
>>info.
>>
>
>That is spread among several files. Most interesting are probably
>core.log and sitemap.log. This can be configured in logkit.xconf.
>
>>My wish list:
>>   A debug feature that outlines each move Cocoon makes, so I can trace 
>>what my code is producing and more importantly where it fails.
>>
>
>The java code produced from an XSP is located
>$TOMCAT/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/path/relative/to/context/name_xsp.java 
>
>It often helps a lot to have a look at it.
>
>	Chris.
>
>Please follow up summarizing your problem and which suggested solution /
>information worked for you. Add "SUMMARY: " to the subject line. This
>will make FAQ generation and searching the list easier. In addition,
>it makes helping you more fun. Thank you.
>

-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638





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

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