title: UnsatisfiedDependencyException by Maven Packed war but not Intellij IDE why?
body: <p>i am using Intellij IDE for my springboot project, while running my spring boot project it works fine. but when i create a war with mvn package and run with java -jar project.war it throwing the following error</p>
  
  <h2>Warning</h2>
  
  <p>2018-05-23 11:05:08.635  WARN 13025 --- [           main] 
   ationConfigEmbeddedWebApplicationContext : Exception encountered 
   during context initialization - cancelling refresh attempt: 
   org.springframework.beans.factory.UnsatisfiedDependencyException: 
   Error creating bean with name HibernateJpaAutoConfiguration': 
   Unsatisfied dependency expressed through constructor parameter 0; 
   nested exception is 
   org.springframework.beans.factory.BeanCreationException: Error 
   creating bean with name 'dataSource' defined in class path resource 
   [com/myproject/config/DefaultDataSource.class]: Bean instantiation via 
   factory method failed; nested exception is 
   org.springframework.beans.BeanInstantiationException: Failed to 
   instantiate [com.mchange.v2.c3p0.ComboPooledDataSource]: Factory method 
   'dataSource' threw exception; nested exception is 
    java.lang.ExceptionInInitializerError</p>
  
  <h2>Exception</h2>
  
  <p>Error starting ApplicationContext. To display the auto-configuration 
          report re-run your application with 'debug' enabled.
          2018-05-23 11:05:10.854 ERROR 13025 --- [           main] 
          o.s.boot.SpringApplication               : Application startup failed
          org.springframework.beans.factory.UnsatisfiedDependencyException: 
          Error creating bean with name 
         'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/myproject/config/DefaultDataSource.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mchange.v2.c3p0.ComboPooledDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.ExceptionInInitializerError</p>
  
  <h2>Code</h2>
  
  <pre><code> @Configuration
      public class DefaultDataSource {
      @Autowired
      DataBaseCreds dataBaseCreds;
      @Bean
      @Primary
      public ComboPooledDataSource dataSource() {
          ComboPooledDataSource dataSource = new ComboPooledDataSource();
          try {
              dataSource.setDriverClass(dataBaseCreds.getDB_DRIVER());
          } catch (PropertyVetoException e) {
          }
          dataSource.setJdbcUrl(dataBaseCreds.getDB_URL());
          dataSource.setUser(dataBaseCreds.getDB_USERNAME());
          dataSource.setPassword(dataBaseCreds.getDB_PASSWORD());
          dataSource.setMaxPoolSize(200);
          return dataSource;
      }
  
  }
  </code></pre>