I have an OSGi bundle with persistence service (using hibernate) and a fragment, which contains configuration (xml file). In bundle's activator, I'm loading the configuration using:
@Override
public void start(BundleContext ctx) {
URL url = ctx.getBundle().getResource("hibernate.cfg.xml");
SessionFactory sessionFactory = new AnnotationConfiguration().configure(url).buildSessionFactory();
}
but sometimes, the URL is null. When I've tried to list all available URLs (using findEntries method), it appeared that the bundle's own ones are available always, but the fragment ones only sometimes. I'm using Felix 4.0.2, the bundle and the fragment is started at the same Felix. auto.start level.