Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pebble package name change in version 3.2.0 #18

Open
TTNO1 opened this issue Mar 18, 2023 · 5 comments
Open

Pebble package name change in version 3.2.0 #18

TTNO1 opened this issue Mar 18, 2023 · 5 comments

Comments

@TTNO1
Copy link

TTNO1 commented Mar 18, 2023

In version 3.2.0, Pebble changed its package names from com.mitchellbosecke to io.pebbletemplates, and now the newest version of Pebble is incompatible with Javalin.

To Reproduce
The line,
JavalinPebble.init(new PebbleEngine.Builder().build());
causes errors.

@zugazagoitia
Copy link
Member

zugazagoitia commented Mar 18, 2023

From what I see we're not using that version in javalin-rendering, but I'll leave this open so we can fix it when we upgrade.

@tipsy can you move this issue to the other repo?


From their repo:

Breaking changes in version 3.2.x

  • Rename package from com.mitchellbosecke to io.pebbletemplates
  • Change default suffix to .peb instead of .pebble in spring boot autoconfiguration
  • Rename method getInstance to createInstance in BinaryOperator interface

@tipsy tipsy transferred this issue from javalin/javalin Mar 18, 2023
@tipsy
Copy link
Member

tipsy commented Mar 18, 2023

Thanks @zugazagoitia, done.

@noraj
Copy link

noraj commented Nov 6, 2023

Pebble 3.2.0 with javalin-rendering 5.6.2

        app.get("/test", ctx -> {
            ctx.render("test.peb", TemplateUtil.model("firstName", "John", "lastName", "Doe"));
        });

results in

java.lang.IllegalArgumentException: No Renderer registered for extension '.pebble'.
        at io.javalin.rendering.JavalinRenderer.renderBasedOnExtension(JavalinRenderer.kt:32)
        at io.javalin.rendering.LegacyFileRenderer.render(JavalinRenderer.kt:20)
        at io.javalin.http.Context.render(Context.kt:452)
        at fr.acceis.formation.idor.java.HelloWorld.lambda$main$3(HelloWorld.java:27)
        at io.javalin.routing.HandlerEntry.handle(HandlerEntry.kt:19)
        at io.javalin.http.servlet.DefaultTasks.HTTP$lambda$8$lambda$6$lambda$5(DefaultTasks.kt:39)
        at io.javalin.http.servlet.JavalinServlet.handleTask(JavalinServlet.kt:88)
        at io.javalin.http.servlet.JavalinServlet.handleSync(JavalinServlet.kt:53)
        at io.javalin.http.servlet.JavalinServlet.service(JavalinServlet.kt:41)
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
        at io.javalin.jetty.JavalinJettyServlet.service(JavalinJettyServlet.kt:58)
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:529)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1381)
        at io.javalin.jetty.JettyServer$start$wsAndHttpHandler$1.doHandle(JettyServer.kt:61)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1303)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:173)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
        at org.eclipse.jetty.server.Server.handle(Server.java:563)
        at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
        at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.lang.VirtualThread.run(VirtualThread.java:311)

And adding JavalinRenderer.register(new JavalinPebble(), ".peb", ".pebble"); will solve this but trigger

Exception in thread "main" java.lang.NoClassDefFoundError: com/mitchellbosecke/pebble/PebbleEngine$Builder                                                                                                           
        at io.javalin.rendering.template.JavalinPebble$Companion.defaultPebbleEngine(JavalinPebble.kt:39)                                                                                                            
        at io.javalin.rendering.template.JavalinPebble$Companion.access$defaultPebbleEngine(JavalinPebble.kt:29)                                                                                                     
        at io.javalin.rendering.template.JavalinPebble.<init>(JavalinPebble.kt:19)                                                                                                                                   
        at io.javalin.rendering.template.JavalinPebble.<init>(JavalinPebble.kt)                                                                                                                                      
        at fr.acceis.formation.idor.java.HelloWorld.main(HelloWorld.java:27)                                                                                                                                         
Caused by: java.lang.ClassNotFoundException: com.mitchellbosecke.pebble.PebbleEngine$Builder                                                                                                                         
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)                                                                                                                   
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)                                                                                                                
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)                                                                                                                                           
        ... 5 more    

I see in the main branch for Javalin 6 that it still requires com.mitchellbosecke.pebble. So that's not planned for version 6 either?

@tipsy
Copy link
Member

tipsy commented Nov 6, 2023

I see in the main branch for Javalin 6 that it still requires com.mitchellbosecke.pebble. So that's not planned for version 6 either?

The main branch is still under active development, we'll try to get everything in order before release.

@gilberto-009199
Copy link

Thanks, I wait alter com.mitchellbosecke.pebble for io.pebbletemplates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants