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