java监听文件Error listenerStart错误

java监听文件Error listenerStart错误,第1张

最近项目中采用开启java线程来监听文件目录 在本地测试正常启动 但是当采用maven中的mvn tomcat:deploy部署到tomcat中时就报如下错误

严重: Error listenerStart    : : re StandardContext start    严重: Context [/cms] startup failed due to previous errors

: : DEBUG (cms templet TempletController: ) – >>>>监听停止了!!    : : re StandardContext listenerStop    严重: Exception sending context destroyed event to listener instance of class ut    il tools ThemePicFileListenerTools    java lang NullPointerException            at util tools ThemePicFntextDestroyed(ThemePicFileLis    tenerTools java: )            at re StandardContext listenerStop(StandardContext    java: )            at re StandardContext stop(StandardContext java:     )            at re StandardContext start(StandardContext java:     )            at re ContainerBase start(ContainerBase java: )

at re StandardHost start(StandardHost java: )            at re ContainerBase start(ContainerBase java: )

at re StandardEngine start(StandardEngine java:     )            at apache catalina startup Embedded start(Embedded java: )            at dehaus mojo tomcat AbstractRunMojo startContainer(AbstractRunMo    jo java: )            at dehaus mojo tomcat AbstractRunMojo execute(AbstractRunMojo java    : )            at apache maven plugin DefaultPluginManager executeMojo(DefaultPlugi    nManager java: )            at apache maven lifecycle DefaultLifecycleExecutor executeGoals(Defa    ultLifecycleExecutor java: )            at apache maven lifecycle DefaultLifecycleExecutor executeStandalone    Goal(DefaultLifecycleExecutor java: )            at apache maven lifecycle DefaultLifecycleExecutor executeGoal(Defau    ltLifecycleExecutor java: )            at apache maven lifecycle DefaultLifecycleExecutor executeGoalAndHan    dleFailures(DefaultLifecycleExecutor java: )            at apache maven lifecycle DefaultLifecycleExecutor executeTaskSegmen    ts(DefaultLifecycleExecutor java: )            at apache maven lifecycle DefaultLifecycleExecutor execute(DefaultLi    fecycleExecutor java: )            at apache maven DefaultMaven doExecute(DefaultMaven java: )            at apache maven DefaultMaven execute(DefaultMaven java: )            at apache maven cli MavenCli main(MavenCli java: )            at sun reflect NativeMethodAccessorImpl invoke (Native Method)            at sun reflect NativeMethodAccessorImpl invoke(NativeMethodAccessorImpl     java: )            at sun reflect DelegatingMethodAccessorImpl invoke(DelegatingMethodAcces    sorImpl java: )            at java lang reflect Method invoke(Method java: )            at dehaus classworlds Launcher launchEnhanced(Launcher java: )            at dehaus classworlds Launcher launch(Launcher java: )            at dehaus classworlds Launcher mainWithExitCode(Launcher java: )

at dehaus classworlds Launcher main(Launcher java: )

这个错误让我郁闷了好久 最后找到错误原因 是因为监听的文件夹下面没有内容 maven在发布项目的时候侯就不创建此文件夹 当程序启动的时候 找不到此目录 此时监听就会停止 报以上错误

lishixinzhi/Article/program/Java/hx/201311/26397

java在linux上监听不到文件的原因可能是文件系统与Java程序访问权限不匹配。文件系统的权限应该与Java程序在Linux上运行的权限相同,否则Java程序将无法访问文件系统。另外,检查一下文件的路径是否正确,是否存在文件名大小写错误的情况。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11527809.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存