leiningen

Takis_ 2024-04-02T15:53:05.369379Z

i made a spring boot webflux hello world, lein run works fine, but when i do lein uberjar and the java -jar my-standalone.jar doesn't work

Takis_ 2024-04-02T15:54:09.772979Z

can leiningen make uberjars for spring-boot? i should do something extra to make it work?

Takis_ 2024-04-02T15:54:53.179769Z

java -jar demo-lein-0.1.0-SNAPSHOT-standalone.jar 

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.3)

18:54:19.529 [main] INFO com.example.demo.DemoApplication -- Starting DemoApplication using Java 17.0.10 with PID 24345 (/home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein/demo-lein-0.1.0-SNAPSHOT-standalone.jar started by white in /home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein)
18:54:19.534 [main] INFO com.example.demo.DemoApplication -- No active profile set, falling back to 1 default profile: "default"
18:54:20.866 [main] INFO com.example.demo.DemoApplication -- Started DemoApplication in 1.552 seconds (process running for 1.879)

and then terminates, looks like Netty doesn't start at all

Takis_ 2024-04-02T15:56:06.576509Z

lein run
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.3)

2024-04-02T18:55:28.314+03:00  INFO 24408 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 17.0.10 with PID 24408 (/home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein/target/classes started by white in /home/white/IdeaProjects/java-spring/java-spring-uberjar/demo-lein)
2024-04-02T18:55:28.317+03:00  INFO 24408 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to 1 default profile: "default"
2024-04-02T18:55:29.629+03:00  INFO 24408 --- [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 8080
2024-04-02T18:55:29.644+03:00  INFO 24408 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.729 seconds (process running for 2.811)

this is ok, server listens on 8080

Takis_ 2024-04-02T16:11:54.329249Z

MRE : https://github.com/tkaryadis/demo-lein

Omer ZAK 2024-04-02T16:30:31.362299Z

404

seancorfield 2024-04-02T16:34:58.399669Z

Looks like the correct link is https://github.com/tkaryadis/demo-leiningen-webflux

seancorfield 2024-04-02T16:35:08.326299Z

Oh, except that's empty...

seancorfield 2024-04-02T16:35:41.811059Z

@takis_ Maybe you didn't push the code, or the repo is private?

Takis_ 2024-04-02T16:38:09.242159Z

no i am sorry https://github.com/tkaryadis/demo-lein , i forgot to make it public

Takis_ 2024-04-02T16:38:13.102459Z

now its ok, i will be back in 30 min i have to do something, thank you for trying to help me, first time i tried uberjar with spring-webflux

seancorfield 2024-04-02T17:22:29.271759Z

I had a look and I don't know why it works with lein run but fails to start Netty when bundled as a JAR...

Takis_ 2024-04-02T17:56:46.963859Z

thank you for trying to help me. maybe someone will know, also i wonder leiningen and spring can be used? or i have to use something like clojurephant and gradle? i use webflux and HTMX development with lein it was very easy, only the uberjar problem