Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0
-
None
Description
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)