cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niket Anand" <niketan...@npi.stpn.soft.net>
Subject Re: HELP,HELP PLEASE : Error opening connection to dburl:
Date Wed, 30 Jan 2002 10:53:09 GMT
put dburl in cocoon.xconf as
<datasources>
    <jdbc name="personnel">
      <!--
          If you have an Oracle database, and are using the the
      pool-controller below, you should add the attribute
      "oradb" and set it to true.

      <pool-controller min="5" max="10" oradb="true"/>

      That way the test to see if the server has disconnected
      the JdbcConnection will function properly.
      -->
      <pool-controller min="5" max="10"/>
      <!--
          If you need to ensure an autocommit is set to true or
      false, then create the "auto-commit" element below.

      <auto-commit>false</auto-commit>

      The default is true.
      -->
      <!--<dburl>jdbc:hsqldb:hsql://localhost:9002</dburl>
      <user>sa</user>
      <password></password>
      -->
      <dburl>jdbc:postgresql://localhost:5432/template1</dburl>
      <user>niketanand</user>
      <password>niket</password>
    </jdbc>
  </datasources>


and driver in web.xml as
<init-param>
      <param-name>load-class</param-name>
      <param-value>
        <!-- For IBM WebSphere: 
        com.ibm.servlet.classloader.Handler -->

        <!-- For Database Driver: -->
        org.hsqldb.jdbcDriver
 org.postgresql.Driver
        
        <!-- For parent ComponentManager sample:
        org.apache.cocoon.samples.parentcm.Configurator
        -->
      </param-value>
    </init-param>
  
  ----- Original Message ----- 
  From: Ferran Urgell 
  To: cocoon-users@xml.apache.org 
  Sent: Wednesday, January 30, 2002 4:03 PM
  Subject: Re: HELP,HELP PLEASE : Error opening connection to dburl:


  Maybe you need to put in <esql:dburl>  the number of the port.. 
  I've never used postgresql to connect with cocoon, I've only used mysql  (but I think it's
the same..)

    ----- Original Message ----- 
    From: Ivan Manuel Andrade Muñoz 
    To: cocoon-users@xml.apache.org 
    Sent: Tuesday, January 29, 2002 2:50 PM
    Subject: HELP,HELP PLEASE : Error opening connection to dburl:


    Hello ALL. 

    The error is: 

    ************************************************************** 

    ------------------------------------------------------------------ 
    Cocoon 1.8.2 
    ------------------------------------------------------------------ 

    Error found handling the request. 

    java.lang.RuntimeException: Error opening connection to dburl: 
    jdbc:postgresql://localhost/test 
            at 

    _usr._local._jakarta._build._tomcat._webapps._cocoon._samples._sql._esql.pop 
    ulateDocument(_esql.java:162) 
            at 
    org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:97) 
           at 

    org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:527) 
            at org.apache.cocoon.Engine.handle(Engine.java:384) 
            at org.apache.cocoon.Cocoon.service(Cocoon.java:183) 
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) 
            at 
    org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) 
            at org.apache.tomcat.core.Handler.service(Handler.java:287) 
            at 
    org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) 
            at 

    org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81 
    2) 
            at 
    org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) 
            at 

    org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC 
    onnectionHandler.java:213) 
            at 
    org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) 
            at 
    org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) 
            at java.lang.Thread.run(Thread.java:484) 

    -------------------------------------------------------------- 
    Warning: this page has been dynamically generated. 
    Copyright (c) 1999-2001 The Apache XML Project. 
    All rights reserved. 
    -------------------------------------------------------------- 

    *************************************************************** 

    I have installed: 

    Red Hat Linux 7.2 
    Sun JDK 1.3.1_01 
    Apache 1.3.19 
    Tomcat 3.2.3 
    Cocoon 1.8.2 
    Postgresql 7.1.3 
    jdbc7.1-1.2 
    ------------------------- 
    Note: form postgresql 7.1.3, with the option -- with-java 

    I have formed my archive: 

    My file .bash_profile. 
    ------------------------------------------------------------ 
    # .bash_profile 

    # User specific environment and startup programs 

    JAKARTA_HOME=/usr/local/jakarta 
    ANT_HOME=$JAKARTA_HOME/jakarta-ant 

    PATH=$PATH:$HOME/bin:/usr/java/jdk1.3.1_01/bin:$ANT_HOME/bootstrap/bin:/usr/ 
    local/pgsql/bin 
    BASH_ENV=$HOME/.bashrc 
    USERNAME="root" 
    JAVA_HOME=/usr/java/jdk1.3.1_01 
    #JAKARTA_HOME=/usr/local/jakarta 
    #ANT_HOME=$JAKARTA_HOME/jakarta-ant 
    TOMCAT_HOME=$JAKARTA_HOME/build/tomcat 
    COCOON_HOME=/usr/local/cocoon1.8.2/ 
    PG=/usr/local/pgsql 
    PGLIB=$PG/lib 
    MANPATH=$MANPATH:$PG/man 
    CLASSPATH=/usr/local/jdbc7.1-1.2.jar 
    export USERNAME BASH_ENV JAVA_HOME JAKARTA_HOME ANT_HOME TOMCAT_HOME 
    COCOON_HOME PATH CLASSPATH 
    -------------------------------------------------------------------------- 

    My archive esql.xml is: 

    <?cocoon-process type="xslt"?> 
    <?xml-stylesheet type="text/xsl" href="esql.xsl"?> 

    <xsp:page 
    xmlns:xsp="http://www.apache.org/1999/XSP/Core" 
    xmlns:esql="http://apache.org/cocoon/SQL/v2" 
              
         

    <page> 

    <esql:connection> 
    <esql:driver>org.postgresql.Driver</esql:driver> 
    <esql:dburl>jdbc:postgresql://localhost/test</esql:dburl> 
    <esql:username>postgres</esql:username> 
    <esql:password>postgres</esql:password> 
    <esql:execute-query> 
       <esql:query>select id,name from department_table</esql:query> 
       <esql:results> 
         <header>header info</header> 
         <esql:row-results> 
           <department> 
             <id><esql:get-int column="id"/></id> 
             <name><esql:get-string column="name"/></name> 
             <esql:connection> 
               <esql:driver>org.postgresql.Driver</esql:driver> 
               <esql:dburl>jdbc:postgresql://localhost/test</esql:dburl> 
               <esql:username>test</esql:username> 
               <esql:password>test</esql:password> 
               <esql:execute-query> 
                 <esql:query>select name from user_table where department_id = 
    <esql:parameter type="int"><esql:get-int ancestor="1" 
    column="id"/></esql:parameter></esql:query> 
                 <esql:results> 
                   <esql:row-results> 
                     <user><esql:get-string column="name"/></user> 
                   </esql:row-results> 
                 </esql:results> 
                 <esql:no-results> 
                   <user>No employees</user> 
                 </esql:no-results> 
               </esql:execute-query> 
             </esql:connection> 
           </department> 
         </esql:row-results> 
         <footer>footer info</footer> 
       </esql:results> 
    </esql:execute-query> 
    </esql:connection> 

    </page> 

    </xsp:page> 
    ----------------------------------------------------------------- 
    Where test, is my data base poststoneware is the account that I use to raise 
    the postmaster and to enter my data base. 

    For example, in my data base test:To me it shows 

    test=# select * from pg_user; 
    usename  | usesysid | usecreatedb | usetrace | usesuper | usecatupd | 
    passwd  | valuntil 
    ----------+----------+-------------+----------+----------+-----------+----------+----------

    postgres |      420 | t           | t        | t        | t         | 
    ******** | 
    (1 row) 

    That you would recommend to me to do?. 
    To change something in esql.xml?. 
    As the username and password of my data base in postmaster?. 
    As I create a username to him and password to a data base?. 

    From already thanks for your aid. 
    Ivan Manuel Andrade Muñoz. 
    Punta Arenas. 
    Chile. 
    FONO: (061) 243046 



----------------------------------------------------------------------------
    MSN Photos es la manera más sencilla de compartir e imprimir sus fotos. http://photos.latam.msn.com/Support/WorldWide.aspx
    --------------------------------------------------------------------- Please check that
your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail:
For additional commands, e-mail: 

Mime
View raw message