Issue Details (XML | Word | Printable)

Key: CAY-702
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andrus Adamchik
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Cayenne

Improve DBCPDataSourceFactory to use it for a JettyPlus DataSource

Created: 06/Nov/06 10:05 PM   Updated: 09/Nov/08 01:14 AM
Return to search
Component/s: Cayenne Core Library
Affects Version/s: 3.0
Fix Version/s: 3.0M1

Time Tracking:
Not Specified

Resolution Date: 06/Nov/06 10:07 PM


 Description  « Hide
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)




 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Andrus Adamchik added a comment - 22/Nov/06 11:55 PM
Closing all 3.0 issues marked as resolved as of 11/22 - I logged a list of them in release notes.