programing

SBT보고 "GZIPInputStream에서 InputStream 래핑 오류 : java.io.EOFException"을 수정하는 방법은 무엇입니까?

goodcopy 2021. 1. 18. 22:03
반응형

SBT보고 "GZIPInputStream에서 InputStream 래핑 오류 : java.io.EOFException"을 수정하는 방법은 무엇입니까?


sbt빈 디렉토리에서 명령을 실행하는 동안 다음 예외와 함께 계속 실패합니다.

$ sbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
Error wrapping InputStream in GZIPInputStream: java.io.EOFException
    at sbt.ErrorHandling$.translate(ErrorHandling.scala:11)
    at sbt.WrapUsing.open(Using.scala:36)
    at sbt.Using.apply(Using.scala:24)
    at sbt.IO$$anonfun$gzipFileIn$1.apply(IO.scala:778)
    at sbt.IO$$anonfun$gzipFileIn$1.apply(IO.scala:777)
    at sbt.Using.apply(Using.scala:25)
    at sbt.IO$.gzipFileIn(IO.scala:777)
    at sbt.Sync$.readUncaught(Sync.scala:88)
    at sbt.Sync$.readInfo(Sync.scala:84)
    at sbt.Sync$$anonfun$apply$1.apply(Sync.scala:29)
    at sbt.Sync$$anonfun$apply$1.apply(Sync.scala:23)
    at sbt.Defaults$$anonfun$copyResourcesTask$1.apply(Defaults.scala:770)
    at sbt.Defaults$$anonfun$copyResourcesTask$1.apply(Defaults.scala:766)
    at scala.Function4$$anonfun$tupled$1.apply(Function4.scala:35)
    at scala.Function4$$anonfun$tupled$1.apply(Function4.scala:34)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.EOFException
    at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:264)
    at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:254)
    at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:163)
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:78)
    at sbt.Using$$anonfun$gzipInputStream$1.apply(Using.scala:91)
    at sbt.Using$$anonfun$gzipInputStream$1.apply(Using.scala:91)
    at sbt.Using$$anon$1.openImpl(Using.scala:56)
    at sbt.WrapUsing$$anonfun$open$2.apply(Using.scala:36)
    at sbt.ErrorHandling$.translate(ErrorHandling.scala:11)
    at sbt.WrapUsing.open(Using.scala:36)
    at sbt.Using.apply(Using.scala:24)
    at sbt.IO$$anonfun$gzipFileIn$1.apply(IO.scala:778)
    at sbt.IO$$anonfun$gzipFileIn$1.apply(IO.scala:777)
    at sbt.Using.apply(Using.scala:25)
    at sbt.IO$.gzipFileIn(IO.scala:777)
    at sbt.Sync$.readUncaught(Sync.scala:88)
    at sbt.Sync$.readInfo(Sync.scala:84)
    at sbt.Sync$$anonfun$apply$1.apply(Sync.scala:29)
    at sbt.Sync$$anonfun$apply$1.apply(Sync.scala:23)
    at sbt.Defaults$$anonfun$copyResourcesTask$1.apply(Defaults.scala:770)
    at sbt.Defaults$$anonfun$copyResourcesTask$1.apply(Defaults.scala:766)
    at scala.Function4$$anonfun$tupled$1.apply(Function4.scala:35)
    at scala.Function4$$anonfun$tupled$1.apply(Function4.scala:34)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
[error] (compile:copyResources) Error wrapping InputStream in GZIPInputStream: java.io.EOFException
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

문제의 근본 원인은 무엇입니까?


예외는 로컬 리포지토리의 일부 문제로 인한 것 같습니다. 정리 후, ​​예를 들어 target디렉토리에서 ~/.sbt디렉토리를 제거 하면 이제 정상적으로 작동합니다.

jacek:~/.sbt
$ find . -name target | xargs rm -rf

jacek:~/sandbox/stackoverflow/testaaa
$ sbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Updating {file:/Users/jacek/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to testaaa (in build file:/Users/jacek/sandbox/stackoverflow/testaaa/)
[testaaa]>

스레드 [2.1.1] SBT : InputStream in GZIPInputStream : java.io.EOFException in the play-framework forum 에서 해결책을 찾았습니다 .


나는 또한 문제가 모두 제거한 후 사라집니다 들었다 target예를 들어 프로젝트의 홈 디렉토리에 디렉토리를 target, project/target.

jacek:my-project-path
$ find . -name target | xargs rm -rf

프로젝트 디렉토리로 이동

$ cd my-spark-app
$ rm -rf target
$ cd project 
$ rm -rf target project

이제 sbt 시작

$sbt 

Step 1:You need to add sbt path in .bash_profile in case of windows need to add environment variable then go to terminal and run ./sbt file.

Step 2:delete target folder from your project directory.

Step 3:run sbt command from intellijID terminal "sbt clean" then "activator clean" then activator update".


You could run sbt clean on your directory (to remove the target and any files in /src that might have been created earlier) and now try running sbt. Had this issue when trying to create an Akka HTTP seed project by running sbt -Dsbt.version=0.13.15 new https://github.com/akka/akka-http-scala-seed.g8. My mistake was that I was not inside an empty directory while running the command. More info about the error can be found here

ReferenceURL : https://stackoverflow.com/questions/20362055/how-to-fix-sbt-reporting-error-wrapping-inputstream-in-gzipinputstream-java-io

반응형