java.lang.reflect.InvocationTargetException:null

时间:2018-04-05 19:35:38

标签: java spring-boot postgresql-9.4

我在球衣中使用了REST API项目并使用了hk2。现在,我将转换为spring boot项目,并将hersey端点和DI保持在hk2中。似乎它正在工作,除了以下错误。但我不知道为什么会发生以下错误。欢迎任何提示。我会按要求提供更多细节。我不知道错误是什么。

由于

错误:

java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.useContextualLobCreation(LobCreatorBuilderImpl.java:113) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.makeLobCreatorBuilder(LobCreatorBuilderImpl.java:54) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.<init>(JdbcEnvironmentImpl.java:271) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:114) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:242) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:858) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:885) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58) [hibernate-core-5.2.10.Final.jar:5.2.10.Final]
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) [javax.persistence-api-2.2.jar:2.2]
    at com.opentext.eventbus.EMFFactory.<init>(EMFFactory.java:38) [classes/:na]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.8.0_161]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [na:1.8.0_161]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_161]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [na:1.8.0_161]
    at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1375) [hk2-utils-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:272) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:366) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:70) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:90) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:135) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:83) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:71) [hk2-locator-2.5.0-b42.jar:na]
    at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97) [hk2-utils-2.5.0-b42.jar:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_161]
    at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154) [hk2-utils-2.5.0-b42.jar:na]
    at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199) [hk2-utils-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:122) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:698) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:212) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:229) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:70) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:90) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:135) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.glassfish.jersey.inject.hk2.RequestContext.findOrCreate(RequestContext.java:83) [jersey-hk2-2.26.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:698) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:212) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:229) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:70) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:698) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:212) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:229) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:70) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:685) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:212) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:229) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) [hk2-locator-2.5.0-b42.jar:na]
    at org.glassfish.jersey.inject.hk2.RequestContext.findOrCreate(RequestContext.java:83) [jersey-hk2-2.26.jar:na]
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:777) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:740) [hk2-locator-2.5.0-b42.jar:na]
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:710) [hk2-locator-2.5.0-b42.jar:na]
    at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getInstance(AbstractHk2InjectionManager.java:184) [jersey-hk2-2.26.jar:na]
    at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getInstance(ImmediateHk2InjectionManager.java:54) [jersey-hk2-2.26.jar:na]
    at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:129) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:284) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:75) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:110) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:113) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:113) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:113) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:113) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:93) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:62) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:269) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:316) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:298) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:268) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289) [jersey-common-2.26.jar:na]
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703) [jersey-server-2.26.jar:na]
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416) [jersey-container-servlet-core-2.26.jar:na]
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370) [jersey-container-servlet-core-2.26.jar:na]
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389) [jersey-container-servlet-core-2.26.jar:na]
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342) [jersey-container-servlet-core-2.26.jar:na]
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229) [jersey-container-servlet-core-2.26.jar:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.29.jar:8.5.29]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161]
Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
    at org.postgresql.Driver.notImplemented(Driver.java:669) ~[postgresql-42.1.4.jar:42.1.4]
    at org.postgresql.jdbc.PgConnection.createClob(PgConnection.java:1246) ~[postgresql-42.1.4.jar:42.1.4]
    ... 154 common frames omitted

persistence.xml的一部分

<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL94Dialect" />

的pom.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.1.RELEASE</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jersey</artifactId>
    </dependency>
   <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>5.2.10.Final</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-server</artifactId>
      <version>2.26</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet</artifactId>
      <version>2.26</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <version>2.26</version>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>42.1.4</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.bundles.repackaged</groupId>
      <artifactId>jersey-guava</artifactId>
      <version>2.26-b01</version>
    </dependency>

  </dependencies>

1 个答案:

答案 0 :(得分:14)

根问题

Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.

看起来像bug https://hibernate.atlassian.net/browse/HHH-12368

他们建议设置属性(我相信它是最好的解决方法):

  

解决方法是禁用hibernate来检测此功能   设置标志hibernate.jdbc.lob.non_contextual_creation = true

此处描述的其他解决方案:http://vkuzel.blogspot.com.cy/2016/03/spring-boot-jpa-hibernate-atomikos.html

  

禁用此未记录参数的功能检测。有关更多详细信息,请查看org.hibernate.engine.jdbc.internal.JdbcServiceImpl.configure方法。   spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false

所以你也可以尝试添加到你的Spring启动属性文件

spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false