[JIRA] Created: (CAY-702) Improve DBCPDataSourceFactory to use it for a JettyPlus DataSource

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Mon Nov 06 2006 - 17:07:04 EST

  • Next message: Andrus Adamchik (JIRA): "[JIRA] Created: (CAY-703) Cache EntityResolver in the ClientChannel"

    Improve DBCPDataSourceFactory to use it for a JettyPlus DataSource
    ------------------------------------------------------------------

             Key: CAY-702
             URL: http://issues.apache.org/cayenne/browse/CAY-702
         Project: Cayenne
            Type: Improvement

      Components: Cayenne Core Library
        Versions: 3.0
        Reporter: Andrus Adamchik
     Assigned to: Andrus Adamchik
        Priority: Minor
         Fix For: 3.0

    Tried using DBCPDataSourceFactory to map a Jetty 5.1.11 DataSource (as the default Cayenne PoolManager doesn't have connection validation feature), and ran into an NPE since it expected a Configuration object:

    <New class="org.apache.cayenne.conf.DBCPDataSourceFactory">
              <Call name="getDataSource" id="dataSource">
           <Arg>etc/dbcp.properties</Arg>

        </Call>
      </New>

      
      <Call name="addService">
        <Arg>
          <New class="org.mortbay.jetty.plus.DefaultDataSourceService">
            <Set name="Name">DataSourceService</Set>
             <Call name="addDataSource">
                 <Arg>jdbc/myDataSource</Arg>
                 <Arg>
                   <Ref id="dataSource"/>
                 </Arg>
             </Call>
           </New>
         </Arg>
       </Call>

    java.lang.NullPointerException
            at org.apache.cayenne.conf.DBCPDataSourceFactory.getDataSource(DBCPDataSourceFactory.java:67)
            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:585)
            at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:540)

    -- 
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators:
       http://issues.apache.org/cayenne/secure/Administrators.jspa
    -
    For more information on JIRA, see:
       http://www.atlassian.com/software/jira
    



    This archive was generated by hypermail 2.0.0 : Mon Nov 06 2006 - 17:07:26 EST