Comments (4)
The issue still occurs with sbt 1.9.9 (Play 2.9).
I understand this is a low priority issue.
from playframework.
So this is most likely caused by
Which version of sbt are you using in your project/build.properties
? Please try with sbt version 1.7.2 when using Play 2.8.12+ or sbt 1.9.7 when using Play 2.9 or 3.0 and let me know if that fixes the problem.
However, given that this is working on Linux and "only" broken on Windows and the fact that this very likely is a problem only in dev mode, but should work fine in prod mode, I will not spend time to fix this problem. Also probably sbt magic is involved here as well...
If you want to fix this, I am happy to review a pull request. But I am not going to look further into this issue at this point.
from playframework.
เล่นเวอร์ชัน
3.0.1 (แต่อาจเป็นทุกเวอร์ชันตั้งแต่ 2.8.12)
เอพีไอ
ชวา
ระบบปฏิบัติการ
Windows Server 2016 Std เวอร์ชัน Windows 10 Linux ไม่ได้รับผลกระทบจากปัญหานี้
เจดีเค
openjdk version "21.0.1" 2023-10-17 LTS OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)
แต่ทดสอบด้วยผลลัพธ์เดียวกันกับการแจกแจงอื่น ๆ (oracle) และเวอร์ชัน (11, 17)
การพึ่งพาห้องสมุด
"org.jblas" % "jblas" % "1.2.5", // https://github.com/jblas-project/jblas
พฤติกรรมที่คาดหวัง
- สร้างโปรเจ็กต์ play-java-seed
- รวม
"org.jblas" % "jblas" % "1.2.5"
ในไลบรารีการพึ่งพาใน build.sbt- สร้างคอนโทรลเลอร์ง่ายๆดังนี้:
package controllers; import play.mvc.*; import org.jblas.DoubleMatrix; import org.jblas.MatrixFunctions; public class JblasTest extends Controller { public Result index() { System.out.println("STEP 1"); DoubleMatrix Ms = new DoubleMatrix(5,5); System.out.println("STEP 2"); Ms = Ms.mul(2); System.out.println("STEP 3"); DoubleMatrix expMs = MatrixFunctions.expm(Ms); // JNI call in jblas System.out.println("STEP 4"); return ok("OK"); } }
รหัสนี้ควรดำเนินการโดยไม่มีปัญหาใด ๆ และพิมพ์ขั้นตอนที่ 1-4 ไปยังเอาต์พุตมาตรฐาน
พฤติกรรมที่แท้จริง
การเล่น (หรือเฉพาะเจาะจงกว่านั้นคือแค่เธรดปัจจุบันที่จัดการคำขอ) ค้างเมื่อ เรียกใช้ MatrixFunctions.expm ดังนั้นจึงพิมพ์เฉพาะขั้นตอนที่ 1, 2 และ 3 บนเอาต์พุต stardard การเรียกใช้ฟังก์ชัน jblas มาตรฐานเช่นเดียวกับในขั้นตอนที่ 1 และขั้นตอนที่ 2 ทำงานได้ดี แต่การเล่นค้างในขั้นตอนที่ 3 ซึ่ง afaik ใช้ JNI ใน jblas
แต่หากฉันป้อนอักขระสองตัวโดยใช้แป้นพิมพ์บน Play Console การดำเนินการจะเสร็จสิ้นและขั้นตอนที่ 4 จะถูกพิมพ์
กรณีทดสอบที่สามารถทำซ้ำได้
สิ่งนี้สามารถทดสอบได้แม้จะมีโค้ดเพียงบรรทัดเดียว:
System.out.println("STEP1"); MatrixFunctions.expm(new DoubleMatrix(5,5)); System.out.println("STEP2");
ความคิดเห็นอื่น ๆ
ฉันเพิ่งอัปเกรดโปรเจ็กต์ของฉันจากเฟรมเวิร์กการเล่น 2.8.x เก่าเป็น 3.0.1 ล่าสุด ในรีลีส 2.8.x แรก สิ่งนี้ใช้งานได้โดยไม่มีปัญหาใดๆ ฉันได้ตรวจสอบรหัสนี้ในเวอร์ชันเก่าหลายเวอร์ชันแล้ว รหัสนี้ใช้งานได้โดยไม่มีปัญหาใดๆ จนถึงเวอร์ชัน 2.8.11 ในเวอร์ชัน 2.8.12 (และอาจเป็นรุ่นใหม่ทั้งหมด) มันค้างตามที่อธิบายไว้ข้างต้น ดังที่ฉันเห็นในประวัติการคอมมิต มีการเปลี่ยนแปลงบางอย่างใน consolereader ระหว่างเวอร์ชันเหล่านั้น ซึ่ง อาจเกี่ยวข้องกับปัญหานี้
รหัสนี้ยังทำงานได้ดีนอกการเล่น ฉันไม่เห็น การโต้ตอบกับอินพุตหรือคอนโซลมาตรฐาน
from playframework.
Yes, it works fine in prod mode, only dev mode is affected.
The issue still occurs with sbt 1.7.2 (Play 2.8.12) and sbt 1.9.7 (Play 2.9).
We can run Play using:
echo | set /p dummyName=abc | sbt run
This passes the string "abc" (no new line, this is important) to Play input,
which satisfies the need for Play/sbt to consume some input, and jblas is working fine.
But after this Java process causes high CPU usage permanently :(
I can't fix it this myself, sbt and scala are black magic to me.
from playframework.
For the sake of completeness, can you also try sbt 1.9.9? (I don't expect it to work actually, but they did upgrade Jline in the release, so who knows)
Like said I will not prioritize this issue currently since it's "only" broken when using Windows, in dev mode, when pulling in the jblas library. Maybe someone steps up to invest time, also in case that's you I am happy to review a pull request.
Thanks for reporting anyway!
from playframework.
from playframework.
Related Issues (20)
- POST request fails with java.lang.IllegalStateException: Sink.asPublisher(fanout = false) only supports one subscriber HOT 2
- Play 2.9.0 and JDK 17.0.9 com.typesafe.sslconfig.ssl.FakeKeyStore cannot access class sun.security HOT 2
- [Feature] Add option to disable Javascript routers HOT 10
- Evolutions generated in wrong place in `PlayService` project HOT 6
- InjectedController trait not working with scala 3 HOT 9
- The link for guiding user to source in document is broken HOT 2
- COPY button in document code section would move along with the scroll bar HOT 3
- The link for Zenexity has been broken in Play Philosophy page HOT 1
- sbt-heroku plugin no longer maintained HOT 3
- `TestServer.isRunning` throws an exception when the server is not running. HOT 3
- Loss `Result` attributes by any modification HOT 4
- Requests with Large POST Body Immediately Goes into Delay Cancellation Right After the Server Received the Request HOT 6
- Caffeine cache API has inconsistent behavior with differing types and between sync/async HOT 1
- 2.9 with Scala 2.13 not supporting pack4j 6.00 dependency :Jackson Data-bind 2.15.x
- Documentation spelling fix HOT 3
- Scala 3.3.2: class file ... is broken, reading aborted with `class java.util.NoSuchElementException` `contextual$` HOT 9
- Replace `3.0.x` with next version HOT 5
- SSL certificate for www.playframework.com is expired HOT 2
- Search in documentation does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playframework.