Eclipse 4.7.0中的Tomcat 8.5没有看到更改的HTML文件 [英] Tomcat 8.5 in Eclipse 4.7.0 not seeing changed HTML files

查看:139
本文介绍了Eclipse 4.7.0中的Tomcat 8.5没有看到更改的HTML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有Windows 10 Pro 64位版本,Tomcat 8.5版本.6安装在 C:\bin\tomcat 中。我正在运行Eclipse Java EE 4.7.0,它安装在 D:\ bin\eclipse (一个单独的卷)中。 Tomcat已被添加为8.5服务器。我的工作区位于 D:\workspace 中。我在 D:\workspace\project 中有一个Maven web应用程序,HTML文件 index.html 位于的src /主/ web应用。我的项目启用了动态Web模块3.1方面。我在服务器选项卡中添加了本地主机上的Tomcat v8.5服务器,并且已将我的项目添加到服务器。我在浏览器中关闭了缓存。



通过上述配置,在机器上 laptop1 服务器,我可以通过 localhost 在浏览器中访问我的 index.html 。如果我编辑了 index.html ,只要我保存它,Tomcat就会很快显示出需要发布的文件,然后自动发布已更改的文件。我可以刷新浏览器并立即查看更改后的HTML文件。我在这个开发环境中工作了六到九个月。



我配置了一台几乎相同的机器 laptop2 与之前一样,在 C:\bin\tomcat 中使用相同版本的Tomcat。我将音量 D:连接到 laptop2 。我建立了这个项目并开始了Tomcat。我可以打开浏览器并通过 localhost 查看 index.html



但现在,如果我编辑 index.html ,即使在Eclipse中,也不会在浏览器中显示。




  • 我已经使用F5刷新了项目树。
  • 我已经验证了 src / main / webapp /index.html 包含新内容并更新了时间戳。
  • target / m2e-wtp中文件的内容和时间戳/ web-resources 在编辑 index.html 后不会更改,即使我重新启动服务器。

  • 我已经从Eclipse中的服务器中删除并重新添加了Web应用程序,而且行为没有变化。
  • 我已经删除并重新添加了Tomcat v8.5 Server 服务器选项卡,但行为没有变化。
  • 我从Eclipse中删除并重新添加了Apache Tomcat v8.5运行时环境,而且行为没有任何变化。 / li>
  • 我已完全禁用Windows De为 laptop1 laptop2

使用组策略编辑器

我不知道还有什么可以检查的。我不知道从一个系统移动到另一个系统是否与Tomcat停止识别和发布文件更改有关。 解决方案

不知何故,自动构建已被禁用。



是的,所有这些问题的根源在于Eclipse中的某些选项 Project> Build Automatically 已被关闭。我不知道如何。我不知道什么时候。但是一旦重新启用,所有事情都会像以前一样再次开始工作。



我可能会在更早或更晚的时候发现它,但是我偶然发现回答另一个问题,其中@mico提到了这一点。我很感激。

Tomcat in Eclipse is ignoring source HTML changes and not publishing them, even though it worked fine before.

I have Windows 10 Pro 64-bit, with Tomcat 8.5.6 installed in C:\bin\tomcat. I am running Eclipse Java EE 4.7.0, installed in D:\bin\eclipse (a separate volume). Tomcat has been added as an 8.5 server. My workspace is in D:\workspace . I have a Maven web application in D:\workspace\project, with HTML file index.html in src/main/webapp. My project has the "Dynamic Web Module 3.1" facet enabled. I have added a "Tomcat v8.5 Server at localhost" in the "Servers" tab, and I have added my project to the server. I have turned off caching in my browser.

With the above configuration, on the machine laptop1 I would start the server and I could access my index.html in a browser via localhost. If I edited index.html, as soon as I saved it Tomcat would quickly show that the files needed publishing, and then would auto-publish the changed file. I could refresh the browser and see the changed HTML file immediately. I worked in this development environment for six to nine months.

I configured a virtually identical machine laptop2 by installing the same version of Tomcat in C:\bin\tomcat as before. I connected the volume D: to laptop2. I built the project and started Tomcat. I was able to open the browser and see index.html via localhost.

But now if I edit index.html, even inside Eclipse, the changes do not show up in the browser.

  • I have used F5 to refresh the project tree.
  • I have verified that src/main/webapp/index.html has new content and has its timestamp updated.
  • The content and timestamp of the files in target/m2e-wtp/web-resources do not change after editing index.html, even if I restart the server.
  • I have removed and re-added the web app from the server in Eclipse, with no change in behavior.
  • I have removed and re-added the "Tomcat v8.5 Server" from the "Server" tab, with no change in behavior.
  • I have removed and re-added the "Apache Tomcat v8.5" runtime environment from Eclipse, with no change in behavior.
  • I have completely disabled Windows Defender using the group policy editor for both laptop1 and laptop2.

I am at a loss to think of what else I could check. I do not know if moving from one system to the other had anything to do with Tomcat stopping recognizing and publishing file changes.

解决方案

Somehow "Build Automatically" had been disabled.

Yes, the source of all these problems is that somehow in Eclipse the option Project > Build Automatically had been turned off. I don't know how. I don't know when. But once re-enabled, everything started working again exactly as it had been before.

I probably would have found this sooner or (much) later, but I stumbled across an answer to another question in which @mico mentioned this in passing. I am grateful.

这篇关于Eclipse 4.7.0中的Tomcat 8.5没有看到更改的HTML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆