Hi Matt, as I read section 121.3.4 of the 4.2 enterprise spec the bean definition in the fragment definitely should work. Other than a bug the only thing I can think of is that the fragment is not attached at the time the Blueprint bundle is scanned ...
Regards, Valentin On 25 May 2011, at 15:47, Matt Madhavan wrote: > Hello, > I have a simple datasource bundle and I created a fragment bundle called > datasourcefrg with one bean definition The datasource bundle becomes active > and the datasourcefrg fragment successfully resolves. > > Problem is that the bean definition inside the fragment never gets > instantiated. Question is Can I even create a bean inside an OSGi fragment? > > My fragment definition is as follows: > > <bean id="dataLoader" > > class="com.hcsc.itf.osgi.samples.bank.datasource.dataloadfrg.DataLoader"> > <property name="dataDource" ref="derbyDataSource"/> > </bean> > > > The dataLoader bean never gets created! My datasource bundle def is as > follows. Any ideas? > > <bean id="derbyXADataSource" > class="org.apache.derby.jdbc.EmbeddedXADataSource"> > <property name="databaseName" value="memory:ITSOBANK" /> > <property name="createDatabase" value="create" /> > </bean> > > <service id="xaDataSource" ref="derbyXADataSource" > interface="javax.sql.XADataSource"> > <service-properties> > <entry key="osgi.jndi.service.name" value="jdbc/bankdb" > /> > </service-properties> > </service> > > > <bean id="derbyDataSource" > class="org.apache.derby.jdbc.EmbeddedDataSource"> > <property name="databaseName" value="memory:ITSOBANK" /> > </bean> > > <service ref="derbyDataSource" interface="javax.sql.DataSource"> > <service-properties> > <entry key="osgi.jndi.service.name" > value="jdbc/bankdbnojta" /> > </service-properties> > </service> > > Thanks in advance! > > Matt
