question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ctx.render() doesn't work from "java -jar"

See original GitHub issue

Describe the bug

The ctx.render() method, as shown in the following code:

public static void main(String[] args) {
    Blade.of()
	 .get("/", ctx -> ctx.render("index.html"))
	 .start(Application.class, args);
}

it DOES work when run from the IDE (Run as Java Application from Eclipse) it DOES NOT work when run from the CLI (java -jar target\blade-app.jar)

To Reproduce

Run the attached package with java -jar.

app.zip

Screenshots

From CLI it doesn’t work: immagine

From Eclipse it works:

immagine

Additional context

I suspect everything is bound to the app.classpath.

Run with the IDE:

c.b.s.n.NettyServer : app.classpath    => C:/Users/a.ligios/git/blade/app/target/classes/

Run with java -jar:

c.b.s.n.NettyServer : app.classpath    => C:\Users\a.ligios\git\blade\app\target\blade-app.jar 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hellokatoncommented, Dec 10, 2018

@andrea-ligios The 2.0.13.ALPHA version of the Windows system works.

0reactions
andrea-ligioscommented, Dec 10, 2018

Perfect! Thank you @biezhi

Read more comments on GitHub >

github_iconTop Results From Across the Web

ctx.render doesn't redirect the page - Stack Overflow
I want to put jwt data into pug file but when I send get request, the page only just refreshes itself and doesn't...
Read more >
Documentation - A lightweight Java and Kotlin web framework
Javalin - A lightweight Java and Kotlin web framework. Create REST APIs in Java or Kotlin easily.
Read more >
Developer Guide - Apache Velocity Engine
Velocity is a Java-based template engine, a simple and powerful development tool that allows you to easily create and render documents that format...
Read more >
Spring Boot Memory Performance
A completely minimal Spring Boot application including Spring and some logging but no web server would be around 5MB of jars. JVM Tools....
Read more >
Can't open .jar files using Java 17, please help!
I tried reinstalling Java 17, and it still didn't work. When I clicked open with>choose another app>more apps>look for another app on this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found