无法在一台特定服务器上部署战争

Posted

技术标签:

【中文标题】无法在一台特定服务器上部署战争【英文标题】:Unable to deploy war on one particular server 【发布时间】:2017-10-18 08:39:01 【问题描述】:

我有一个 spring-boot 项目。我创建了一个 war 文件,我将它部署在 2 个基于 linux 的 tomcat 服务器和 1 个基于 windows 的 tomcat 服务器上,该文件成功部署在 1 个基于 linux 的服务器和基于 windows 的服务器上,但是在 1 个基于 linux 的服务器上失败

尝试改变 pom 中的依赖

下面是当前使用的 pom.xml 中的 sn-p

 <dependency>
    <groupId>com.github.noraui</groupId>
    <artifactId>ojdbc7</artifactId>
    <version>12.1.0.2</version>
 </dependency>

以前我使用的是以下范围和系统路径

 <groupId>com.oracle</groupId>
 <artifactId>ojdbc</artifactId>
 <version>7</version>
 <scope>system</scope>
 <systemPath>$project.basedir/lib/oracle/ojdbc/7/ojdbc-7.jar</systemPath>

我仍然收到 java.sql.SQLException: No suitable driver found for jdbc:oracle:thin on 1 个特定的 linux 服务器

请提供建议,如果有的话,从昨天开始就卡住了

stacktrace 的代码片段如下

2017-10-18 15:01:29.862 DEBUG 34036 --- [kground-preinit] org.jboss.logging                        : Logging Provider: org.jboss.logging.Slf4jLoggerProvider found via system property
15:01:29.862 [DEBUG] o.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider found via system property
2017-10-18 15:01:42.347  INFO 34036 --- [ost-startStop-1] c.h.instance.DefaultAddressPicker        : [LOCAL] [dev] [3.7] Picked [127.0.0.1]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
15:01:42.347 [INFO ] c.h.i.DefaultAddressPicker - [LOCAL] [dev] [3.7] Picked [127.0.0.1]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
2017-10-18 15:01:42.402  INFO 34036 --- [ost-startStop-1] com.hazelcast.system                     : [127.0.0.1]:5701 [dev] [3.7] Hazelcast 3.7 (20160817 - 1302600) starting at [127.0.0.1]:5701
15:01:42.402 [INFO ] c.h.system - [127.0.0.1]:5701 [dev] [3.7] Hazelcast 3.7 (20160817 - 1302600) starting at [127.0.0.1]:5701
2017-10-18 15:01:42.403  INFO 34036 --- [ost-startStop-1] com.hazelcast.system                     : [127.0.0.1]:5701 [dev] [3.7] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
15:01:42.403 [INFO ] c.h.system - [127.0.0.1]:5701 [dev] [3.7] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2017-10-18 15:01:42.404  INFO 34036 --- [ost-startStop-1] com.hazelcast.system                     : [127.0.0.1]:5701 [dev] [3.7] Configured Hazelcast Serialization version : 1
15:01:42.404 [INFO ] c.h.system - [127.0.0.1]:5701 [dev] [3.7] Configured Hazelcast Serialization version : 1
2017-10-18 15:01:43.217  INFO 34036 --- [ost-startStop-1] c.h.s.i.o.impl.BackpressureRegulator     : [127.0.0.1]:5701 [dev] [3.7] Backpressure is disabled
15:01:43.217 [INFO ] c.h.s.i.o.i.BackpressureRegulator - [127.0.0.1]:5701 [dev] [3.7] Backpressure is disabled
2017-10-18 15:01:45.730 DEBUG 34036 --- [ost-startStop-1] c.h.internal.cluster.ClusterService      : [127.0.0.1]:5701 [dev] [3.7] Updating members [Member [127.0.0.1]:5701 - 9daa0612-f3dc-4eaa-9b29-06e4b11c225a this]
15:01:45.730 [DEBUG] c.h.i.c.ClusterService - [127.0.0.1]:5701 [dev] [3.7] Updating members [Member [127.0.0.1]:5701 - 9daa0612-f3dc-4eaa-9b29-06e4b11c225a this]
2017-10-18 15:01:45.731 DEBUG 34036 --- [ost-startStop-1] c.h.i.p.InternalPartitionService         : [127.0.0.1]:5701 [dev] [3.7] Adding Member [127.0.0.1]:5701 - 9daa0612-f3dc-4eaa-9b29-06e4b11c225a this
15:01:45.731 [DEBUG] c.h.i.p.InternalPartitionService - [127.0.0.1]:5701 [dev] [3.7] Adding Member [127.0.0.1]:5701 - 9daa0612-f3dc-4eaa-9b29-06e4b11c225a this
2017-10-18 15:01:45.815  INFO 34036 --- [ost-startStop-1] com.hazelcast.core.LifecycleService      : [127.0.0.1]:5701 [dev] [3.7] [127.0.0.1]:5701 is STARTING
15:01:45.815 [INFO ] c.h.c.LifecycleService - [127.0.0.1]:5701 [dev] [3.7] [127.0.0.1]:5701 is STARTING
2017-10-18 15:01:46.387  INFO 34036 --- [ost-startStop-1] c.h.s.i.o.impl.OperationExecutorImpl     : [127.0.0.1]:5701 [dev] [3.7] Starting 4 partition threads
15:01:46.387 [INFO ] c.h.s.i.o.i.OperationExecutorImpl - [127.0.0.1]:5701 [dev] [3.7] Starting 4 partition threads
2017-10-18 15:01:46.391  INFO 34036 --- [ost-startStop-1] c.h.s.i.o.impl.OperationExecutorImpl     : [127.0.0.1]:5701 [dev] [3.7] Starting 3 generic threads (1 dedicated for priority tasks)
15:01:46.391 [INFO ] c.h.s.i.o.i.OperationExecutorImpl - [127.0.0.1]:5701 [dev] [3.7] Starting 3 generic threads (1 dedicated for priority tasks)
2017-10-18 15:01:46.407  INFO 34036 --- [ost-startStop-1] c.h.n.t.n.NonBlockingIOThreadingModel    : [127.0.0.1]:5701 [dev] [3.7] TcpIpConnectionManager configured with Non Blocking IO-threading model: 3 input threads and 3 output threads
15:01:46.407 [INFO ] c.h.n.t.n.NonBlockingIOThreadingModel - [127.0.0.1]:5701 [dev] [3.7] TcpIpConnectionManager configured with Non Blocking IO-threading model: 3 input threads and 3 output threads
2017-10-18 15:01:46.410 DEBUG 34036 --- [ost-startStop-1] c.h.n.t.n.NonBlockingIOThreadingModel    : [127.0.0.1]:5701 [dev] [3.7] IO threads selector mode is SELECT
15:01:46.410 [DEBUG] c.h.n.t.n.NonBlockingIOThreadingModel - [127.0.0.1]:5701 [dev] [3.7] IO threads selector mode is SELECT
2017-10-18 15:01:46.438  WARN 34036 --- [ost-startStop-1] com.hazelcast.instance.Node              : [127.0.0.1]:5701 [dev] [3.7] No join method is enabled! Starting standalone.
15:01:46.438 [WARN ] c.h.i.Node - [127.0.0.1]:5701 [dev] [3.7] No join method is enabled! Starting standalone.
2017-10-18 15:01:46.569  INFO 34036 --- [ost-startStop-1] com.hazelcast.core.LifecycleService      : [127.0.0.1]:5701 [dev] [3.7] [127.0.0.1]:5701 is STARTED
15:01:46.569 [INFO ] c.h.c.LifecycleService - [127.0.0.1]:5701 [dev] [3.7] [127.0.0.1]:5701 is STARTED
profile:dev
property file lookup
2017-10-18 15:01:50.998  WARN 34036 --- [ost-startStop-1] o.a.tomcat.jdbc.pool.PooledConnection    : Not loading a JDBC driver as driverClassName property is null.
15:01:50.998 [WARN ] o.a.t.j.p.PooledConnection - Not loading a JDBC driver as driverClassName property is null.
2017-10-18 15:01:51.025 ERROR 34036 --- [ost-startStop-1] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.

java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@mumchora65:1821:STAGE
    at java.sql.DriverManager.getConnection(DriverManager.java:689)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:308)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:718)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:650)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:257)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:231)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:240)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:846)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:873)
    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:362)
    at com.crisil.quantix.config.DatabaseConfiguration.entityManagerFactory(DatabaseConfiguration.java:109)
    at com.crisil.quantix.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$61a361cf.CGLIB$entityManagerFactory$5(<generated>)
    at com.crisil.quantix.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$61a361cf$$FastClassBySpringCGLIB$$5775aed4.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at com.crisil.quantix.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$61a361cf.entityManagerFactory(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1022)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:234)
    at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:215)
    at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:91)
    at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:79)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getServletContextInitializerBeans(EmbeddedWebApplicationContext.java:241)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:228)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:89)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:213)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:168)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
    at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
    at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

15:01:51.025 [ERROR] o.a.t.j.p.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@mumchora65:1821:STAGE
    at java.sql.DriverManager.getConnection(DriverManager.java:689)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:308)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:718)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:650)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:257)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:231)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:240)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:846)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:873)
    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)

【问题讨论】:

也共享堆栈跟踪。看起来您的战争要么没有所需的罐子,要么可能存在冲突。您可能在 tomcat lib 文件夹中也有 ojdbc jar。看看这个问题:***.com/questions/12103369/… 我是com.github.noraui的共同创建者,这个jar文件已被弃用,请使用这个示例:github.com/sgrillon14/MavenSampleOracleJdbc 【参考方案1】:

检查此 jar /lib/oracle/ojdbc/7/ojdbc-7.jar 是否也在同一路径中的故障服务器 tomcat.home/lib 中找到。

如果没有,就加进去,重启tomcat看看是否部署ok。

你也可以改变依赖范围来编译,如果jar在其他服务器中找到,这不是一个好主意。

【讨论】:

【参考方案2】:

如前所述,它是一个 spring-boot 项目。我在一台服务器上使用开发配置文件运行战争,并在另一台服务器上使用配置文件。

在 application.yml 中配置驱动器后,根本原因是在服务器 1 上未正确配置 JDBC 驱动器。成功了

【讨论】:

【参考方案3】:

我是 com.github.noraui 的共同创建者,此 jar 文件已弃用,请使用此示例:github.com/sgrillon14/MavenSampleOracleJdbc

【讨论】:

以上是关于无法在一台特定服务器上部署战争的主要内容,如果未能解决你的问题,请参考以下文章

如何在一台服务器上部署 nodejs api 和 vuejs 应用程序

一台服务器上部署两个tomcat

LAMP实战案例: 在一台服务器上实现 wordpress 应用部署

Dynamic CRM2016在一台本地服务器安装部署

使用 Jenkins 将战争文件部署到 Tomcat 的推荐方法?

当角靴和弹簧靴捆绑在一次战争中并部署在tomcat上时,是否需要proxy.conf.json文件