cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SGFAR...@aol.com
Subject database configuration in sitemap.xmap
Date Fri, 13 Jul 2001 10:36:44 GMT
I do not succeed in getting the connection with my database when I try to externalize the database
configuration out of my xsp file.

When I write this configuration within the xsp file like this:

<esql:driver>org.postgresql.Driver</esql:driver>
<esql:dburl>jdbc:postgresql://localhost:5432/test</esql:dburl>
<esql:username>postgres</esql:username>
<esql:password></esql:password>

it works.

Now I am trying to remove this statement from the xsp file and have this database configuration
occur within "sitemap.xmap" thanks to the following statements:

<map:match pattern="serge/*">
    <map:generate type="serverpages" src="serge/test_xsp_cocoon2_serge.xsp"/>
    <map:transform type="sql">
       <map:parameter name="use-connection" value="personnel"/>
    </map:transform>
   <map:serialize/>
</map:match>

where "personnel" is defined in "cocoon.xconf" with the following statements:

<component name="org.apache.avalon.util.datasource.DataSourceComponentSelector"
class="org.apache.cocoon.CocoonComponentSelector">
   <component-instance name="personnel" class="org.apache.avalon.util.datasource.JdbcDataSource">
     <pool-controller min="0" max="10"/>
     <dburl>jdbc:postgresql://localhost:5432/test</dburl>
     <user>postgres</user>
     <password></password>
    </component-instance>
</component>

(I have tried with <user> and <username>)

The driver is defined in "web.xml" like this:
<init-param>
      <param-name>load-class</param-name>
      <param-value>
    org.postgresql.Driver
      </param-value>
 </init-param>

which seems to work because when I comment it out, I am told to configure the driver.

Here is the error message I get:
"org.apache.cocoon.ProcessingException: Failed to execute pipeline.:org.apache.cocoon.ProcessingException:
Exception in ServerPagesGenerator.generate():java.lang.RuntimeException: Error opening connection
to dburl: : The user property is missing. It is mandatory."


Any idea ?

Thank you

Serge Farnel



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

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


Mime
View raw message