Commit 5acf090 1 parent 6af3d75 commit 5acf090 Copy full SHA for 5acf090
File tree 4 files changed +17
-11
lines changed
java/io/github/yangziwen/logreplay
4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 17
17
18
18
- ** 后端框架:** &ensp ;&ensp ; Spring Boot, Spring Framework, Shiro
19
19
20
- - ** 数据库: ** & ensp ;& ensp ; &ensp ;&ensp ; MySQL
20
+ - ** 数 & nbsp ;& nbsp ; 据 & nbsp ;& nbsp ; 库: ** &ensp ;&ensp ; MySQL
21
21
22
22
### 开发环境运行方法
23
23
@@ -46,6 +46,4 @@ set autocommit=1;
46
46
### 生产环境运行方法
47
47
&ensp ;&ensp ; ** 1.打包项目** ` mvn clean package `
48
48
49
- &ensp ;&ensp ; ** 2.运行项目** ` java -jar -Dspring.config.location=${your_application_properties_file} logreplay.war `
50
-
51
- &ensp ;&ensp ; 注意,虽然项目的打包产出是war包,但是只能基于内嵌tomcat直接运行,无法部署到独立的tomcat中
49
+ &ensp ;&ensp ; ** 2.运行项目** ` java -jar -Dspring.config.location=${your_application_properties_file} logreplay.war ` 或将war包部署到独立的tomcat(8.5)中
Original file line number Diff line number Diff line change 3
3
import org .springframework .beans .factory .annotation .Autowired ;
4
4
import org .springframework .boot .SpringApplication ;
5
5
import org .springframework .boot .autoconfigure .SpringBootApplication ;
6
+ import org .springframework .boot .builder .SpringApplicationBuilder ;
6
7
import org .springframework .boot .system .ApplicationPidFileWriter ;
7
8
import org .springframework .boot .web .servlet .ServletComponentScan ;
9
+ import org .springframework .boot .web .support .SpringBootServletInitializer ;
8
10
import org .springframework .context .annotation .Bean ;
9
11
import org .springframework .scheduling .concurrent .ThreadPoolTaskExecutor ;
10
12
import org .springframework .transaction .annotation .EnableTransactionManagement ;
16
18
@ EnableTransactionManagement
17
19
@ EnableWebSocketMessageBroker
18
20
@ SpringBootApplication
19
- public class LogreplayApplication {
21
+ public class LogreplayApplication extends SpringBootServletInitializer {
20
22
21
23
@ Bean ("executor" )
22
24
public ThreadPoolTaskExecutor executor () {
@@ -33,6 +35,11 @@ public AsyncEventBus eventBus(@Autowired ThreadPoolTaskExecutor executor) {
33
35
return new AsyncEventBus (executor );
34
36
}
35
37
38
+ @ Override
39
+ protected SpringApplicationBuilder configure (SpringApplicationBuilder application ) {
40
+ return application .sources (LogreplayApplication .class );
41
+ }
42
+
36
43
public static void main (String [] args ) {
37
44
System .setProperty ("tomcat.util.http.parser.HttpParser.requestTargetAllow" ,"|{}" );
38
45
SpringApplication application = new SpringApplication (LogreplayApplication .class );
Original file line number Diff line number Diff line change @@ -17,10 +17,11 @@ public class DataSourceConfig {
17
17
18
18
@ Primary
19
19
@ Bean ("dataSource" )
20
- @ ConfigurationProperties ("hiraki .datasource" )
20
+ @ ConfigurationProperties ("spring .datasource.hikari " )
21
21
public HikariDataSource dataSource () {
22
22
return (HikariDataSource ) DataSourceBuilder
23
23
.create ()
24
+ .driverClassName ("com.mysql.jdbc.Driver" )
24
25
.type (HikariDataSource .class )
25
26
.build ();
26
27
}
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ spring.main.banner-mode=off
9
9
10
10
spring.pid.file =logreplay.pid
11
11
12
- hiraki .datasource.jdbc-url =jdbc:mysql://localhost:3306/logreplay?useUnicode=true&characterEncoding=UTF-8&useSSL=false
13
- hiraki .datasource.username =mobile
14
- hiraki .datasource.password =mobile
15
- hiraki .datasource.minimum-idle =10
16
- hiraki .datasource.maximum-pool-size =100
12
+ spring .datasource.hikari .jdbc-url =jdbc:mysql://localhost:3306/logreplay?useUnicode=true&characterEncoding=UTF-8&useSSL=false
13
+ spring .datasource.hikari .username =mobile
14
+ spring .datasource.hikari .password =mobile
15
+ spring .datasource.hikari .minimum-idle =10
16
+ spring .datasource.hikari .maximum-pool-size =100
17
17
18
18
shiro.remember.me.cipher.key =2itfW92XazYRi5ltW0M2yA==
19
19
You can’t perform that action at this time.
0 commit comments