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.

Unable to resolve vue resources running Javalin from gradle distTar

See original GitHub issue

Hi

I’ve upgraded to javalin 5.

When I dist up my javalin server into a tarball (./gradlew clean check distTar), extract it, run it and try and serve a page in non-dev mode, I see the following error:

[JettyServerThreadPool-25] WARN io.javalin.Javalin - Uncaught exception java.nio.file.NoSuchFileException: /vue at jdk.zipfs/jdk.nio.zipfs.ZipPath.getAttributes(ZipPath.java:742) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:292) at java.base/java.nio.file.Files.readAttributes(Files.java:1764) at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219) at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276) at java.base/java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322) at java.base/java.nio.file.FileTreeIterator.<init>(FileTreeIterator.java:71) at java.base/java.nio.file.Files.walk(Files.java:3825) at io.javalin.vue.VuePathMaster.walkPaths(VuePathMaster.kt:21) at io.javalin.vue.VuePathMaster$cachedPaths$2.invoke(VuePathMaster.kt:18) at io.javalin.vue.VuePathMaster$cachedPaths$2.invoke(VuePathMaster.kt:18) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at io.javalin.vue.VuePathMaster.getCachedPaths$javalin(VuePathMaster.kt:18) at io.javalin.vue.VueHandler.handle(VueHandler.kt:23) at io.javalin.routing.HandlerEntry.handle(HandlerEntry.kt:19) at io.javalin.http.servlet.DefaultTasks.HTTP$lambda-8$lambda-6$lambda-5(DefaultTasks.kt:38) at io.javalin.http.servlet.JavalinServlet.handleTask(JavalinServlet.kt:86) 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:1571) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221) at io.javalin.jetty.JettyServer$start$wsAndHttpHandler$1.doHandle(JettyServer.kt:57) 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:1544) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1302) 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.lambda$handle$0(HttpChannel.java:505) at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282) 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 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:933) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1077) at java.base/java.lang.Thread.run(Thread.java:829)

I’ve been through new doco and examples to try and figure out what’s missing and I can see my app jar containing the vue resource dir therein referenced by the classpath in the gradle generated start script. I’m at somewhat of a loss as to why the vue resources are failing to resolve from the classpath when javalin needs to serve a VueComponent.

I whittled down one of the published javalin 5 examples into an example repo to illustrate the problem:

https://github.com/bensullivan/javalinvue-example

Any help/clues would be greatly appreciated.

Thanks!

Ben

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
bensullivancommented, Dec 1, 2022

Thanks so much fellas - massive help!

0reactions
tipsycommented, Nov 30, 2022

DistTar is actually not building a Jar, but rather generating a tar file containing a folder structure with different Jars, for each dependency.

Then it sounds like everything is working as expected. It’s hard for Javalin to automatically know where to look for resources in this case, which is why the class config exists.

I think we can close this now, and rather open a new issue if we want to try to improve this behavior.

Thanks @zugazagoitia, great work !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't resolve plugins from plugin repository after Gradle 4.3 ...
When running my build, plugins declared in the plugins closure should be resolved from the Gradle Plugins Repository.
Read more >
Documentation - A lightweight Java and Kotlin web framework
4: Specify android.enableD8=true in your gradle.properties file. Concurrency. By default, Javalin serves requests using a Jetty QueuedThreadPool ...
Read more >
Gradle 'unable to resolve class' error from build script compile ...
I'm having trouble loading a custom jar dependency from my local maven repository. References to classes in the jar always cause the build ......
Read more >
Vue 3 - "Failed to resolve component" with global components
Registering components in the root component's components option doesn't make them global. Doing that just makes them available to the root ...
Read more >
Javalin javalin Issues - Giters
Javalin javalin: A simple and modern Java and Kotlin web framework. ... Unable to resolve vue resources running Javalin from gradle distTar.
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