I think I'm almost there! WOOT!!
Karaf is giving me the following error:
org.springframework.beans.NotWritablePropertyException: Invalid property
'controller' of bean class [java.lang.string]: Bean property 'controller' is
not writable or has an invalid setter method. Does the parameter type of the
setter match the return type of the getter?
Here is my pojo:
public class DAOTest {
private static DataSourceController controller;
public static void setController(DataSourceController controller){
DAOTest.controller = controller;
}
public static DataSourceController getController() {
return controller;
}
public static String dataPopulator() {
// excercise the DAO and return "pass" if it passes
}
}
Here is the DAOTestContext.xml file:
<bean id="DAOTest" class="myApp.testharness.DAOTest"
factory-method="dataPopulator"
p:controller-ref="dataSourceController"
/>
<osgi:reference id="DataSourceController"
interface="myApp.controller.DataSourceControllerIfc" />
And here is the DataSourceContext.xml file from the myApp.controller bundle
which creates the service in Karaf:
<bean id="myAppDataSourceController"
class="myApp.controller.DataSourceController"
p:Dao-ref="myAppDao" />
<osgi:service id="dataSourceController" ref="myAppDataSourceController"
interface="myApp.controller.DataSourceControllerIfc"/>
In Karaf when I perform an ls on the myApp.controller bundle I get the
following:
Bundle <id> provides:
---------------------------
Bundle-SymboicName = myApp.controller
Bundle-Version = 0.0.1
objectClass = myApp.controller.DataSourceControllerIfc
org.springframework.osgi.bean.name = myAppDataSourceController
service.id = <number>
Does anyone have an idea what the issue is? I also noticed that when I pass
a class reference via Spring to my pojo, it wont' let me pass in Strings or
Ints. Kind of unnerving.
v/r,
Mike Van
--
View this message in context:
http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1956889.html
Sent from the Karaf - User mailing list archive at Nabble.com.