title: Cannot create session bean after switching to SDN4.1
body: <p>I am happy that SDN4.1 is now available, because version 4 was rather unstable. I have upgraded my project as soon as possible, but I have a strange problem which appears when, a method that uses Neo4j database connection is used. I see such exception:</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [appServlet] in context with path [/tsg] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.getSession' defined in package.config.ApplicationConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.ogm.session.Session]: Factory method 'getSession' threw exception; nested exception is org.neo4j.ogm.exception.ServiceNotFoundException: org.neo4j.ogm.drivers.http.driver.HttpDriver] with root cause
  org.neo4j.ogm.exception.ServiceNotFoundException: org.neo4j.ogm.drivers.http.driver.HttpDriver
      at org.neo4j.ogm.service.DriverService.load(DriverService.java:51)
      at org.neo4j.ogm.service.DriverService.load(DriverService.java:63)
      at org.neo4j.ogm.service.Components.loadDriver(Components.java:128)
      at org.neo4j.ogm.service.Components.driver(Components.java:86)
      at org.neo4j.ogm.session.SessionFactory.openSession(SessionFactory.java:79)
      at org.springframework.data.neo4j.config.Neo4jConfiguration.getSession(Neo4jConfiguration.java:56)
      at package.config.ApplicationConfig.getSession(ApplicationConfig.java:255)
      at package.config.ApplicationConfig$$EnhancerBySpringCGLIB$$5bc6b7bf.CGLIB$getSession$15(&lt;generated&gt;)
  </code></pre>
  
  <p>I believe that this is a configuration problem, so here is my config:</p>
  
  <pre><code>package package.config;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import javax.sql.DataSource;
  
  import org.neo4j.ogm.config.Configuration;
  import org.apache.commons.dbcp2.BasicDataSource;
  import org.hibernate.jpa.HibernatePersistenceProvider;
  import org.neo4j.ogm.session.Session;
  import org.neo4j.ogm.session.SessionFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.ComponentScan.Filter;
  import org.springframework.context.annotation.FilterType;
  import org.springframework.context.annotation.Import;
  import org.springframework.context.annotation.PropertySource;
  import org.springframework.context.annotation.Scope;
  import org.springframework.context.annotation.ScopedProxyMode;
  import org.springframework.core.annotation.Order;
  import org.springframework.core.env.Environment;
  import org.springframework.core.io.ClassPathResource;
  import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
  import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  import org.springframework.data.neo4j.config.Neo4jConfiguration;
  import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
  import org.springframework.data.neo4j.server.Neo4jServer;
  import org.springframework.data.neo4j.server.RemoteServer;
  import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
  import org.springframework.data.transaction.ChainedTransactionManager;
  import org.springframework.jdbc.datasource.init.DataSourceInitializer;
  import org.springframework.jdbc.datasource.init.DatabasePopulator;
  import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
  import org.springframework.orm.jpa.JpaTransactionManager;
  import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
  import org.springframework.orm.jpa.vendor.HibernateJpaDialect;
  import org.springframework.retry.annotation.EnableRetry;
  import org.springframework.transaction.PlatformTransactionManager;
  import org.springframework.transaction.annotation.EnableTransactionManagement;
  import org.springframework.transaction.jta.JtaTransactionManager;
  import org.springframework.web.multipart.commons.CommonsMultipartResolver;
  import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
  
  
  import package.controller.DeviceController;
  import package.controller.PersonController;
  
  @org.springframework.context.annotation.Configuration
  @ComponentScan(basePackages = "package", excludeFilters = {
          @Filter(type = FilterType.ASSIGNABLE_TYPE, value = { DeviceController.class,
                  PersonController.class }) })
  
  @EnableTransactionManagement
  @PropertySource("classpath:application.properties")
  @EnableJpaRepositories(basePackages = "package.persistence")
  @EnableNeo4jRepositories("package.neo4jrepository")
  @Import({ WebSpringConfig.class })
  public class ApplicationConfig extends Neo4jConfiguration {
  
      @Autowired
      Environment env;
  
      public ApplicationConfig() {
      }
      @Bean
      public Configuration getConfiguration() {
         Configuration config = new Configuration();
         config
             .driverConfiguration()
             .setDriverClassName
              ("org.neo4j.ogm.drivers.http.driver.HttpDriver").setURI("http://xxx:yyy@localhost:7474");
         return config;
      }
  
      @Bean
      public DataSource dataSource() {
  
          BasicDataSource dataSource = new BasicDataSource();
          dataSource.setDriverClassName("com.mysql.jdbc.Driver");
          dataSource.setUrl(env.getProperty("database.url"));
          dataSource.setUsername(env.getProperty("database.user"));
          dataSource.setPassword(env.getProperty("database.password"));
          return dataSource;
      }
  
      @Bean
      public DataSourceInitializer initializeDatabase() {
          DataSourceInitializer dbInitializer = new DataSourceInitializer();
          dbInitializer.setDataSource(dataSource());
          dbInitializer.setDatabasePopulator(databasePopulator());
          dbInitializer.setEnabled(true);
          return dbInitializer;
      }
  
      @Bean
      public DatabasePopulator databasePopulator() {
          ResourceDatabasePopulator resDatabasePopulator = new ResourceDatabasePopulator();
          resDatabasePopulator.setContinueOnError(true);
          resDatabasePopulator.addScript(new ClassPathResource("importagreements.sql"));
          resDatabasePopulator.setSqlScriptEncoding("UTF-8");
          return resDatabasePopulator;
      }
  
      @Bean
      @Autowired
      public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
          LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
          entityManagerFactory.setDataSource(dataSource);
          entityManagerFactory.setPackagesToScan(new String[] { "package.persistence.domain" });
          entityManagerFactory.setJpaDialect(new HibernateJpaDialect());
          Map&lt;String, String&gt; jpaProperties = new HashMap&lt;String, String&gt;();
          jpaProperties.put("hibernate.connection.charSet", "UTF-8");
          jpaProperties.put("spring.jpa.hibernate.ddl-auto", "update");
          jpaProperties.put("hibernate.ejb.naming_strategy", "org.hibernate.cfg.EJB3NamingStrategy");
          jpaProperties.put("hibernate.bytecode.provider", "javassist");
          jpaProperties.put("hibernate.dialect", "org.hibernate.dialect.MySQL5InnoDBDialect");
          jpaProperties.put("hibernate.hbm2ddl.auto", "update");
          jpaProperties.put("hibernate.order_inserts", "true");
          jpaProperties.put("hibernate.jdbc.batch_size", "50");
  
          entityManagerFactory.setJpaPropertyMap(jpaProperties);
          entityManagerFactory.setPersistenceProvider(new HibernatePersistenceProvider());
          return entityManagerFactory;
      }
      @Bean(name = "transactionManager")
      @Autowired
      public PlatformTransactionManager neo4jTransactionManager(Neo4jTransactionManager neoTransactionManager,
              JpaTransactionManager mysqlTransactioNmanager) throws Exception {
          return new ChainedTransactionManager(mysqlTransactioNmanager, neoTransactionManager);
      }
  
      @Bean(name = "neo4jTransactionManager")
      @Autowired
      public Neo4jTransactionManager neo4jTransactionManager(Session session) throws Exception {
          return new Neo4jTransactionManager(session);
      }
  
      @Bean(name = "mysqlTransactionManager")
      @Autowired
      public JpaTransactionManager mysqlTransactionManager(LocalContainerEntityManagerFactoryBean entityManagerFactory)
              throws Exception {
          JpaTransactionManager mysqlTransactioNmanager = new JpaTransactionManager(entityManagerFactory.getObject());
          return mysqlTransactioNmanager;
      }
  
      @Bean
      public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
          return new PersistenceExceptionTranslationPostProcessor();
      }
  
      @Bean(name = "multipartResolver")
      public CommonsMultipartResolver commonsMultipartResolver() {
          CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
          commonsMultipartResolver.setDefaultEncoding("utf-8");
          commonsMultipartResolver.setMaxUploadSize(50000000);
          return commonsMultipartResolver;
      }
  
      @Override
      public SessionFactory getSessionFactory() {
          return new SessionFactory(getConfiguration(),"package.domain", "package.relation", "package.util",
                  "package.httpBody");
  
      }
  
      @Bean
      @Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
      public Session getSession() throws Exception {
          return super.getSession();
      }
  
  }
  </code></pre>
  
  <p>Here is my POM:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;project&lt;/groupId&gt;
      &lt;artifactId&gt;tsg&lt;/artifactId&gt;
      &lt;name&gt;tsg&lt;/name&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0.0-BUILD-SNAPSHOT&lt;/version&gt;
      &lt;properties&gt;
  
          &lt;!-- Generic properties --&gt;
          &lt;java-version&gt;1.7&lt;/java-version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
          &lt;javax.inject.version&gt;1&lt;/javax.inject.version&gt;
          &lt;cglib.version&gt;2.2.2&lt;/cglib.version&gt;
  
          &lt;!-- Web --&gt;
          &lt;javax.servlet.version&gt;2.5&lt;/javax.servlet.version&gt;
          &lt;javax.servlet.jsp.version&gt;2.1&lt;/javax.servlet.jsp.version&gt;
          &lt;javax.servlet.jstl.version&gt;1.2&lt;/javax.servlet.jstl.version&gt;
          &lt;jersey.version&gt;1.8&lt;/jersey.version&gt;
          &lt;com.google.code.gson.version&gt;2.2.4&lt;/com.google.code.gson.version&gt;
          &lt;javax.ws.rs-api.version&gt;2.0&lt;/javax.ws.rs-api.version&gt;
  
          &lt;!-- Spring --&gt;
          &lt;org.springframework-version&gt;4.1.9.RELEASE&lt;/org.springframework-version&gt;
          &lt;spring-security.version&gt;3.2.4.RELEASE&lt;/spring-security.version&gt;
          &lt;spring-data-commons.version&gt;1.12.0.M1&lt;/spring-data-commons.version&gt;
          &lt;spring-data-neo4j.version&gt;4.1.0.M1&lt;/spring-data-neo4j.version&gt;
          &lt;spring-data-jpa.version&gt;1.9.2.RELEASE&lt;/spring-data-jpa.version&gt;
  
          &lt;!-- Aspects --&gt;
          &lt;org.aspectj-version&gt;1.7.4&lt;/org.aspectj-version&gt;
  
          &lt;!-- Neo4j --&gt;
          &lt;org.neo4j.app.version&gt;2.0.3&lt;/org.neo4j.app.version&gt;
          &lt;neo4j.ogm.version&gt;2.0.0-M2&lt;/neo4j.ogm.version&gt;
  
          &lt;!-- Hibernate / JPA --&gt;
          &lt;org.hibernate.version&gt;4.3.11.Final&lt;/org.hibernate.version&gt;
          &lt;org.hibernate-validator.version&gt;5.1.1.Final&lt;/org.hibernate-validator.version&gt;
  
          &lt;!-- MySQL --&gt;
          &lt;mysql-connector-java.version&gt;5.1.34&lt;/mysql-connector-java.version&gt;
  
          &lt;!-- Logging --&gt;
          &lt;org.slf4j-version&gt;1.6.6&lt;/org.slf4j-version&gt;
          &lt;log4j.version&gt;1.2.15&lt;/log4j.version&gt;
  
          &lt;!-- Testing --&gt;
          &lt;junit.version&gt;4.7&lt;/junit.version&gt;
  
          &lt;!-- Maven plugin --&gt;
          &lt;maven-eclipse-plugin.version&gt;2.9&lt;/maven-eclipse-plugin.version&gt;
          &lt;maven-compiler-plugin.version&gt;2.5.1&lt;/maven-compiler-plugin.version&gt;
          &lt;exec-maven-plugin.version&gt;1.2.1&lt;/exec-maven-plugin.version&gt;
  
          &lt;!-- Smack --&gt;
          &lt;smack.version&gt;4.1.0&lt;/smack.version&gt;
  
      &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-maven-snapshot&lt;/id&gt;
          &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
          &lt;name&gt;Springframework Maven MILESTONE Repository&lt;/name&gt;
          &lt;url&gt;http://maven.springframework.org/milestone&lt;/url&gt;
      &lt;/repository&gt;
  
          &lt;repository&gt;
              &lt;id&gt;jcenter-snapshots&lt;/id&gt;
              &lt;name&gt;jcenter&lt;/name&gt;
              &lt;url&gt;https://jcenter.bintray.com/&lt;/url&gt;
          &lt;/repository&gt;
  
          &lt;repository&gt;
              &lt;id&gt;neo4j-release-repository&lt;/id&gt;
              &lt;name&gt;Neo4j Maven 2 release repository&lt;/name&gt;
              &lt;url&gt;http://m2.neo4j.org/content/repositories/releases/&lt;/url&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
  
      &lt;/repositories&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Apache Commons FileUpload --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
              &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Apache Commons IO --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-io&lt;/groupId&gt;
              &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- dependency&gt; &lt;groupId&gt;javax.validation&lt;/groupId&gt; &lt;artifactId&gt;validation-api&lt;/artifactId&gt; 
              &lt;version&gt;1.1.0.Final&lt;/version&gt; &lt;/dependency --&gt;
  
          &lt;!-- Smack --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.igniterealtime.smack&lt;/groupId&gt;
              &lt;artifactId&gt;smack-java7&lt;/artifactId&gt;
              &lt;version&gt;${smack.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.igniterealtime.smack&lt;/groupId&gt;
              &lt;artifactId&gt;smack-tcp&lt;/artifactId&gt;
              &lt;version&gt;${smack.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.igniterealtime.smack&lt;/groupId&gt;
              &lt;artifactId&gt;smack-im&lt;/artifactId&gt;
              &lt;version&gt;${smack.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.igniterealtime.smack&lt;/groupId&gt;
              &lt;artifactId&gt;smack-extensions&lt;/artifactId&gt;
              &lt;version&gt;${smack.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- Spring Data --&gt;
          &lt;!-- &lt;dependency&gt; &lt;groupId&gt;org.springframework.data&lt;/groupId&gt; &lt;artifactId&gt;spring-data-commons&lt;/artifactId&gt; 
              &lt;version&gt;${spring-data-commons.version}&lt;/version&gt; &lt;/dependency&gt; --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-neo4j&lt;/artifactId&gt;
              &lt;version&gt;${spring-data-neo4j.version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;jersey-multipart&lt;/artifactId&gt;
                      &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
                  &lt;/exclusion&gt;
  
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.retry&lt;/groupId&gt;
              &lt;artifactId&gt;spring-retry&lt;/artifactId&gt;
              &lt;version&gt;1.1.2.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring Security --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
              &lt;version&gt;${spring-security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
              &lt;version&gt;${spring-security.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
              &lt;version&gt;${spring-security.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- AspectJ --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
              &lt;version&gt;${org.aspectj-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
              &lt;version&gt;1.8.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;${log4j.version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.mail&lt;/groupId&gt;
                      &lt;artifactId&gt;mail&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.jms&lt;/groupId&gt;
                      &lt;artifactId&gt;jms&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jdmk&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxtools&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jmx&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxri&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt; 
  
          &lt;!-- @Inject --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.inject&lt;/groupId&gt;
              &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
              &lt;version&gt;${javax.inject.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Servlet --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;${javax.servlet.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;${javax.servlet.jsp.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;${javax.servlet.jstl.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- ******* JPA/Hibernate ******** --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;${org.hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.0.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;${org.hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
              &lt;version&gt;${spring-data-jpa.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;${org.hibernate-validator.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;${mysql-connector-java.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp2&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- additional libraries --&gt;
          &lt;!-- &lt;dependency&gt;
              &lt;groupId&gt;cglib&lt;/groupId&gt;
              &lt;artifactId&gt;cglib&lt;/artifactId&gt;
              &lt;version&gt;${cglib.version}&lt;/version&gt;
          &lt;/dependency&gt;  --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;${com.google.code.gson.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
              &lt;artifactId&gt;activemq-client&lt;/artifactId&gt;
              &lt;version&gt;5.9.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
              &lt;artifactId&gt;activemq-client&lt;/artifactId&gt;
              &lt;version&gt;5.9.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
              &lt;version&gt;2.6.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
              &lt;version&gt;2.6.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml&lt;/groupId&gt;
              &lt;artifactId&gt;classmate&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.dataformat&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-dataformat-xml&lt;/artifactId&gt;
              &lt;version&gt;2.6.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;joda-time&lt;/groupId&gt;
              &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
              &lt;version&gt;2.9&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
              &lt;version&gt;2.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
              &lt;version&gt;2.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
              &lt;version&gt;3.3.5&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${maven-eclipse-plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;additionalProjectnatures&gt;
                          &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
                      &lt;/additionalProjectnatures&gt;
                      &lt;additionalBuildcommands&gt;
                          &lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
                      &lt;/additionalBuildcommands&gt;
                      &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                      &lt;downloadJavadocs&gt;true&lt;/downloadJavadocs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${maven-compiler-plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${java-version}&lt;/source&gt;
                      &lt;target&gt;${java-version}&lt;/target&gt;
                      &lt;compilerArgument&gt;-Xlint:all&lt;/compilerArgument&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${exec-maven-plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;mainClass&gt;org.test.int1.Main&lt;/mainClass&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;resources&gt;
              &lt;!-- Placeholders that are found from the files located in the configured 
                  resource directories are replaced with the property values found from the 
                  profile specific configuration file. --&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;true&lt;/filtering&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;filters&gt;
              &lt;!-- Ensures that the config.properties file is always loaded from the 
                  configuration directory of the active Maven profile. --&gt;
              &lt;filter&gt;src/main/resources/profiles/${build.profile.id}/config.properties&lt;/filter&gt;
          &lt;/filters&gt;
  
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JYdXJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JYdXJ.png" alt="Dependency Hierarchy"></a></p>