最近项目中采用开启java线程来监听文件目录在本地测试正常启动但是当采用maven中的mvn tomcat:deploy部署到tomcat中时就报如下错误
严重: Error listenerStart
:: orgreStandardContext start
严重: Context [/cms] startup failed due to previous errors
:: DEBUG (cmstempletTempletController:) – >>>>监听停止了!!
:: orgreStandardContext listenerStop
严重: Exception sending context destroyed event to listener instance of class ut
iltoolsThemePicFileListenerTools
javalangNullPointerException
at utiltoolsThemePicFntextDestroyed(ThemePicFileLis
tenerToolsjava:)
at orgreStandardContextlistenerStop(StandardContext
java:)
at orgreStandardContextstop(StandardContextjava:
)
at orgreStandardContextstart(StandardContextjava:
)
at orgreContainerBasestart(ContainerBasejava:)
at orgreStandardHoststart(StandardHostjava:)
at orgreContainerBasestart(ContainerBasejava:)
at orgreStandardEnginestart(StandardEnginejava:
)
at orgapachecatalinastartupEmbeddedstart(Embeddedjava:)
at dehausmojotomcatAbstractRunMojostartContainer(AbstractRunMo
jojava:)
at dehausmojotomcatAbstractRunMojoexecute(AbstractRunMojojava
:)
at orgapachemavenpluginDefaultPluginManagerexecuteMojo(DefaultPlugi
nManagerjava:)
at orgapachemavenlifecycleDefaultLifecycleExecutorexecuteGoals(Defa
ultLifecycleExecutorjava:)
at orgapachemavenlifecycleDefaultLifecycleExecutorexecuteStandalone
Goal(DefaultLifecycleExecutorjava:)
at orgapachemavenlifecycleDefaultLifecycleExecutorexecuteGoal(Defau
ltLifecycleExecutorjava:)
at orgapachemavenlifecycleDefaultLifecycleExecutorexecuteGoalAndHan
dleFailures(DefaultLifecycleExecutorjava:)
at orgapachemavenlifecycleDefaultLifecycleExecutorexecuteTaskSegmen
ts(DefaultLifecycleExecutorjava:)
at orgapachemavenlifecycleDefaultLifecycleExecutorexecute(DefaultLi
fecycleExecutorjava:)
at orgapachemavenDefaultMavendoExecute(DefaultMavenjava:)
at orgapachemavenDefaultMavenexecute(DefaultMavenjava:)
at orgapachemavencliMavenClimain(MavenClijava:)
at sunreflectNativeMethodAccessorImplinvoke(Native Method)
at sunreflectNativeMethodAccessorImplinvoke(NativeMethodAccessorImpl
java:)
at sunreflectDelegatingMethodAccessorImplinvoke(DelegatingMethodAcces
sorImpljava:)
at javalangreflectMethodinvoke(Methodjava:)
at dehausclassworldsLauncherlaunchEnhanced(Launcherjava:)
at dehausclassworldsLauncherlaunch(Launcherjava:)
at dehausclassworldsLaunchermainWithExitCode(Launcherjava:)
at dehausclassworldsLaunchermain(Launcherjava:)
这个错误让我郁闷了好久最后找到错误原因是因为监听的文件夹下面没有内容maven在发布项目的时候侯就不创建此文件夹当程序启动的时候找不到此目录此时监听就会停止报以上错误
解决办法把监听的目录下面加上相关的内容利用maven发布版本的时候就可以创建监听文件夹或在tomcat的工程下面手工创建监听文件即可