using cayenne data connection pools with struts.

From: Mike Block (mbloc..ac.com)
Date: Thu Nov 06 2003 - 15:18:39 EST

  • Next message: Andrus Adamchik: "Re: using cayenne data connection pools with struts."

    Hi,
        I am trying to figure out how to use Cayenne's db connection pooling
    with struts. Are there any examples showing this?

    What I have tried is:
        I have create a data-source in the struts config file:
            my host, my database, etc are obviously filled in with correct
    values.... :-)

    <data-sources>
            <data-source type="org.objectstyle.cayenne.conn.PoolManager">
                    <set-property property="dataSourceUrl" value="jdbc:postgresql://<my
    host>/<my database>"/>
                    <set-property property="jdbcDriver" value="org.postgresql.Driver"/>
                    <set-property property="maxConnections" value="5"/>
                    <set-property property="minConnections" value="2"/>
                    <set-property property="userName" value="<my username>"/>
                    <set-property property="password" value="<my password>"/>
            </data-source>
    </data-sources>

    The webapp fails to load with the following stack trace:
            NB : ExtendedActionServlet is mine which currently just calls
    super.init(), super.initModulesConfig() methods [it does nothing].

    ERROR ActionServlet: Initializing application data source
    org.apache.struts.action.DATA_SOURCE
    java.lang.InstantiationException:
    org.objectstyle.cayenne.conn.PoolManager
             at java.lang.Class.newInstance0(Class.java:291)
             at java.lang.Class.newInstance(Class.java:259)
             at
    org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.jav
    a:206)
             at
    org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServl
    et.java:1033)
             at
    com.dci.blickman.blickmanCat.framework.ExtendedActionServlet.initModuleD
    ataSources(Unknown Source)
             at
    org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
             at
    com.dci.blickman.blickmanCat.framework.ExtendedActionServlet.init(Unknow
    n Source)
             at javax.servlet.GenericServlet.init(GenericServlet.java:256)
             at
    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
    a:935)
            . . .

    Thanks!
            -[]
    Digital Color Image
    Phone: 856-662-5532



    This archive was generated by hypermail 2.0.0 : Thu Nov 06 2003 - 15:18:45 EST