线程“Timer-O”中的异常java.langllegalStateException:此操作是仅允许事件线程
Exception in thread "Timer-0" java.lang.IllegalStateException: This operation is permitted on the event thread only; currentThread = Timer-0
at com.sun.glass.ui.Application.checkEventThread(Unknown Source)
at com.sun.glass.ui.Window.setTitle(Unknown Source)
at com.sun.javafx.tk.quantum.WindowStage.setTitle(Unknown Source)
at javafx.stage.Stage$5.invalidated(Unknown Source)
at javafx.beans.property.StringPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.StringPropertyBase.set(Unknown Source)
at javafx.beans.property.StringPropertyBase.set(Unknown Source)
at javafx.stage.Stage.setTitle(Unknown Source)
at Program5$6$1.run(Program5.java:197)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
解决办法:
在 tomcat 路径下找到work\Catalina\localhost
→→ 删除对应的 文件(如果找不到具体文件可删除 localhoost 目录下的所有文件)→→ 重启项目就解决了。