I’m currently trying to get the webAPI jap branch to run, but having problems.
To start, i created a local profile in my settings.xml that has all the same properties as the postgres section in the POM.xml, but with the sql server specific settings.
Since the postgres section included a dependency on the jdbc driver, I registered in my .m2 repo a mssql jdbc 4 driver. (I’d like to again BEG that we do not include jdbc drivers in our POMs. It should be left to the target environment to decide which JDBC drivers are available to the JVM. We do not want to be in the business of keeping up with JDBC driver versions and have to deal with the multitude of problems that comes with maintaining a 3rd party library release).
I think I have everything set up, but i get this error on startup:
2015-02-20 11:22:32.950 WARN localhost-startStop-1 org.hibernate.engine.jdbc.internal.JdbcServicesImpl - - HHH000342: Could not obtain connection to query metadata : No suitable driver found for jdbc:sqlserver://rndusrdhit09
2015-02-20 11:22:32.953 WARN localhost-startStop-1 org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CDMResultsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.transaction.support.TransactionTemplate org.ohdsi.webapi.service.AbstractDaoService.transactionTemplate; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'transactionTemplate' defined in class path resource [org/ohdsi/webapi/DataAccessConfig.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.transaction.PlatformTransactionManager]: : Error creating bean with name 'jpaTransactionManager' defined in class path resource [org/ohdsi/webapi/DataAccessConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.transaction.PlatformTransactionManager]: Factory method 'jpaTransactionManager' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/ohdsi/webapi/DataAccessConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaTransactionManager' defined in class path resource [org/ohdsi/webapi/DataAccessConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.transaction.PlatformTransactionManager]: Factory method 'jpaTransactionManager' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/ohdsi/webapi/DataAccessConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
So at the root of it it seems it can’t find my driver. I checked inside the generated war file, and the /lib folder does contain sqljdbc4-4.0.jar, so I believe the file is available to the class loader. I looked in the jar, and the com.microsoft.sqlserver.jdbc.SQLServerDriver.class file does exist.
So, I’m stuck. Does anyone have any suggestions?