質問編集履歴
6
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,7 +72,9 @@
|
|
72
72
|
|
73
73
|
```
|
74
74
|
|
75
|
-
|
75
|
+
springboot
|
76
|
+
|
77
|
+
```
|
76
78
|
|
77
79
|
2018-06-27 04:40:03.457 INFO 3177 --- [ main] c.t.springboot.LineEventApplication : Starting LineEventApplication v0.0.1-SNAPSHOT on ip-155-155-20-206 with PID 3177 (/home/ec2-user/botapp/MyBootApp-0.0.1-SNAPSHOT.jar started by root in /home/ec2-user/botapp)
|
78
80
|
|
@@ -132,7 +134,9 @@
|
|
132
134
|
|
133
135
|
```
|
134
136
|
|
135
|
-
|
137
|
+
webhookの接続確認を押した後の/var/log/messages
|
138
|
+
|
139
|
+
```
|
136
140
|
|
137
141
|
Jun 27 04:26:09 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 113460ms.
|
138
142
|
|
5
ログの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,7 +20,165 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+

|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
###ソースコード
|
28
|
+
|
29
|
+
```java
|
30
|
+
|
31
|
+
@SpringBootApplication
|
32
|
+
|
33
|
+
@LineMessageHandler
|
34
|
+
|
35
|
+
public class LineEventApplication {
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
public static void main(String[] args) {
|
40
|
+
|
41
|
+
SpringApplication.run(LineEventApplication.class, args);
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
@EventMapping
|
48
|
+
|
49
|
+
public TextMessage handleTextMessageEvent(MessageEvent<TextMessageContent> event) {
|
50
|
+
|
51
|
+
System.out.println("event: " + event);
|
52
|
+
|
53
|
+
System.out.println("LINEID: " + event.getSource().getUserId());
|
54
|
+
|
55
|
+
System.out.println("text: " + event.getMessage().getText());
|
56
|
+
|
57
|
+
return new TextMessage(event.getMessage().getText());
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
@EventMapping
|
64
|
+
|
65
|
+
public void handleDefaultMessageEvent(Event event) {
|
66
|
+
|
67
|
+
System.out.println("event: " + event);
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
```
|
74
|
+
|
75
|
+
```springboot
|
76
|
+
|
77
|
+
2018-06-27 04:40:03.457 INFO 3177 --- [ main] c.t.springboot.LineEventApplication : Starting LineEventApplication v0.0.1-SNAPSHOT on ip-155-155-20-206 with PID 3177 (/home/ec2-user/botapp/MyBootApp-0.0.1-SNAPSHOT.jar started by root in /home/ec2-user/botapp)
|
78
|
+
|
79
|
+
2018-06-27 04:40:03.474 INFO 3177 --- [ main] c.t.springboot.LineEventApplication : No active profile set, falling back to default profiles: default
|
80
|
+
|
81
|
+
2018-06-27 04:40:03.687 INFO 3177 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3c679bde: startup date [Wed Jun 27 04:40:03 UTC 2018]; root of context hierarchy
|
82
|
+
|
83
|
+
2018-06-27 04:40:06.933 INFO 3177 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 443 (https)
|
84
|
+
|
85
|
+
2018-06-27 04:40:07.000 INFO 3177 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
|
86
|
+
|
87
|
+
2018-06-27 04:40:07.001 INFO 3177 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31
|
88
|
+
|
89
|
+
2018-06-27 04:40:07.028 INFO 3177 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
|
90
|
+
|
91
|
+
2018-06-27 04:40:07.184 INFO 3177 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
|
92
|
+
|
93
|
+
2018-06-27 04:40:07.189 INFO 3177 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3527 ms
|
94
|
+
|
95
|
+
2018-06-27 04:40:07.467 INFO 3177 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
|
96
|
+
|
97
|
+
2018-06-27 04:40:07.471 INFO 3177 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
|
98
|
+
|
99
|
+
2018-06-27 04:40:07.475 INFO 3177 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
|
100
|
+
|
101
|
+
2018-06-27 04:40:07.475 INFO 3177 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
|
102
|
+
|
103
|
+
2018-06-27 04:40:07.475 INFO 3177 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
|
104
|
+
|
105
|
+
2018-06-27 04:40:07.755 INFO 3177 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
|
106
|
+
|
107
|
+
2018-06-27 04:40:08.843 INFO 3177 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3c679bde: startup date [Wed Jun 27 04:40:03 UTC 2018]; root of context hierarchy
|
108
|
+
|
109
|
+
2018-06-27 04:40:08.988 INFO 3177 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/hello]}" onto public java.lang.String com.taguchi.springboot.RequestController.index()
|
110
|
+
|
111
|
+
2018-06-27 04:40:08.999 INFO 3177 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
|
112
|
+
|
113
|
+
2018-06-27 04:40:09.007 INFO 3177 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
|
114
|
+
|
115
|
+
2018-06-27 04:40:09.015 INFO 3177 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/callback],methods=[POST]}" onto public void com.linecorp.bot.spring.boot.support.LineMessageHandlerSupport.callback(java.util.List<com.linecorp.bot.model.event.Event>)
|
116
|
+
|
117
|
+
2018-06-27 04:40:09.073 INFO 3177 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
|
118
|
+
|
119
|
+
2018-06-27 04:40:09.073 INFO 3177 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
|
120
|
+
|
121
|
+
2018-06-27 04:40:10.124 INFO 3177 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
|
122
|
+
|
123
|
+
2018-06-27 04:40:10.168 INFO 3177 --- [ main] c.l.b.s.b.s.LineMessageHandlerSupport : Registered LINE Messaging API event handler: count = 2
|
124
|
+
|
125
|
+
2018-06-27 04:40:10.175 INFO 3177 --- [ main] c.l.b.s.b.s.LineMessageHandlerSupport : Mapped "[MessageEvent<TextMessageContent>]" onto public com.linecorp.bot.model.message.TextMessage com.taguchi.springboot.LineEventApplication.handleTextMessageEvent(com.linecorp.bot.model.event.MessageEvent<com.linecorp.bot.model.event.message.TextMessageContent>)
|
126
|
+
|
127
|
+
2018-06-27 04:40:10.175 INFO 3177 --- [ main] c.l.b.s.b.s.LineMessageHandlerSupport : Mapped "[Event]" onto public void com.taguchi.springboot.LineEventApplication.handleDefaultMessageEvent(com.linecorp.bot.model.event.Event)
|
128
|
+
|
129
|
+
2018-06-27 04:40:10.991 INFO 3177 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 443 (https) with context path ''
|
130
|
+
|
131
|
+
2018-06-27 04:40:10.997 INFO 3177 --- [ main] c.t.springboot.LineEventApplication : Started LineEventApplication in 8.608 seconds (JVM running for 9.585)
|
132
|
+
|
133
|
+
```
|
134
|
+
|
135
|
+
```webhookの接続確認を押した後の/var/log/messages
|
136
|
+
|
137
|
+
Jun 27 04:26:09 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 113460ms.
|
138
|
+
|
139
|
+
Jun 27 04:28:03 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 131660ms.
|
140
|
+
|
141
|
+
Jun 27 04:30:15 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 129250ms.
|
142
|
+
|
143
|
+
Jun 27 04:32:24 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 108340ms.
|
144
|
+
|
145
|
+
Jun 27 04:34:12 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 116950ms.
|
146
|
+
|
147
|
+
Jun 27 04:36:10 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 119560ms.
|
148
|
+
|
149
|
+
Jun 27 04:38:09 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 109390ms.
|
150
|
+
|
151
|
+
Jun 27 04:39:59 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 108960ms.
|
152
|
+
|
153
|
+
Jun 27 04:41:48 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 126880ms.
|
154
|
+
|
155
|
+
Jun 27 04:42:00 ip-155-155-20-206 dhclient[2094]: DHCPREQUEST on eth0 to 155.155.20.1 port 67 (xid=0x4a73ab14)
|
156
|
+
|
157
|
+
Jun 27 04:42:00 ip-155-155-20-206 dhclient[2094]: DHCPACK from 155.155.20.1 (xid=0x4a73ab14)
|
158
|
+
|
159
|
+
Jun 27 04:42:00 ip-155-155-20-206 dhclient[2094]: bound to 155.155.20.206 -- renewal in 1565 seconds.
|
160
|
+
|
161
|
+
Jun 27 04:42:00 ip-155-155-20-206 ec2net: [get_meta] Trying to get http://169.254.169.254/latest/meta-data/network/interfaces/macs/06:0d:5a:1b:73:64/local-ipv4s
|
162
|
+
|
163
|
+
Jun 27 04:42:00 ip-155-155-20-206 ec2net: [rewrite_aliases] Rewriting aliases of eth0
|
164
|
+
|
165
|
+
Jun 27 04:43:55 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 109190ms.
|
166
|
+
|
167
|
+
Jun 27 04:45:44 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 123840ms.
|
168
|
+
|
169
|
+
Jun 27 04:47:48 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 120610ms.
|
170
|
+
|
171
|
+
Jun 27 04:49:48 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 126740ms.
|
172
|
+
|
173
|
+
Jun 27 04:51:55 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 122680ms.
|
174
|
+
|
175
|
+
Jun 27 04:53:58 ip-155-155-20-206 dhclient[2192]: XMT: Solicit on eth0, interval 128890ms.
|
176
|
+
|
177
|
+
```
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
24
182
|
|
25
183
|
|
26
184
|
|
@@ -44,4 +202,6 @@
|
|
44
202
|
|
45
203
|
ec2インスタンスはamazon linux
|
46
204
|
|
205
|
+
証明書情報
|
206
|
+
|
47
|
-
証明書
|
207
|
+

|
4
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
その後、以下の記事を参考にLet's Encryptで証明書を作成して配置しhttps(ポートは443)アクセスをできるようにしました。
|
12
12
|
|
13
|
-
[
|
13
|
+
[Spring bootでSSL(HTTPS)を有効にする~Let's Encrypt編~](https://qiita.com/keigohtr/items/faa1bd0c647df54d6594)
|
14
14
|
|
15
15
|
|
16
16
|
|
3
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
その後、以下の記事を参考にLet's Encryptで証明書を作成して配置しhttps(ポートは443)アクセスをできるようにしました。
|
12
12
|
|
13
|
-
https://qiita.com/keigohtr/items/faa1bd0c647df54d6594
|
13
|
+
[リンク内容](https://qiita.com/keigohtr/items/faa1bd0c647df54d6594)
|
14
14
|
|
15
15
|
|
16
16
|
|
2
文法の修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Let's Encryptで作成した証明書を使いs
|
1
|
+
Let's Encryptで作成した証明書を使いhttps化したサイトがwebhookに反応しない
|
test
CHANGED
File without changes
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
### 発生している問題・エラーメッセージ
|
18
18
|
|
19
|
-
ドメイン/callbackをwebhookに指定したところ以下のエラーが起こりした。
|
19
|
+
ドメイン/callbackをwebhookに指定したところ以下のエラーが起こりました。
|
20
20
|
|
21
21
|
|
22
22
|
|