cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: Help with Cocoon 2.1.2 + MySQL 3.23.58
Date Fri, 07 May 2004 08:07:30 GMT
Sam

Did you add a <map:transform> tag with the DB connection
details to the sitemap?

Derek

>>> sam_nanda@rediffmail.com 2004/05/07 01:47:12 AM >>>

Hello Everybody ....

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
but could not find anything reletaing to the problem I am having . 
lets start with the environment in which I am working.

System Specification:
-------------------------
1) Cocoon 2.1.2
-> downloaded the latest source version and installed using
            1) build cocoon using "build"
            2) run cocoon using "cocoon servlet" or "./cocoon.sh
servlet"
            3) http://ip-add:8888  points to the welcome page of
cocoon


2) MySQL 3.23.58
3) JDK 1.4.0
4) Apache 2.0.43
5) Tomcat 4.0.4b1

Following is the step by step procedure I followed trying to build an
application to access database:

Steps:
--------
1)  copy the driver jar ( mm.mysql-2.0.13-bin.jar) file in 
cocoon-context:/build/webapp/WEB-INF/lib

2) Defined a MySQL datasource in web.xml
  <init-param>
      <param-name>load-class</param-name>
      <param-value>
        <!-- For parent ComponentManager sample: -->
        org.apache.cocoon.samples.parentcm.Configurator
        <!-- For IBM WebSphere: -->
        com.ibm.servlet.classloader.Handler

        <!-- For HSQLDB Database Driver: -->
        org.hsqldb.jdbcDriver

        <!-- For MYSQL Database Driver (included by me) -->
        org.gjt.mm.mysql.Driver

</param-value>
    </init-param>

3) Add a connection to MySQL in cocoon.xconf
<jdbc logger="core.datasources.adhportal" name="adhportal">
        <pool-controller max="10" min="5"/>
        <dburl>jdbc:mysql://portal.cis.umassd.edu/adh</dburl>
        <user>adh</user>
        <password>password</password>
    </jdbc>

4) Include pipeline in sitemap.xmap
<map:match pattern="sqldocument">
                <map:generate src="sql/sqlexample.xml"/>
                <map:transform type="sql">
                        <map:parameter name="use-connection"
value="adhportal"/>
                </map:transform>
                <map:transform type="log">
                        <map:parameter name="logfile"
value="logfile.log"/>
                        <map:parameter name="append" value="no"/>
                </map:transform>
                <map:transform src="sql/sqlexample.xsl"/>
                <map:serialize type="xml"/>
        </map:match>


5) XML file looks like this:
<?xml version="1.0"?>
<document>
        <sql:execute-query
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
                <sql:use-connection>adhportal</sql:use-connection>
                <sql:query>
                        select * from emp
                </sql:query>
        </sql:execute-query>
</document>


6) XSL looks something like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0">

<xsl:template match="document">
        <html><body><table>
                <xsl:apply-templates select="sql:rowset/sql:row"/>
        </table></body></html>
</xsl:template>

<xsl:template match="sql:row">
        <tr>
                <xsl:apply-templates/>
        </tr>
</xsl:template>

<xsl:template match="sql:empNo">
        <td>
                <xsl:value-of select="."/>
        </td>
</xsl:template>

<xsl:template match="sql:empName">
        <td>
                <xsl:value-of select="."/>
        </td>
</xsl:template>

<xsl:template match="sql:empSal">
        <td>
                <xsl:value-of select="."/>
        </td>
</xsl:template>

</xsl:stylesheet>



But insted of the expected outout in the form of Rows fetched from the
table ,  I get a blank page, and following is the message
I get in the logfile.log file :

================================================================================================

[setup] ---------------------------- [Wed May 05 14:51:29 EDT 2004]
----------------------------
[setDocumentLocator]
systemid=file:/home/g_snanda/cocoon-2.1.2/build/webapp/sql/sqlexample.xml,publicid=
[startDocument]
[startElement] uri=,local=document,raw=document
[characters]

[startPrefixMapping] prefix=sql,uri=http://apache.org/cocoon/SQL/2.0
[characters]

[characters]

[characters]

[startPrefixMapping] prefix=,uri=http://apache.org/cocoon/SQL/2.0
[startElement]
uri=http://apache.org/cocoon/SQL/2.0,local=rowset,raw=rowset
[startElement]
uri=http://apache.org/cocoon/SQL/2.0,local=error,raw=error
[characters] Failed to obtain connection. Made 5 attempts with 5000ms
interval
[endElement]
uri=http://apache.org/cocoon/SQL/2.0,local=error,qname=error
[endElement]
uri=http://apache.org/cocoon/SQL/2.0,local=rowset,qname=rowset
[endPrefixMapping] prefix=
[endPrefixMapping] prefix=sql
[characters]

[endElement] uri=,local=document,qname=document
[endDocument]

================================================================

This is what I see in the access.log file, but I have no idea whats
wrong


WARN    (2004-05-05) 21:09.19:654  [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Could not force-load class:
com.ibm.servlet.classloader.Handler
java.lang.ClassNotFoundException: com.ibm.servlet.classloader.Handler
        at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
        at
org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:234)
        at
org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:198)
        at
org.apache.cocoon.util.ClassUtils.loadClass(ClassUtils.java:88)
        at
org.apache.cocoon.servlet.CocoonServlet.forceLoad(CocoonServlet.java:937)
        at
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1342)
        at
org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:507)
        at
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:219)
        at
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:436)
        at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:150)
        at
org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:442)
        at org.mortbay.http.HttpServer.start(HttpServer.java:647)
        at org.mortbay.jetty.Server.main(Server.java:429)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at Loader.invokeMain(Unknown Source)
        at Loader.run(Unknown Source)
        at Loader.main(Unknown Source)
INFO    (2004-05-05) 21:09.19:723  [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Reloading from:
file:/home/g_snanda/cocoon-2.1.2/build/webapp/WEB-INF/cocoon.xconf

=======================================================================

Can anyone figure it out whats wrong ??? Thanks in advance and let me
know if you need anything else.

Looking forward for your help


With Regards
Sam 

 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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


Mime
View raw message