Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何使用master代码打包编译成jar并部署k8s #2824

Closed
WilliamThh opened this issue Dec 6, 2019 · 3 comments
Closed

如何使用master代码打包编译成jar并部署k8s #2824

WilliamThh opened this issue Dec 6, 2019 · 3 comments

Comments

@WilliamThh
Copy link

我很高兴看到apollo portal支持基于path的反向代理 #2754,因为我们正需要此功能,但是这个功能还没有作为release版本发布,所以我们在尝试下载master的代码自己编译打包,但是打出来的包部署到k8s上会报以下错误

$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-12-06 17:08:17.148 INFO 45 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-12-06 17:08:17.233 WARN 45 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2019-12-06 17:08:17.292 INFO 45 --- [main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-06 17:08:17.322 ERROR 45 --- [main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

无法读到application-github.properties上的配置,关于application-github.properties配置,我们按照的是apollo-on-kubernetes中ConfigMap做配置的,并且我们使用apollo1.5.1release的版本的jar是可以运行的。

我的问题是:我们使用master上的源代码打包是可行的吗?如果可行,打包是需要什么操作,或者需要修改哪一处?

@WilliamThh
Copy link
Author

@nobodyiam

@nobodyiam
Copy link
Member

参考2.2.2 通过源码构建

@WilliamThh
Copy link
Author

问题解决,启动时添加-Dapollo_profile=github,auth -DprefixPath=/apollo -Dserver.servlet.context-path=/apollo参数

我是用Idea编译的,-Dapollo_profile=github,auth必须添加,否则会出现#2142 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.这样的报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants