No resource at druid-stat-interceptor请问有遇到过这个问题吗如何解决

问题:

我的项目每次启动都报这个异常,但是并不影响使用,看着很心烦,百度,谷歌无果,前来提问

异常信息

Lcom/alibaba/druid/support/spring/stat/DruidStatInterceptor;
2016-08-24 09:41:39.541:WARN::EXCEPTION java.lang.IllegalStateException: No resource at druid-stat-interceptor at org.eclipse.jetty.annotations.ResourceAnnotationHandler.handleFieldResourceAnnotationHandler.java:166 at org.eclipse.jetty.annotations.AnnotationParser$MyClassVisitor$3$1.visitEndAnnotationParser.java:375 at org.objectweb.asm.ClassReader.aUnknown Source at org.objectweb.asm.ClassReader.acceptUnknown Source at org.objectweb.asm.ClassReader.acceptUnknown Source at org.eclipse.jetty.annotations.AnnotationParser.scanClassAnnotationParser.java:595 at org.eclipse.jetty.annotations.AnnotationParser.access$000AnnotationParser.java:43 at org.eclipse.jetty.annotations.AnnotationParser$2.processEntryAnnotationParser.java:575 at org.eclipse.jetty.webapp.JarScanner.matchedJarScanner.java:152 at org.eclipse.jetty.util.PatternMatcher.matchPatternsPatternMatcher.java:82 at org.eclipse.jetty.util.PatternMatcher.matchPatternMatcher.java:64 at org.eclipse.jetty.webapp.JarScanner.scanJarScanner.java:75 at org.eclipse.jetty.annotations.AnnotationParser.parseAnnotationParser.java:587 at org.eclipse.jetty.annotations.AbstractConfiguration.parseWebInfLibAbstractConfiguration.java:107 at org.eclipse.jetty.annotations.AnnotationConfiguration.configureAnnotationConfiguration.java:69 at org.eclipse.jetty.webapp.WebAppContext.startContextWebAppContext.java:991 at org.eclipse.jetty.server.handler.ContextHandler.doStartContextHandler.java:588 at org.eclipse.jetty.webapp.WebAppContext.doStartWebAppContext.java:380 at org.mortbay.jetty.plugin.JettyWebAppContext.doStartJettyWebAppContext.java:114 at org.eclipse.jetty.util.component.AbstractLifeCycle.startAbstractLifeCycle.java:55 at org.eclipse.jetty.server.handler.HandlerCollection.doStartHandlerCollection.java:165 at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStartContextHandlerCollection.java:162 at org.eclipse.jetty.util.component.AbstractLifeCycle.startAbstractLifeCycle.java:55 at org.eclipse.jetty.server.handler.HandlerCollection.doStartHandlerCollection.java:165 at org.eclipse.jetty.util.component.AbstractLifeCycle.startAbstractLifeCycle.java:55 at org.eclipse.jetty.server.handler.HandlerWrapper.doStartHandlerWrapper.java:92 at org.eclipse.jetty.server.Server.doStartServer.java:242 at org.mortbay.jetty.plugin.JettyServer.doStartJettyServer.java:67 at org.eclipse.jetty.util.component.AbstractLifeCycle.startAbstractLifeCycle.java:55 at org.mortbay.jetty.plugin.AbstractJettyMojo.startJettyAbstractJettyMojo.java:437 at org.mortbay.jetty.plugin.AbstractJettyMojo.executeAbstractJettyMojo.java:377 at org.mortbay.jetty.plugin.JettyRunMojo.executeJettyRunMojo.java:577 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojoDefaultBuildPluginManager.java:101 at org.apache.maven.lifecycle.internal.MojoExecutor.executeMojoExecutor.java:209 at org.apache.maven.lifecycle.internal.MojoExecutor.executeMojoExecutor.java:153 at org.apache.maven.lifecycle.internal.MojoExecutor.executeMojoExecutor.java:145 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjectLifecycleModuleBuilder.java:84 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjectLifecycleModuleBuilder.java:59 at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuildLifecycleStarter.java:183 at org.apache.maven.lifecycle.internal.LifecycleStarter.executeLifecycleStarter.java:161 at org.apache.maven.DefaultMaven.doExecuteDefaultMaven.java:320 at org.apache.maven.DefaultMaven.executeDefaultMaven.java:156 at org.apache.maven.cli.MavenCli.executeMavenCli.java:537 at org.apache.maven.cli.MavenCli.doMainMavenCli.java:196 at org.apache.maven.cli.MavenCli.mainMavenCli.java:141 at sun.reflect.NativeMethodAccessorImpl.invoke0Native Method at sun.reflect.NativeMethodAccessorImpl.invokeNativeMethodAccessorImpl.java:57 at sun.reflect.DelegatingMethodAccessorImpl.invokeDelegatingMethodAccessorImpl.java:43 at java.lang.reflect.Method.invokeMethod.java:606 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhancedLauncher.java:290 at org.codehaus.plexus.classworlds.launcher.Launcher.launchLauncher.java:230 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCodeLauncher.java:409 at org.codehaus.plexus.classworlds.launcher.Launcher.mainLauncher.java:352 at org.codehaus.classworlds.Launcher.mainLauncher.java:47

使用的数据源

 <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="url" value="${datasource.mysql.databaseUrl}"/> <property name="driverClassName" value="${datasource.mysql.databaseDriver}"/> <property name="username" value="${datasource.mysql.username}"/> <property name="password" value="${datasource.mysql.password}"/> <property name="filters" value="stat"/> <property name="maxActive" value="20"/> <property name="initialSize" value="1"/> <property name="maxWait" value="60000"/> <property name="minIdle" value="1"/> <property name="timeBetweenEvictionRunsMillis" value="60000"/> <property name="minEvictableIdleTimeMillis" value="300000"/> <property name="validationQuery" value="SELECT x"/> <property name="testWhileIdle" value="true"/> <property name="testOnBorrow" value="false"/> <property name="testOnReturn" value="false"/> <property name="poolPreparedStatements" value="true"/> <property name="maxPoolPreparedStatementPerConnectionSize" value="50"/> </bean>

在github上问了无果,想到这个数据源是阿里巴巴的估计在国内提问比较靠谱。
各位大神帮忙!

你试试在webapp的配置加上metadata-complete=”true”

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" metadata-complete="true" version="2.5">

参考这篇文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注