質問編集履歴

2

エラー文について追記しました。

2020/09/27 08:51

投稿

kumaGoro_95
kumaGoro_95

スコア1

test CHANGED
File without changes
test CHANGED
@@ -102,6 +102,158 @@
102
102
 
103
103
  ```
104
104
 
105
+
106
+
107
+ ### 接続を試みた時に表示されたエラー
108
+
109
+ ```catalina.out
110
+
111
+ java.sql.SQLException: No suitable driver found for jdbc:h2:tcp://localhost/~/testJavaApp
112
+
113
+ at java.sql.DriverManager.getConnection(DriverManager.java:689)
114
+
115
+ at java.sql.DriverManager.getConnection(DriverManager.java:247)
116
+
117
+ at dao.AccountDAO.signupAccount(AccountDAO.java:55)
118
+
119
+ at model.SignupLogic.execute(SignupLogic.java:8)
120
+
121
+ at servlet.SignupServlet.doPost(SignupServlet.java:57)
122
+
123
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
124
+
125
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
126
+
127
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
128
+
129
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
130
+
131
+ at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
132
+
133
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
134
+
135
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
136
+
137
+ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
138
+
139
+ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
140
+
141
+ at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
142
+
143
+ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
144
+
145
+ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
146
+
147
+ at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
148
+
149
+ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
150
+
151
+ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
152
+
153
+ at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:431)
154
+
155
+ at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
156
+
157
+ at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
158
+
159
+ at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
160
+
161
+ at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
162
+
163
+ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
164
+
165
+ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
166
+
167
+ at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
168
+
169
+ at java.lang.Thread.run(Thread.java:748)
170
+
171
+ java.sql.SQLException: No suitable driver found for jdbc:h2:tcp://localhost/~/testJavaApp
172
+
173
+ at java.sql.DriverManager.getConnection(DriverManager.java:689)
174
+
175
+ at java.sql.DriverManager.getConnection(DriverManager.java:247)
176
+
177
+ at dao.AccountDAO.signupAccount(AccountDAO.java:55)
178
+
179
+ at model.SignupLogic.execute(SignupLogic.java:8)
180
+
181
+ at servlet.SignupServlet.doPost(SignupServlet.java:57)
182
+
183
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
184
+
185
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
186
+
187
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
188
+
189
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
190
+
191
+ at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
192
+
193
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
194
+
195
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
196
+
197
+ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
198
+
199
+ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
200
+
201
+ at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
202
+
203
+ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
204
+
205
+ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
206
+
207
+ at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
208
+
209
+ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
210
+
211
+ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
212
+
213
+ at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:431)
214
+
215
+ at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
216
+
217
+ at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
218
+
219
+ at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
220
+
221
+ at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
222
+
223
+ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
224
+
225
+ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
226
+
227
+ at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
228
+
229
+ at java.lang.Thread.run(Thread.java:748)
230
+
231
+ Caused by: java.net.ConnectException: Connection refused (Connection refused)
232
+
233
+ at java.net.PlainSocketImpl.socketConnect(Native Method)
234
+
235
+ at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
236
+
237
+ at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
238
+
239
+ at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
240
+
241
+ at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
242
+
243
+ at java.net.Socket.connect(Socket.java:607)
244
+
245
+ at org.h2.util.NetUtils.createSocket(NetUtils.java:103)
246
+
247
+ at org.h2.util.NetUtils.createSocket(NetUtils.java:83)
248
+
249
+ at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:115)
250
+
251
+ at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:431)
252
+
253
+ ... 33 more
254
+
255
+ ```
256
+
105
257
  ### やってみたこと
106
258
 
107
259
  H2 Databaseのjarファイル「h2-1.4.199.jar」をtomcatのlibディレクトリに保存する。

1

タイトル変更

2020/09/27 08:51

投稿

kumaGoro_95
kumaGoro_95

スコア1

test CHANGED
@@ -1 +1 @@
1
- VPS上でデータベースにアクセスできません。
1
+ VPS上でデータベース(H2 Database)にアクセスできません。
test CHANGED
File without changes