Spring Boot JPA:无法解压缩结果集错误

时间:2016-08-03 17:41:55

标签: java spring hibernate jpa spring-data-jpa

我试图简单地将一个对象保存到数据库中,然后检索它以检查它是否有效。它似乎连接到数据库,但它没有找到表。

我附上了以下所有相关文件。

这是我的数据对象:

package dataObjects;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="LoadMethod")
public class LoadMethodDO {

    private String mediaId;
    private String activeInd;
    private String loadMethod;
    private String formatMapCd;
    private String detailTransactionReportInd;
    private String accountManaged;

    public LoadMethodDO(){}

    public LoadMethodDO(String mediaId, String loadMethod){
        this.mediaId = mediaId;
        this.loadMethod = loadMethod;
    }
    @Id
    @Column(name="Media_ID", length = 7)
    public String getMediaId() {
        return mediaId;
    }
    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }
    @Column(name="ActInd")
    public String getActiveInd() {
        return activeInd;
    }
    public void setActiveInd(String activeInd) {
        this.activeInd = activeInd;
    }
    @Column(name="LoadMthdCd")
    public String getLoadMethod() {
        return loadMethod;
    }
    public void setLoadMethod(String loadMethod) {
        this.loadMethod = loadMethod;
    }
    @Column(name="FormatMapCd")
    public String getFormatMapCd() {
        return formatMapCd;
    }
    public void setFormatMapCd(String formatter) {
        this.formatMapCd = formatter;
    }
    @Column(name="DtlTransRcdInd")
    public String getDetailTransactionReportInd() {
        return detailTransactionReportInd;
    }
    public void setDetailTransactionReportInd(String detailTransactionReportInd) {
        this.detailTransactionReportInd = detailTransactionReportInd;
    }
    @Column(name="AcctMngdInd")
    public String getAccountManaged() {
        return accountManaged;
    }
    public void setAccountManaged(String accountManaged) {
        this.accountManaged = accountManaged;
    }
}

这是我的存储库文件:

package repositories;

import org.springframework.data.repository.CrudRepository;
import dataObjects.LoadMethodDO;

public interface LoadMethodRepository extends CrudRepository<LoadMethodDO, String>{

}

这是应该保留对象的应用程序文件:

package testApplication;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import dataObjects.LoadMethodDO;
import repositories.LoadMethodRepository;

@SpringBootApplication
@EnableJpaRepositories(basePackageClasses = LoadMethodRepository.class)
@EntityScan(basePackageClasses = LoadMethodDO.class)
@EnableCaching
public class Application {

    private static final Logger log = LoggerFactory.getLogger(Application.class);

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public CommandLineRunner demo(LoadMethodRepository repository) {
        return (args) -> {
            // save a couple of customers
            repository.save(new LoadMethodDO("1234567", "1"));
        };
    }
}

这是我的属性文件:

#Database Configuration
#db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#db.url=jdbc:sqlserver://schqvsqlaod:1433;database=dbMOBClientTemp
#db.username=LOADdev
#db.password=lmtdev02

#Hibernate Configuration
hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
#hibernate.hbm2ddl.auto=create-drop
hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.default_schema=dbo

hibernate.packagesToScan=src.repositories.LMClientRepository.java

spring.jpa.generate-ddl=false
spring.datasource.username=LOADdev
spring.datasource.password=lmtdev01
spring.datasource.url=jdbc:sqlserver://schqvsqlaod:1433;database=dbMOBClientTemp;integratedSecurity=false;
spring.datasource.testOnBorrow=true
#spring.datasource.validationQuery=SELECT 1
spring.jpa.database=dbMOBClientTemp
spring.jpa.show-sql=true
spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
#spring.jpa.hibernate.ddl-auto=none
#spring.jpa.hibernate.ddl-auto=none 
#spring.jpa.properties.hibernate.hbm2ddl.auto=none

这是我的错误代码:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.6.RELEASE)

2016-08-03 10:27:03.896  INFO 49376 --- [           main] testApplication.Application              : Starting Application on LR90KLWJY with PID 49376 (C:\Users\vincni\git\consumer_load_method\bin started by vincni in C:\Users\vincni\git\consumer_load_method)
2016-08-03 10:27:03.899  INFO 49376 --- [           main] testApplication.Application              : No active profile set, falling back to default profiles: default
2016-08-03 10:27:03.963  INFO 49376 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@15bfd87: startup date [Wed Aug 03 10:27:03 PDT 2016]; root of context hierarchy
2016-08-03 10:27:05.905  INFO 49376 --- [           main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2016-08-03 10:27:05.928  INFO 49376 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2016-08-03 10:27:05.990  INFO 49376 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {4.3.11.Final}
2016-08-03 10:27:05.999  INFO 49376 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2016-08-03 10:27:06.001  INFO 49376 --- [           main] org.hibernate.cfg.Environment            : HHH000021: Bytecode provider name : javassist
2016-08-03 10:27:06.166  INFO 49376 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
2016-08-03 10:27:06.259  WARN 49376 --- [           main] o.h.e.j.d.i.StandardDialectResolver      : HHH000385: Unknown Microsoft SQL Server major version [12] using SQL Server 2000 dialect
2016-08-03 10:27:06.267  INFO 49376 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
2016-08-03 10:27:06.412  INFO 49376 --- [           main] o.h.h.i.ast.ASTQueryTranslatorFactory    : HHH000397: Using ASTQueryTranslatorFactory
2016-08-03 10:27:07.149  INFO 49376 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
Hibernate: select loadmethod0_.media_id as media_id1_0_0_, loadmethod0_.account_managed as account_2_0_0_, loadmethod0_.active_ind as active_i3_0_0_, loadmethod0_.detail_transaction_report_ind as detail_t4_0_0_, loadmethod0_.format_map_cd as format_m5_0_0_, loadmethod0_.load_method as load_met6_0_0_ from load_method loadmethod0_ where loadmethod0_.media_id=?
2016-08-03 10:27:07.228  WARN 49376 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 208, SQLState: S0002
2016-08-03 10:27:07.228 ERROR 49376 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : Invalid object name 'load_method'.
2016-08-03 10:27:07.229  INFO 49376 --- [           main] o.h.e.internal.DefaultLoadEventListener  : HHH000327: Error performing load command : org.hibernate.exception.SQLGrammarException: could not extract ResultSet
2016-08-03 10:27:07.244 ERROR 49376 --- [           main] o.s.boot.SpringApplication               : Application startup failed

java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:803) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:784) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:771) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    at testApplication.Application.main(Application.java:25) [bin/:na]
Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:242) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:225) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:436) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:131) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at com.sun.proxy.$Proxy55.save(Unknown Source) ~[na:na]
    at testApplication.Application.lambda$0(Application.java:32) [bin/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
    ... 6 common frames omitted
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.getResultSet(Loader.java:2066) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:910) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:325) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2149) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:78) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:68) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4126) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:503) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:468) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:213) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:275) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1106) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:176) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2587) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl.get(SessionImpl.java:996) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:306) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:186) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:85) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:876) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:858) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:863) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    at org.hibernate.jpa.spi.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:1196) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_91]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_91]
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:294) ~[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at com.sun.proxy.$Proxy53.merge(Unknown Source) ~[na:na]
    at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:442) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_91]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_91]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:483) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:468) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:440) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.2.7.RELEASE.jar:4.2.7.RELEASE]
    ... 15 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'load_method'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) ~[sqljdbc4-4.0.jar:na]
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:285) ~[sqljdbc4-4.0.jar:na]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:82) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    ... 63 common frames omitted

2016-08-03 10:27:07.250  INFO 49376 --- [           main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/C:/Users/vincni/git/consumer_load_method/bin/, file:/C:/apps/Ivy/cache/org.apache.camel/camel-ftp/jars/camel-ftp-2.16.1.jar, file:/C:/apps/Ivy/cache/org.apache.camel/camel-core/bundles/camel-core-2.16.1.jar, file:/C:/apps/Ivy/cache/com.sun.xml.bind/jaxb-core/jars/jaxb-core-2.2.11.jar, file:/C:/apps/Ivy/cache/com.sun.xml.bind/jaxb-impl/jars/jaxb-impl-2.2.11.jar, file:/C:/apps/Ivy/cache/com.jcraft/jsch/jars/jsch-0.1.53.jar, file:/C:/apps/Ivy/cache/commons-net/commons-net/jars/commons-net-3.3.jar, file:/C:/apps/Ivy/cache/com.zaxxer/HikariCP/jars/HikariCP-2.4.7.jar, file:/C:/apps/Ivy/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.21.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-data-jpa/jars/spring-boot-starter-data-jpa-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter/jars/spring-boot-starter-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot/jars/spring-boot-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-core/jars/spring-core-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-context/jars/spring-context-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-aop/jars/spring-aop-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/aopalliance/aopalliance/jars/aopalliance-1.0.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-beans/jars/spring-beans-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-expression/jars/spring-expression-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-autoconfigure/jars/spring-boot-autoconfigure-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-logging/jars/spring-boot-starter-logging-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.1.7.jar, file:/C:/apps/Ivy/cache/ch.qos.logback/logback-core/jars/logback-core-1.1.7.jar, file:/C:/apps/Ivy/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar, file:/C:/apps/Ivy/cache/org.slf4j/jul-to-slf4j/jars/jul-to-slf4j-1.7.21.jar, file:/C:/apps/Ivy/cache/org.slf4j/log4j-over-slf4j/jars/log4j-over-slf4j-1.7.21.jar, file:/C:/apps/Ivy/cache/org.yaml/snakeyaml/bundles/snakeyaml-1.16.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-aop/jars/spring-boot-starter-aop-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.9.jar, file:/C:/apps/Ivy/cache/org.springframework.boot/spring-boot-starter-jdbc/jars/spring-boot-starter-jdbc-1.3.6.RELEASE.jar, file:/C:/apps/Ivy/cache/org.apache.tomcat/tomcat-jdbc/jars/tomcat-jdbc-8.0.36.jar, file:/C:/apps/Ivy/cache/org.apache.tomcat/tomcat-juli/jars/tomcat-juli-8.0.36.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-jdbc/jars/spring-jdbc-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-tx/jars/spring-tx-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.hibernate/hibernate-entitymanager/jars/hibernate-entitymanager-4.3.11.Final.jar, file:/C:/apps/Ivy/cache/org.jboss.logging/jboss-logging/jars/jboss-logging-3.3.0.Final.jar, file:/C:/apps/Ivy/cache/org.jboss.logging/jboss-logging-annotations/jars/jboss-logging-annotations-1.2.0.Beta1.jar, file:/C:/apps/Ivy/cache/org.hibernate/hibernate-core/jars/hibernate-core-4.3.11.Final.jar, file:/C:/apps/Ivy/cache/dom4j/dom4j/jars/dom4j-1.6.1.jar, file:/C:/apps/Ivy/cache/xml-apis/xml-apis/jars/xml-apis-1.0.b2.jar, file:/C:/apps/Ivy/cache/org.hibernate.common/hibernate-commons-annotations/jars/hibernate-commons-annotations-4.0.5.Final.jar, file:/C:/apps/Ivy/cache/org.hibernate.javax.persistence/hibernate-jpa-2.1-api/jars/hibernate-jpa-2.1-api-1.0.0.Final.jar, file:/C:/apps/Ivy/cache/org.javassist/javassist/bundles/javassist-3.18.1-GA.jar, file:/C:/apps/Ivy/cache/antlr/antlr/jars/antlr-2.7.7.jar, file:/C:/apps/Ivy/cache/org.jboss/jandex/jars/jandex-1.1.0.Final.jar, file:/C:/apps/Ivy/cache/javax.transaction/javax.transaction-api/jars/javax.transaction-api-1.2.jar, file:/C:/apps/Ivy/cache/org.springframework.data/spring-data-jpa/jars/spring-data-jpa-1.9.4.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework.data/spring-data-commons/jars/spring-data-commons-1.11.4.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-orm/jars/spring-orm-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.springframework/spring-aspects/jars/spring-aspects-4.2.7.RELEASE.jar, file:/C:/apps/Ivy/cache/org.apache.camel/camel-jpa/jars/camel-jpa-2.10.0.jar, file:/C:/apps/Ivy/cache/org.apache.camel/camel-spring/bundles/camel-spring-2.10.0.jar, file:/C:/apps/Ivy/cache/org.apache.poi/poi/jars/poi-3.10.1.jar, file:/C:/apps/Ivy/cache/commons-codec/commons-codec/jars/commons-codec-1.5.jar, file:/C:/apps/Ivy/cache/org.apache.poi/poi-ooxml/jars/poi-ooxml-3.10.1.jar, file:/C:/apps/Ivy/cache/org.apache.poi/poi-ooxml-schemas/jars/poi-ooxml-schemas-3.10.1.jar, file:/C:/apps/Ivy/cache/org.apache.xmlbeans/xmlbeans/jars/xmlbeans-2.6.0.jar, file:/C:/apps/Ivy/cache/stax/stax-api/jars/stax-api-1.0.1.jar, file:/C:/apps/Ivy/cache/com.microsoft.sqlserver/sqljdbc4/jars/sqljdbc4-4.0.jar, file:/C:/ExternalJARS/ojdbc7.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/eclipselink.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/jpa/javax.persistence_2.1.0.v201304241213.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/jpa/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/jpa/org.eclipse.persistence.jpars_2.5.2.v20140319-9ad6abd.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/com.sun.tools.xjc_2.2.0.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/com.sun.xml.bind_2.2.0.v201004141950.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.activation_1.1.0.v201108011116.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.mail_1.4.0.v201005080615.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.xml.bind_2.2.0.v201105210648.jar, file:/C:/Users/vincni/workspace/workspace_lmt/libraries/EclipseLink%202.5.2/eclipselink/jlib/moxy/javax.xml.stream_1.0.1.v201004272200.jar]
2016-08-03 10:27:07.250  INFO 49376 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report enable debug logging (start with --debug)


2016-08-03 10:27:07.251  INFO 49376 --- [           main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@15bfd87: startup date [Wed Aug 03 10:27:03 PDT 2016]; root of context hierarchy
2016-08-03 10:27:07.256  INFO 49376 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2016-08-03 10:27:07.257  INFO 49376 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

2 个答案:

答案 0 :(得分:2)

您确定数据库中存在'load_method'表吗?您已注释掉架构创建,因此可能没有这样的表,或者您使用错误的名称创建了它,例如'LoadMethod'但是

hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy

将其更改为“load_method”。

您是否尝试过执行查询:

select loadmethod0_.media_id as media_id1_0_0_,
 loadmethod0_.account_managed as account_2_0_0_,
 loadmethod0_.active_ind as active_i3_0_0_,
 loadmethod0_.detail_transaction_report_ind as detail_t4_0_0_, 
 loadmethod0_.format_map_cd as format_m5_0_0_, 
 loadmethod0_.load_method as load_met6_0_0_ from load_method 
 loadmethod0_ where loadmethod0_.media_id=?

答案 1 :(得分:0)

检查application.properties/application.yml文件中是否使用了正确的SQL方言。

就我而言,我使用的是yml application.yml文件。

spring:
  jpa.database-platform: org.hibernate.dialect.MariaDB53Dialect