OSGI bundles' classpath is META-INF folder generally. "spring-context.xml" file is in spring folder under META-INF. You can see at application picture. This xml file isn't found by ClassPathXmlApplicationContext. The Problem is Classpath in my opinion. But I didn't fix this issue. In my application, I try configure hibernate with spring-dm. I helped this [website](http://www.journaldev.com/3524/spring-hibernate-integration-example-tutorial) when building app. 

I share below to HİbernateUtil.class:

```
public abstract class HibernateUtil {

    private SessionFactory sessionFactory;

    private SessionFactory buildSessionFactory() {
        try {
            if (this.sessionFactory == null) {
                ApplicationContext applicationContext = new ClassPathXmlApplicationContext("META-INF/spring/spring-context.xml");
                this.sessionFactory = (SessionFactory) applicationContext.getBean("sessionFactory");
            }

        } catch (Throwable ex) {
            System.err.println("Initial SessionFactory creation failed." + ex);
            throw new ExceptionInInitializerError(ex);
        }

        return this.sessionFactory;
    }

    public Session newSession() {
        if (this.sessionFactory == null)
            buildSessionFactory();
        return (this.sessionFactory == null ? null : this.sessionFactory.openSession());
    }

}

```

I share following to spring-context.xml:

```html
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:osgi="http://www.springframework.org/schema/osgi"
 xmlns:context="http://www.springframework.org/schema/context"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                       http://www.springframework.org/schema/osgi
        http://www.springframework.org/schema/osgi/spring-osgi.xsd 
                http://www.springframework.org/schema/context
                http://www.springframework.org/schema/context/spring-context-3.1.xsd">

 <context:annotation-config />

 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  init-method="createDataSource"
  destroy-method="close">
  <property name="driverClassName" value="org.postgresql.Driver" />
  <property name="url" value="jdbc:postgresql://127.0.0.1:5432/xxxxx" />
  <property name="username" value="xxxxx" />
  <property name="password" value="xxxxx" />
  <property name="maxActive" value="100" />
  <property name="maxIdle" value="50" />
  <property name="maxWait" value="1000" />
 </bean>

 <bean id="sessionFactory"
  class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="annotatedClasses">
   <list>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value> 
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>
    <value>tr.cc.ex.dict.kernel.model.xxxx</value>

   </list>
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.format_sql">false</prop>
   </props>
  </property>
 </bean>

</beans>
```

I share following to MANIFEST-MF:

```
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Model
Bundle-SymbolicName: tr.cc.ex.dict.kernel.model;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: tr.cc.ex.dict.kernel.model.internals.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: tr.cc.ex.dict.kernel.model,
 tr.cc.ex.dict.kernel.model.hibernate.util
Import-Package: javax.persistence;version="1.99.0",
 org.apache.commons.dbcp;version="1.4.0",
 org.hibernate;version="3.4.0.GA-A",
 org.hibernate.cfg;version="3.3.2.GA",
 org.hibernate.ejb;version="3.4.0.GA-A",
 org.osgi.framework;version="1.8.0",
 org.postgresql;version="9.4.0",
 org.springframework.beans;version="3.1.0.RELEASE",
 org.springframework.beans.factory;version="3.1.0.RELEASE",
 org.springframework.beans.factory.config;version="3.1.0.RELEASE",
 org.springframework.context;version="3.1.0.RELEASE",
 org.springframework.context.support;version="3.1.0.RELEASE",
 org.springframework.core.io.support;version="3.1.0.RELEASE",
 org.springframework.orm.hibernate3;version="3.1.0.RELEASE",
 org.springframework.orm.hibernate3.annotation;version="3.1.0.RELEASE",
 tr.cc.ex.dict.sys.comp

```

this picture is app folder:

[![enter image description here](https://i.stack.imgur.com/e6PWd.png)](https://i.stack.imgur.com/e6PWd.png)

I share to app console output in below:

```
Nis 13, 2017 7:13:59 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5ca1b42c: startup date [Thu Apr 13 07:13:59 EET 2017]; root of context hierarchy
Nis 13, 2017 7:13:59 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/spring/spring-context.xml]
Initial SessionFactory creation failed.org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/spring/spring-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/spring/spring-context.xml] cannot be opened because it does not exist
gogo: InvocationTargetException: null

```