JBake 2.6.1 File Handling Error and Fix

28 views
Skip to first unread message

David Fuchs

unread,
Aug 18, 2018, 1:39:49 PM8/18/18
to JBake Users
Hello,

  I've been running JBake 2.6.1 on Windows 10 using JDK1.8.0_181 by calling:

  C:\WORK> jbake -b -s

  Everything bakes fine, and if I change files locally, it rebakes the site.  Great.

  However, if I *view* the website at localhost:8820, and then modify a content file, I start receiving these errors when it rebakes the site:

10:32:46.286 INFO  org.jbake.app.Renderer - Rendering feed [.\public\feed.xml]... done!
10:32:46.289 ERROR org.jbake.app.Renderer - Rendering masterindex [.\public\index.html]... failed!
java.io.FileNotFoundException: .\public\index.html (The requested operation cannot be performed on a file with a user-mapped section open)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at org.jbake.app.Renderer.createWriter(Renderer.java:227)
        at org.jbake.app.Renderer.render(Renderer.java:233)
        at org.jbake.app.Renderer.renderIndex(Renderer.java:251)
        at org.jbake.render.IndexRenderer.render(IndexRenderer.java:20)
        at org.jbake.app.Oven.bake(Oven.java:155)
        at org.jbake.launcher.CustomFSChangeListener.exec(CustomFSChangeListener.java:43)
        at org.jbake.launcher.CustomFSChangeListener.fileChanged(CustomFSChangeListener.java:37)
        at org.apache.commons.vfs2.events.ChangedEvent.notify(ChangedEvent.java:32)
        at org.apache.commons.vfs2.provider.AbstractFileSystem.fireEvent(AbstractFileSystem.java:547)
        at org.apache.commons.vfs2.provider.AbstractFileSystem.fireFileChanged(AbstractFileSystem.java:515)
        at org.apache.commons.vfs2.impl.DefaultFileMonitor$FileMonitorAgent.check(DefaultFileMonitor.java:533)
        at org.apache.commons.vfs2.impl.DefaultFileMonitor$FileMonitorAgent.access$200(DefaultFileMonitor.java:367)
        at org.apache.commons.vfs2.impl.DefaultFileMonitor.run(DefaultFileMonitor.java:330)
        at java.lang.Thread.run(Thread.java:748)
10:32:46.313 INFO  org.jbake.app.Renderer - Rendering tag [.\public\tags\asciidoc.html]... done!
10:32:46.319 INFO  org.jbake.app.Renderer - Rendering tag [.\public\tags\blog.html]... done!

  I resolved the issue by replacing the jetty libraries (9.2.24.v20180105) with 9.4.11.v20180606.  I guess jetty was holding the files open or something.  Not sure if other people are getting this, but maybe an update to the jetty dependencies could make it into the project?

Thanks!
David

Jonathan Bullock

unread,
Nov 11, 2018, 5:17:29 PM11/11/18
to david.f...@gmail.com, jbake...@googlegroups.com
Hi David,

Thanks for posting about this, there is a new release for Jetty 9.2 that I'll make sure is included in JBake 2.6.4, it may or may not resolve the locking issue.

Unfortunately we can't switch to Jetty 9.4 just yet as it requires Java 8, although we're considering moving to Java 8 for 2.7.0 instead of 3.0.0

Thanks,
Jon

--
You received this message because you are subscribed to the Google Groups "JBake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbake-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages