質問編集履歴
5
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,8 +16,6 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
アプリケーションを実行するには、sbtを使用しています。
|
20
|
-
|
21
19
|
app/models/User.scala app/models/Post.scalaにapplyメソッドを追加するとコンパイルエラーが発生します。
|
22
20
|
|
23
21
|
|
4
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -174,7 +174,7 @@
|
|
174
174
|
|
175
175
|
[sbt_options] declare -a sbt_options='()'
|
176
176
|
|
177
|
-
[copyRt] java9_rt = '/Users/
|
177
|
+
[copyRt] java9_rt = '/Users/xxxx/.sbt/0.13/java9-rt-ext-n_a_14_0_1/rt.jar'
|
178
178
|
|
179
179
|
|
180
180
|
|
@@ -192,7 +192,7 @@
|
|
192
192
|
|
193
193
|
-XX:ReservedCodeCacheSize=128m
|
194
194
|
|
195
|
-
-Dscala.ext.dirs=/Users/
|
195
|
+
-Dscala.ext.dirs=/Users/xxxxx/.sbt/0.13/java9-rt-ext-n_a_14_0_1
|
196
196
|
|
197
197
|
-jar
|
198
198
|
|
3
追記
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
scala playframework ScalikeJDBC モデルに
|
1
|
+
scala playframework ScalikeJDBC モデルにapplyメソッドを追加するとコンパイルエラーが発生
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
アプリケーションを実行するには、sbtを使用しています。
|
20
20
|
|
21
|
-
app/models/User.scala app/models/Post.scala
|
21
|
+
app/models/User.scala app/models/Post.scalaにapplyメソッドを追加するとコンパイルエラーが発生します。
|
22
22
|
|
23
23
|
|
24
24
|
|
@@ -44,60 +44,96 @@
|
|
44
44
|
|
45
45
|
override val tableName = "user"
|
46
46
|
|
47
|
-
|
47
|
+
def apply(rs: WrappedResultSet): User = User(rs.long("id"), rs.string("name"))
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
//ここから下をコメントアウトするとコンパイルに成功する
|
48
52
|
|
49
53
|
def apply(u: ResultName[User])(rs: WrappedResultSet) = new User(rs.long(u.id), rs.string(u.name))
|
50
54
|
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
app/models/Post.scala
|
60
|
+
|
61
|
+
```scala
|
62
|
+
|
63
|
+
package models
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
import scalikejdbc._
|
68
|
+
|
69
|
+
import java.time.ZonedDateTime
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
case class Post(id: Long,
|
74
|
+
|
75
|
+
userId: Option[Long] = None,
|
76
|
+
|
77
|
+
user: Option[User] = None,
|
78
|
+
|
79
|
+
text: String,
|
80
|
+
|
81
|
+
commentCount: Int,
|
82
|
+
|
83
|
+
postedAt: ZonedDateTime)
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
object Post extends SQLSyntaxSupport[Post] {
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
override val tableName = "post"
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
//ここから下をコメントアウトするとコンパイルに成功する
|
96
|
+
|
97
|
+
def apply(p: SyntaxProvider[Post])(rs: WrappedResultSet): Post = apply(p.resultName)(rs)
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
def apply(p: ResultName[Post])(rs: WrappedResultSet): Post = new Post(
|
102
|
+
|
103
|
+
id = rs.get(p.id),
|
104
|
+
|
105
|
+
userId = rs.get(p.userId),
|
106
|
+
|
107
|
+
text = rs.get(p.text),
|
108
|
+
|
109
|
+
commentCount = rs.get(p.commentCount),
|
110
|
+
|
111
|
+
postedAt = rs.get(p.postedAt)
|
112
|
+
|
113
|
+
)
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
def opt(m: SyntaxProvider[Post])(rs: WrappedResultSet): Option[Post] =
|
118
|
+
|
119
|
+
rs.longOpt(m.resultName.id).map(_ => Post(m)(rs))
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
val (u, p) = (User.syntax, Post.syntax)
|
124
|
+
|
51
125
|
}
|
52
126
|
|
53
127
|
```
|
54
128
|
|
129
|
+
|
130
|
+
|
55
|
-
|
131
|
+
コントローラーにはまだ空のメソッド定義しかしていません。
|
56
|
-
|
132
|
+
|
57
|
-
app/
|
133
|
+
app/controllers/PostController.scala
|
58
134
|
|
59
135
|
```scala
|
60
136
|
|
61
|
-
//package models
|
62
|
-
|
63
|
-
//
|
64
|
-
|
65
|
-
//import java.time.ZonedDateTime
|
66
|
-
|
67
|
-
//import scalikejdbc._
|
68
|
-
|
69
|
-
//
|
70
|
-
|
71
|
-
//case class Post(id: Long,
|
72
|
-
|
73
|
-
// userId: Option[Long] = None,
|
74
|
-
|
75
|
-
// user: Option[User] = None,
|
76
|
-
|
77
|
-
// text: String,
|
78
|
-
|
79
|
-
// commentCount: Int,
|
80
|
-
|
81
|
-
// postedAt: ZonedDateTime)
|
82
|
-
|
83
|
-
//
|
84
|
-
|
85
|
-
//object Post extends SQLSyntaxSupport[Post] {
|
86
|
-
|
87
|
-
以下省略
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
```
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
コントローラーにはまだ空のメソッド定義しかしていません。
|
96
|
-
|
97
|
-
app/controllers/PostController.scala
|
98
|
-
|
99
|
-
```scala
|
100
|
-
|
101
137
|
package controllers
|
102
138
|
|
103
139
|
|
@@ -132,176 +168,6 @@
|
|
132
168
|
|
133
169
|
|
134
170
|
|
135
|
-
|
136
|
-
|
137
|
-
**以下エラー**
|
138
|
-
|
139
|
-
```ここに言語を入力
|
140
|
-
|
141
|
-
[info] Compiling 1 Scala source to /Users/tomoyaueno/Downloads/2020_scala_api/target/scala-2.12/classes ...
|
142
|
-
|
143
|
-
[error] ## Exception when compiling 9 sources to /Users/tomoyaueno/Downloads/2020_scala_api/target/scala-2.12/classes
|
144
|
-
|
145
|
-
[error] java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
|
146
|
-
|
147
|
-
[error] java.base/jdk.internal.jrtfs.JrtPath.toUri(JrtPath.java:176)
|
148
|
-
|
149
|
-
[error] scala.tools.nsc.classpath.JrtClassPath.asURLs(DirectoryClassPath.scala:204)
|
150
|
-
|
151
|
-
[error] scala.tools.nsc.classpath.AggregateClassPath.$anonfun$asURLs$1(AggregateClassPath.scala:55)
|
152
|
-
|
153
|
-
[error] scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:241)
|
154
|
-
|
155
|
-
[error] scala.collection.Iterator.foreach(Iterator.scala:944)
|
156
|
-
|
157
|
-
[error] scala.collection.Iterator.foreach$(Iterator.scala:944)
|
158
|
-
|
159
|
-
[error] scala.collection.AbstractIterator.foreach(Iterator.scala:1432)
|
160
|
-
|
161
|
-
[error] scala.collection.IterableLike.foreach(IterableLike.scala:71)
|
162
|
-
|
163
|
-
[error] scala.collection.IterableLike.foreach$(IterableLike.scala:70)
|
164
|
-
|
165
|
-
[error] scala.collection.AbstractIterable.foreach(Iterable.scala:54)
|
166
|
-
|
167
|
-
[error] scala.collection.TraversableLike.flatMap(TraversableLike.scala:241)
|
168
|
-
|
169
|
-
[error] scala.collection.TraversableLike.flatMap$(TraversableLike.scala:238)
|
170
|
-
|
171
|
-
[error] scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
|
172
|
-
|
173
|
-
[error] scala.tools.nsc.classpath.AggregateClassPath.asURLs(AggregateClassPath.scala:55)
|
174
|
-
|
175
|
-
[error] scala.tools.nsc.typechecker.Macros.findMacroClassLoader(Macros.scala:66)
|
176
|
-
|
177
|
-
[error] scala.tools.nsc.typechecker.Macros.findMacroClassLoader$(Macros.scala:65)
|
178
|
-
|
179
|
-
[error] scala.tools.nsc.Global$$anon$1.findMacroClassLoader(Global.scala:448)
|
180
|
-
|
181
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.$anonfun$defaultMacroClassloaderCache$2(MacroRuntimes.scala:56)
|
182
|
-
|
183
|
-
[error] scala.reflect.internal.SymbolTable$perRunCaches$$anon$1.apply(SymbolTable.scala:459)
|
184
|
-
|
185
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader(MacroRuntimes.scala:58)
|
186
|
-
|
187
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader$(MacroRuntimes.scala:58)
|
188
|
-
|
189
|
-
[error] scala.tools.nsc.Global$$anon$1.defaultMacroClassloader(Global.scala:448)
|
190
|
-
|
191
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveRuntime(MacroRuntimes.scala:76)
|
192
|
-
|
193
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.$anonfun$standardMacroRuntime$3(MacroRuntimes.scala:38)
|
194
|
-
|
195
|
-
[error] scala.collection.mutable.MapLike.getOrElseUpdate(MapLike.scala:206)
|
196
|
-
|
197
|
-
[error] scala.collection.mutable.MapLike.getOrElseUpdate$(MapLike.scala:203)
|
198
|
-
|
199
|
-
[error] scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:80)
|
200
|
-
|
201
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime(MacroRuntimes.scala:38)
|
202
|
-
|
203
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime$(MacroRuntimes.scala:31)
|
204
|
-
|
205
|
-
[error] scala.tools.nsc.Global$$anon$1.standardMacroRuntime(Global.scala:448)
|
206
|
-
|
207
|
-
[error] scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$14.default(AnalyzerPlugins.scala:448)
|
208
|
-
|
209
|
-
[error] scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$14.default(AnalyzerPlugins.scala:445)
|
210
|
-
|
211
|
-
[error] scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:401)
|
212
|
-
|
213
|
-
[error] scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime(AnalyzerPlugins.scala:445)
|
214
|
-
|
215
|
-
[error] scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime$(AnalyzerPlugins.scala:445)
|
216
|
-
|
217
|
-
[error] scala.tools.nsc.Global$$anon$1.pluginsMacroRuntime(Global.scala:448)
|
218
|
-
|
219
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.macroRuntime(MacroRuntimes.scala:25)
|
220
|
-
|
221
|
-
[error] scala.reflect.macros.runtime.MacroRuntimes.macroRuntime$(MacroRuntimes.scala:25)
|
222
|
-
|
223
|
-
[error] scala.tools.nsc.Global$$anon$1.macroRuntime(Global.scala:448)
|
224
|
-
|
225
|
-
[error] scala.tools.nsc.typechecker.Macros$MacroExpander.$anonfun$expand$1(Macros.scala:619)
|
226
|
-
|
227
|
-
//1万文字を超える為省略
|
228
|
-
|
229
|
-
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5672)
|
230
|
-
|
231
|
-
[error] scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5613)
|
232
|
-
|
233
|
-
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5618)
|
234
|
-
|
235
|
-
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5699)
|
236
|
-
|
237
|
-
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:104)
|
238
|
-
|
239
|
-
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
|
240
|
-
|
241
|
-
[error] sbt.Execute.work(Execute.scala:290)
|
242
|
-
|
243
|
-
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:281)
|
244
|
-
|
245
|
-
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
|
246
|
-
|
247
|
-
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
|
248
|
-
|
249
|
-
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
|
250
|
-
|
251
|
-
[error] java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
|
252
|
-
|
253
|
-
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
|
254
|
-
|
255
|
-
[error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
|
256
|
-
|
257
|
-
[error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
|
258
|
-
|
259
|
-
[error] java.base/java.lang.Thread.run(Thread.java:832)
|
260
|
-
|
261
|
-
[error]
|
262
|
-
|
263
|
-
[error] stack trace is suppressed; run last Compile / compileIncremental for the full output
|
264
|
-
|
265
|
-
[error] (Compile / compileIncremental) java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
|
266
|
-
|
267
|
-
[error] a.a.ActorSystemImpl - Internal server error, sending 500 response
|
268
|
-
|
269
|
-
scala.MatchError: java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI (of class java.io.IOError)
|
270
|
-
|
271
|
-
at play.sbt.run.PlayReload$.$anonfun$taskFailureHandler$1(PlayReload.scala:35)
|
272
|
-
|
273
|
-
at scala.Option.map(Option.scala:230)
|
274
|
-
|
275
|
-
at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:28)
|
276
|
-
|
277
|
-
at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:24)
|
278
|
-
|
279
|
-
at play.sbt.run.PlayReload$.$anonfun$compile$3(PlayReload.scala:51)
|
280
|
-
|
281
|
-
at scala.util.Either$LeftProjection.map(Either.scala:573)
|
282
|
-
|
283
|
-
at play.sbt.run.PlayReload$.compile(PlayReload.scala:51)
|
284
|
-
|
285
|
-
at play.sbt.run.PlayRun$.$anonfun$playRunTask$4(PlayRun.scala:76)
|
286
|
-
|
287
|
-
at play.runsupport.Reloader.$anonfun$reload$1(Reloader.scala:413)
|
288
|
-
|
289
|
-
at play.runsupport.Reloader$$anon$5.run(Reloader.scala:51)
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
```
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
**試した事**
|
300
|
-
|
301
|
-
build.properties内のsbtのバージョンがインストールされていたものと違っていたのでbuild.propertiesのsbtバージョンを1.1.2から1.3.13に書き換えました。
|
302
|
-
|
303
|
-
|
304
|
-
|
305
171
|
**sbtバージョン**
|
306
172
|
|
307
173
|
[process_args] java_version = '14'
|
2
追記
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
scala playframework モデルにコードを記述するとコンパイルエラーが発生
|
1
|
+
scala playframework ScalikeJDBC モデルにコードを記述するとコンパイルエラーが発生
|
test
CHANGED
File without changes
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -224,7 +224,7 @@
|
|
224
224
|
|
225
225
|
[error] scala.tools.nsc.typechecker.Macros$MacroExpander.$anonfun$expand$1(Macros.scala:619)
|
226
226
|
|
227
|
-
|
227
|
+
//1万文字を超える為省略
|
228
228
|
|
229
229
|
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5672)
|
230
230
|
|