webjars / webjars-play

MIT License
80 stars 34 forks source link

Exception Occurring in Windows Environment #154

Closed XenonAbe closed 7 months ago

XenonAbe commented 8 months ago

Description When incorporating this module in a Windows environment, an error is encountered. (The error does not occur in macOS.)

Module Version 2.9.0

Java Version jdk-11.0.21+9

OS Version Windows11

To Reproduce

  1. Create a new project using play-seed. sbt new playframework/play-java-seed.g8 -> Set the play_version to 2.9.0.
  2. Add the following to the "build.sbt" file.

    libraryDependencies += "org.webjars" %% "webjars-play" % "2.9.0"
    
    libraryDependencies ++= Seq(
          "org.webjars" % "requirejs" % "2.3.6",
    )    
  3. sbt run and Access http://localhost:9000/ in your browser.
  4. Encounter an "UnsupportedOperationException".

Console Logs

[info] welcome to sbt 1.9.7 (Eclipse Adoptium Java 11.0.21)
[info] loading settings for project play-java-seed-build from plugins.sbt ...
[info] loading project definition from C:\Users\xenon\Works\play\workspace\tmp\play-java-seed\project
[info] loading settings for project root from build.sbt ...
[info]   __              __
[info]   \ \     ____   / /____ _ __  __
[info]    \ \   / __ \ / // __ `// / / /
[info]    / /  / /_/ // // /_/ // /_/ /
[info]   /_/  / .___//_/ \__,_/ \__, /
[info]       /_/               /____/
[info]
[info] Version 2.9.0 running Java 11.0.21
[info]
[info] Play is run entirely by the community. Please consider contributing and/or donating:
[info] https://www.playframework.com/sponsors
[info]

--- (Running the application, auto-reloading is enabled) ---

INFO  p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Enter to stop and go back to the console...)

[error] java.lang.UnsupportedOperationException
[error]         at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2079)
[error]         at org.webjars.WebJarExtractor.extractResource(WebJarExtractor.java:147)
[error]         at org.webjars.WebJarExtractor.lambda$extractResourcesTo$0(WebJarExtractor.java:131)
[error]         at io.github.classgraph.ResourceList.forEachInputStreamIgnoringIOException(ResourceList.java:527)
[error]         at org.webjars.WebJarExtractor.extractResourcesTo(WebJarExtractor.java:131)
[error]         at org.webjars.WebJarExtractor.extractWebJarsTo(WebJarExtractor.java:179)
[error]         at org.webjars.WebJarExtractor.extractAllWebJarsTo(WebJarExtractor.java:64)
[error]         at com.typesafe.sbt.web.SbtWeb$.$anonfun$generateWebJars$1(SbtWeb.scala:450)
[error]         at com.typesafe.sbt.web.SbtWeb$.$anonfun$generateWebJars$1$adapted(SbtWeb.scala:449)
[error]         at com.typesafe.sbt.web.SbtWeb$.withWebJarExtractor(SbtWeb.scala:436)
[error]         at com.typesafe.sbt.web.SbtWeb$.generateWebJars(SbtWeb.scala:449)
[error]         at com.typesafe.sbt.web.SbtWeb$.$anonfun$unscopedAssetSettings$31(SbtWeb.scala:274)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error]         at sbt.Execute.work(Execute.scala:292)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]         at java.base/java.lang.Thread.run(Thread.java:829)
[error] (Web-assets / webJars) java.lang.UnsupportedOperationException
ERROR p.a.h.DevHttpErrorHandler -

! @83imhdpe1 - Internal server error, for (GET) [/] ->

play.sbt.PlayExceptions$UnexpectedException: Unexpected exception[UnsupportedOperationException: null]
        at play.sbt.run.PlayReload$.$anonfun$taskFailureHandler$8(PlayReload.scala:121)
        at scala.Option.map(Option.scala:230)
        at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:92)
        at play.sbt.run.PlayReload$.$anonfun$compile$3(PlayReload.scala:144)
        at scala.util.Either$LeftProjection.map(Either.scala:573)
        at play.sbt.run.PlayReload$.compile(PlayReload.scala:144)
        at sbt.PlayRun$.$anonfun$playRunTask$5(PlayRun.scala:99)
        at play.runsupport.Reloader.$anonfun$reload$1(Reloader.scala:493)
        at play.runsupport.Reloader$$anon$1.run(Reloader.scala:58)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
Caused by: java.lang.UnsupportedOperationException: null
        at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2079)
        at org.webjars.WebJarExtractor.extractResource(WebJarExtractor.java:147)
        at org.webjars.WebJarExtractor.lambda$extractResourcesTo$0(WebJarExtractor.java:131)
        at io.github.classgraph.ResourceList.forEachInputStreamIgnoringIOException(ResourceList.java:527)
        at org.webjars.WebJarExtractor.extractResourcesTo(WebJarExtractor.java:131)
        at org.webjars.WebJarExtractor.extractWebJarsTo(WebJarExtractor.java:179)
        at org.webjars.WebJarExtractor.extractAllWebJarsTo(WebJarExtractor.java:64)
        at com.typesafe.sbt.web.SbtWeb$.$anonfun$generateWebJars$1(SbtWeb.scala:450)
        at com.typesafe.sbt.web.SbtWeb$.$anonfun$generateWebJars$1$adapted(SbtWeb.scala:449)
        at com.typesafe.sbt.web.SbtWeb$.withWebJarExtractor(SbtWeb.scala:436)
jamesward commented 8 months ago

We fixed this: https://github.com/webjars/webjars-locator-core/issues/123

But I think we haven't released the new webjars-play with the new transitive: https://github.com/webjars/webjars-locator/pull/78

You should be able to add the updated webjars-locator-core dep (0.55) for now. I'll get the new webjars-locator out and then maybe @mkurz can roll the new webjars-play release.

mkurz commented 8 months ago

@jamesward A couple of points:

  1. Is it possible to downgrade Jackson to 2.14 for now in webjars-locator, see https://github.com/webjars/webjars-locator/pull/80
  2. I can then upgrade to webjars-locator in this repo to latest (if you cut a new release after 1. is done :wink:)
  3. I would like to remove the master branch from this repo. There is no point of keeping it right now, it's also outdated, because releases are now done from the 3.0.x branch and the 2.9.x. I also pushed a 2.8.x branch for the Play 2.8 line. So either make 3.0.x new HEAD - or, if you don't like that, we can remove 3.0.x branch and make it the master branch instead. Both are ok with me, but right now the current master does not make sense.
jamesward commented 8 months ago

Thanks @mkurz :)

I'm releasing webjars-locator 0.50 now.

Let's just move the 3.0.x branch to main (and change the default in GitHub).

mkurz commented 8 months ago

You main delete 3.0.x, and make it main instead? (Currently we use the term master for all the webjars repos here we work on, but I am happy to rename them to main)

mkurz commented 8 months ago

Let's just move the 3.0.x branch to main (and change the default in GitHub).

Sorry I don't fully understand...

mkurz commented 8 months ago

btw, I plan to release Play 2.9.1/3.0.1 in the next couple of days, so I wait here to release webjars-play 2.9.1/3.0.1 so I can upgrade play here before.

jamesward commented 8 months ago

Here is the new main branch: https://github.com/webjars/webjars-play/tree/main

I can make that the default on GitHub if that's ok.

And sounds good on the release plan.

mkurz commented 8 months ago

@jamesward I deleted the 3.0.x branch now, so we just have main. I also deleted master, it was outdated anyway, just kept alive by scala-steward... So it's main for Play 3 and 2.9.x for Play 2.9 now. When Play 3.1 hits I will re-create the 3.0.x again.

mkurz commented 7 months ago

Play 2.9.1 and 3.0.1 are on maven central.