You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lars Huttar <la...@sil.org> on 2005/04/02 03:17:41 UTC

How to debug an empty response?

Hi all,
It's me again with esql woes... but I think this question goes beyond 
ESQL/JDBC.
The strange behavior I'm seeing is this:
I have an XSP page that normally produces XML data as output. I add one 
line to that XSP page, and it no longer produces any XML data. (In IE, 
this results in an IE error: XML document must have a top level 
element.) This would suggest that there was an error which caused the 
pipeline to completely fail and emit no data. But there is no error 
message in the Cocoon response or in any logs. Weird!

Here is the XSP page:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
  xmlns:esql="http://apache.org/cocoon/SQL/v2" 
xmlns:xsp="http://apache.org/xsp"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  xmlns:sil="http://www.sil.org/namespace/cocoon-sql-logicsheet">
  <operation home-page="home_Ethnologue_Database"
    name="Create_Ethnologue_Continent" role-abbrev="editor" 
system="Ethnologue"
    type="create">
    <esql:connection>
      <esql:pool>GEM-Ethnologue-SQLServer-updater</esql:pool>
      <esql:execute-query>
        <esql:call>{call Create_Ethnologue_Continent(<esql:parameter 
direction="out" type="Int">NewID</esql:parameter>)}</esql:call>
        <esql:update-results>
          <rows-affected>
            <esql:get-update-count/>
          </rows-affected>
        </esql:update-results>
       <esql:call-results>
         <newID>
            <!-- ** <esql:get-int from-call="true" column="NewID" /> ** 
offending line -->
        </newID>
       </esql:call-results>
        <esql:error-results>
          <error>
            <exception>
              <esql:to-string/>
            </exception>
            <message>
              <esql:get-message/>
            </message>
          </error>
        </esql:error-results>
        <esql:no-results>
          <no-results/>
        </esql:no-results>
      </esql:execute-query>
    </esql:connection>
    <auto-link on="success" page="edit_Ethnologue_Continent">
      <with-param name="_id" use-param="_id"/>
    </auto-link>
    <auto-link on="failure" page="_back"/>
  </operation>
</xsp:page>

When the "** offending line" (see above) is commented out, this XSP page 
gives the expected result:

<operation ...>
    <rows-affected>1</rows-affected>
    <newID/>
    <auto-link on="success" page="edit_Ethnologue_Continent">
      <with-param name="_id" use-param="_id"/>
    </auto-link>
    <auto-link on="failure" page="_back"/>
</operation>

But when the "** offending line" is uncommented, I get no output from 
Cocoon.

Doing a diff on the generated java code, the only difference is the 
presence of the line

        XSPObjectHelper.xspExpr(contentHandler, 
_esql_query.getCallableStatement().getInt("NewID"));

Again, if this line is causing an exception, shouldn't I see it somewhere?

I'm afraid I'm not experienced enough with Java debugging to know how to 
run Cocoon in a debugger and trace what's happening on this line...
I tried adding debug statements (getLogger().error(...)) in <xsp:logic> 
tags into the XSP to further diagnose the problem, but they didn't seem 
to cause any output (maybe I have to configure logging somehow?)

Can anybody suggest a way for me to troubleshoot this problem?

Thanks,
Lars



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


Re: How to debug an empty response?

Posted by Lars Huttar <la...@sil.org>.
Thanks for the suggestion.
I am indeed running Tomcat.

I increased the java vm memory from 384m to 512m; but it didn't affect
the behavior of the application.

Lars


E Sadler wrote:

>
> Hi, Lars. It isn't really a troubleshooting suggestion so much as
> something to try, but the last time I saw this behavior it was because my
> java vm was running out of memory. Are you running cocoon in Tomcat? If
> you are, try adding these lines to your catalina.sh and restarting 
> Tomcat:
> CATALINA_OPTS="-mx512m" (adjust this according to how much memory you 
> think you can spare)
> export CATALINA_OPTS
>
> If you're running another servlet container, look at the documentation 
> and see how to increase the memory allocation for java when your 
> servlet container starts.
>
> HTH,
> Bess Sadler




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