cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sameer nanda" <sam_na...@rediffmail.com>
Subject Problem Intergrating Cocoon2.1.2 & MySQL 3.23.58
Date Fri, 07 May 2004 16:38:33 GMT
<P>
Hello Everybody ....<BR>
<BR>
I am having problems with integrating my application using Cocoon 2.1.2 and MySQL 3.23.58.
I read a lot of questionaries realted to this topic<BR>
but could not find anything reletaing to the problem I am having .&nbsp; lets start with
the environment in which I am working.<BR>
<BR>
System Specification:<BR>
-------------------------<BR>
1) Cocoon 2.1.2<BR>
-&gt; downloaded the latest source version and installed using<BR>
&nbsp;  1) Building cocoon using &quot;build&quot;<BR>
&nbsp;  2) Running cocoon using &quot;./cocoon.sh cli&quot;<BR>
&nbsp;  3) http://ip-add:8888&nbsp; points to the welcome page of cocoon<BR>
<BR>
<BR>
2) MySQL 3.23.58<BR>
3) JDK 1.4.0<BR>
4) Apache 2.0.43<BR>
5) Tomcat 4.0.4b1<BR>
<BR>
Following is the step by step procedure I followed trying to build an application to access
database:<BR>
<BR>
Steps:<BR>
--------<BR>
1)&nbsp; copy the driver jar ( mm.mysql-2.0.13-bin.jar) file in&nbsp; cocoon-context:/build/webapp/WEB-INF/lib<BR>
<BR>
2) Defined a MySQL datasource in web.xml<BR>
&nbsp;  &lt;init-param&gt;<BR>
&nbsp; &nbsp; &nbsp; &lt;param-name&gt;load-class&lt;/param-name&gt;<BR>
&nbsp; &nbsp; &nbsp; &lt;param-value&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- For parent ComponentManager sample:
--&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; org.apache.cocoon.samples.parentcm.Configurator<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- For IBM WebSphere: --&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; com.ibm.servlet.classloader.Handler<BR>
<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- For HSQLDB Database Driver: --&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; org.hsqldb.jdbcDriver<BR>
<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- For MYSQL Database Driver (included
by me) --&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; org.gjt.mm.mysql.Driver<BR>
<BR>
&lt;/param-value&gt;<BR>
&nbsp; &nbsp; &lt;/init-param&gt;<BR>
<BR>
3) Add a connection to MySQL in cocoon.xconf<BR>
&lt;jdbc logger=&quot;core.datasources.adhportal&quot; name=&quot;adhportal&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;pool-controller max=&quot;10&quot;
min=&quot;5&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;dburl&gt;jdbc:mysql://portal.cis.umassd.edu/adh&lt;/dburl&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;user&gt;adh&lt;/user&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;password&gt;password&lt;/password&gt;<BR>
&nbsp; &nbsp; &lt;/jdbc&gt;<BR>
<BR>
4) Include pipeline in sitemap.xmap<BR>
&lt;map:match pattern=&quot;sqldocument&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;map:generate
src=&quot;sql/sqlexample.xml&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;map:transform
type=&quot;sql&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &lt;map:parameter name=&quot;use-connection&quot;
value=&quot;adhportal&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/map:transform&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;map:transform
type=&quot;log&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &lt;map:parameter name=&quot;logfile&quot; value=&quot;logfile.log&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &lt;map:parameter name=&quot;append&quot; value=&quot;no&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/map:transform&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;map:transform
src=&quot;sql/sqlexample.xsl&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;map:serialize
type=&quot;xml&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/map:match&gt;<BR>
<BR>
<BR>
5) XML file looks like this:<BR>
&lt;?xml version=&quot;1.0&quot;?&gt;<BR>
&lt;document&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;sql:execute-query xmlns:sql=&quot;http://apache.org/cocoon/SQL/2.0&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;sql:use-connection&gt;adhportal&lt;/sql:use-connection&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;sql:query&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; select * from emp<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/sql:query&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/sql:execute-query&gt;<BR>
&lt;/document&gt;<BR>
<BR>
<BR>
6) XSL looks something like this:<BR>
&lt;?xml version=&quot;1.0&quot;?&gt;<BR>
&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
xmlns:sql=&quot;http://apache.org/cocoon/SQL/2.0&quot;&gt;<BR>
<BR>
&lt;xsl:template match=&quot;document&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;html&gt;&lt;body&gt;&lt;table&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:apply-templates
select=&quot;sql:rowset/sql:row&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/table&gt;&lt;/body&gt;&lt;/html&gt;<BR>
&lt;/xsl:template&gt;<BR>
<BR>
&lt;xsl:template match=&quot;sql:row&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:apply-templates/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<BR>
&lt;/xsl:template&gt;<BR>
<BR>
&lt;xsl:template match=&quot;sql:empNo&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:value-of
select=&quot;.&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<BR>
&lt;/xsl:template&gt;<BR>
<BR>
&lt;xsl:template match=&quot;sql:empName&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:value-of
select=&quot;.&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<BR>
&lt;/xsl:template&gt;<BR>
<BR>
&lt;xsl:template match=&quot;sql:empSal&quot;&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:value-of
select=&quot;.&quot;/&gt;<BR>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<BR>
&lt;/xsl:template&gt;<BR>
<BR>
&lt;/xsl:stylesheet&gt;<BR>
<BR>
<BR>
<BR>
But insted of the expected outout in the form of Rows fetched from the table ,&nbsp; I
get a blank page, and following is the message<BR>
I get in the logfile.log file :<BR>
<BR>
================================================================================================<BR>
<BR>
[[setup] ---------------------------- [Fri May 07 12:32:09 EDT 2004] ----------------------------<BR>
[setDocumentLocator] systemid=file:/home/g_snanda/cocoon-2.1.2/build/webapp/sql/sqlexample.xml,publicid=null<BR>
[startDocument]<BR>
[startElement] uri=,local=document,raw=document<BR>
[characters]<BR>
<BR>
[startPrefixMapping] prefix=sql,uri=http://apache.org/cocoon/SQL/2.0<BR>
[characters]<BR>
<BR>
[characters]<BR>
<BR>
[characters]<BR>
<BR>
[startPrefixMapping] prefix=,uri=http://apache.org/cocoon/SQL/2.0<BR>
[startElement] uri=http://apache.org/cocoon/SQL/2.0,local=rowset,raw=rowset<BR>
[startElement] uri=http://apache.org/cocoon/SQL/2.0,local=error,raw=error<BR>
[characters] Failed to obtain connection. Made 5 attempts with 5000ms interval<BR>
[endElement] uri=http://apache.org/cocoon/SQL/2.0,local=error,qname=error<BR>
[endElement] uri=http://apache.org/cocoon/SQL/2.0,local=rowset,qname=rowset<BR>
[endPrefixMapping] prefix=<BR>
[endPrefixMapping] prefix=sql<BR>
[characters]<BR>
<BR>
[endElement] uri=,local=document,qname=document<BR>
[endDocument]<BR>
<BR>
<BR>
================================================================<BR>
Can anyone figure it out whats wrong ??? Thanks in advance and let me know if you need anything
else.<BR>
<BR>
Looking forward for your help<BR>
<BR>
<BR>
With Regards<BR>
Sam
</P>
<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG
SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom"
BORDER=0 VSPACE=0 HSPACE=0></a>

Mime
View raw message