web-dev-qa-db-fra.com

java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log (Lorg / slf4j / Marker; Ljava / lang / String; ILjava / lang / String; [Ljava / lang / Obje

Je suis un débutant avec maven, printemps, glassfish intégré, conflits de dépendance (je ne sais pas comment les voir et comment les résoudre) ... et je ne peux pas résoudre ce problème seul, même si j'ai passé des heures essayer.

Je ne rencontre pas ce problème avec Tomcat7 intégré mais je le fais avec Glassfish intégré

J'exécute "Exécuter la configuration" depuis Eclipse avec

  • un runtime maven intégré 3.0.4/1.4.0,
  • objectifs: package propre intégré-glassfish: exécuter
  • jre: jdk-7u51

Merci d'avoir consacré du temps à résoudre le problème.

 Grave: WebModule[/myapp]StandardWrapper.Throwable
Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.Apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.Java:159)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.Java:453)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.Java:138)
    at javax.servlet.GenericServlet.init(GenericServlet.Java:244)
    at org.Apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.Java:1444)
    at org.Apache.catalina.core.StandardWrapper.load(StandardWrapper.Java:1241)
    at org.Apache.catalina.core.StandardContext.loadOnStartup(StandardContext.Java:5093)
    at org.Apache.catalina.core.StandardContext.start(StandardContext.Java:5380)
    at com.Sun.enterprise.web.WebModule.start(WebModule.Java:498)
    at org.Apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.Java:917)
    at org.Apache.catalina.core.ContainerBase.addChild(ContainerBase.Java:901)
    at org.Apache.catalina.core.StandardHost.addChild(StandardHost.Java:733)
    at com.Sun.enterprise.web.WebContainer.loadWebModule(WebContainer.Java:2000)
    at com.Sun.enterprise.web.WebContainer.loadWebModule(WebContainer.Java:1651)
    at com.Sun.enterprise.web.WebApplication.start(WebApplication.Java:109)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.Java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.Java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.Java:294)
    at com.Sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.Java:462)
    at com.Sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.Java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.Java:382)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.Java:355)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.Java:370)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.Java:1064)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.Java:96)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.Java:1244)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.Java:1232)
    at com.Sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.Java:129)
    at com.Sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.Java:105)
    at org.glassfish.maven.PluginUtil.doDeploy(PluginUtil.Java:106)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at org.glassfish.maven.AbstractDeployMojo.doDeploy(AbstractDeployMojo.Java:239)
    at org.glassfish.maven.RunMojo.execute(RunMojo.Java:68)
    at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:101)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:209)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)
    at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:84)
    at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:59)
    at org.Apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.Java:183)
    at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:161)
    at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:320)
    at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:156)
    at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:537)
    at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:196)
    at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:141)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:352)

janv. 26, 2014 12:03:54 PM com.Sun.enterprise.web.VirtualServer$1 log
Grave: WebModule[/myapp]PWC1396: Servlet /myapp threw load() exception
Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.Apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.Java:159)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.Java:453)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.Java:138)
    at javax.servlet.GenericServlet.init(GenericServlet.Java:244)
    at org.Apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.Java:1444)
    at org.Apache.catalina.core.StandardWrapper.load(StandardWrapper.Java:1241)
    at org.Apache.catalina.core.StandardContext.loadOnStartup(StandardContext.Java:5093)
    at org.Apache.catalina.core.StandardContext.start(StandardContext.Java:5380)
    at com.Sun.enterprise.web.WebModule.start(WebModule.Java:498)
    at org.Apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.Java:917)
    at org.Apache.catalina.core.ContainerBase.addChild(ContainerBase.Java:901)
    at org.Apache.catalina.core.StandardHost.addChild(StandardHost.Java:733)
    at com.Sun.enterprise.web.WebContainer.loadWebModule(WebContainer.Java:2000)
    at com.Sun.enterprise.web.WebContainer.loadWebModule(WebContainer.Java:1651)
    at com.Sun.enterprise.web.WebApplication.start(WebApplication.Java:109)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.Java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.Java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.Java:294)
    at com.Sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.Java:462)
    at com.Sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.Java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.Java:382)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.Java:355)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.Java:370)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.Java:1064)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.Java:96)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.Java:1244)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.Java:1232)
    at com.Sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.Java:129)
    at com.Sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.Java:105)
    at org.glassfish.maven.PluginUtil.doDeploy(PluginUtil.Java:106)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at org.glassfish.maven.AbstractDeployMojo.doDeploy(AbstractDeployMojo.Java:239)
    at org.glassfish.maven.RunMojo.execute(RunMojo.Java:68)
    at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:101)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:209)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)
    at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:84)
    at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:59)
    at org.Apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.Java:183)
    at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:161)
    at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:320)
    at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:156)
    at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:537)
    at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:196)
    at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:141)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:352)

janv. 26, 2014 12:03:54 PM org.Apache.catalina.core.StandardContext start
Grave: PWC1306: Startup of context /myapp failed due to previous errors
janv. 26, 2014 12:03:54 PM com.Sun.enterprise.web.VirtualServer$1 log
Infos: PWC1412: WebModule[null] ServletContext.log():Destroying Spring FrameworkServlet 'mvc-dispatcher'
janv. 26, 2014 12:03:54 PM org.Apache.catalina.core.ContainerBase addChildInternal
Grave: ContainerBase.addChild: start: 
org.Apache.catalina.LifecycleException: org.Apache.catalina.LifecycleException: Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.Apache.catalina.core.StandardContext.start(StandardContext.Java:5389)
    at com.Sun.enterprise.web.WebModule.start(WebModule.Java:498)
    at org.Apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.Java:917)
    at org.Apache.catalina.core.ContainerBase.addChild(ContainerBase.Java:901)
    at org.Apache.catalina.core.StandardHost.addChild(StandardHost.Java:733)
    at com.Sun.enterprise.web.WebContainer.loadWebModule(WebContainer.Java:2000)
    at com.Sun.enterprise.web.WebContainer.loadWebModule(WebContainer.Java:1651)
    at com.Sun.enterprise.web.WebApplication.start(WebApplication.Java:109)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.Java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.Java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.Java:294)
    at com.Sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.Java:462)
    at com.Sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.Java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.Java:382)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.Java:355)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.Java:370)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.Java:1064)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.Java:96)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.Java:1244)
    at com.Sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.Java:1232)
    at com.Sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.Java:129)
    at com.Sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.Java:105)
    at org.glassfish.maven.PluginUtil.doDeploy(PluginUtil.Java:106)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at org.glassfish.maven.AbstractDeployMojo.doDeploy(AbstractDeployMojo.Java:239)
    at org.glassfish.maven.RunMojo.execute(RunMojo.Java:68)
    at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:101)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:209)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)
    at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)
    at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:84)
    at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:59)
    at org.Apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.Java:183)
    at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:161)
    at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:320)
    at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:156)
    at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:537)
    at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:196)
    at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:141)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:352)
Caused by: org.Apache.catalina.LifecycleException: Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.Apache.catalina.core.StandardContext.loadOnStartup(StandardContext.Java:5103)
    at org.Apache.catalina.core.StandardContext.start(StandardContext.Java:5380)
    ... 49 more
Caused by: Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.Apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.Java:159)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.Java:453)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.Java:138)
    at javax.servlet.GenericServlet.init(GenericServlet.Java:244)
    at org.Apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.Java:1444)
    at org.Apache.catalina.core.StandardWrapper.load(StandardWrapper.Java:1241)
    at org.Apache.catalina.core.StandardContext.loadOnStartup(StandardContext.Java:5093)
    ... 50 more

janv. 26, 2014 12:03:54 PM org.glassfish.api.ActionReport failure
Grave: Exception while loading the app
janv. 26, 2014 12:03:55 PM org.glassfish.deployment.admin.DeployCommand execute
Grave: Exception while loading the app : Java.lang.IllegalStateException: ContainerBase.addChild: start: org.Apache.catalina.LifecycleException: org.Apache.catalina.LifecycleException: Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
PlainTextActionReporterFAILUREDescription: deploy AdminCommandError occurred during deployment: Exception while loading the app : Java.lang.IllegalStateException: ContainerBase.addChild: start: org.Apache.catalina.LifecycleException: org.Apache.catalina.LifecycleException: Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V. Please see server.log for more details.
    [name=myapp
janv. 26, 2014 12:03:56 PM PluginUtil doDeploy
Infos: Deployed null
Hit ENTER to redeploy, X to exit

enter image description here

enter image description here

enter image description here

m2e: 1.4.0.201

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.Apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.Apache.org/POM/4.0.0 
http://maven.Apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.marc</groupId>
<artifactId>spring-mvc-3</artifactId>
<name>spring-mvc-3</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>

<properties>
    <Java-version>1.6</Java-version>
    <org.springframework-version>3.2.0.RELEASE</org.springframework-version>
    <org.aspectj-version>1.6.10</org.aspectj-version>
    <org.slf4j-version>1.7.5</org.slf4j-version>
</properties>

<dependencies>
    <!-- Spring -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${org.springframework-version}</version>
        <exclusions>
            <!-- Exclude Commons Logging in favor of SLF4j -->
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
             </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>
    <!-- AspectJ -->
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>${org.aspectj-version}</version>
    </dependency>   

    <!-- Logging -->

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${org.slf4j-version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${org.slf4j-version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${org.slf4j-version}</version>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
        <scope>runtime</scope>
    </dependency>

    <!-- @Inject -->
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>

    <!-- Servlet -->
    <!--
    <dependency>
        <groupId>org.Apache.Tomcat</groupId>
        <artifactId>Tomcat-servlet-api</artifactId>
        <version>7.0.30</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp.jstl</groupId>
        <artifactId>jstl-api</artifactId>
        <version>1.2</version>
        <exclusions>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.glassfish.web</groupId>
        <artifactId>jstl-impl</artifactId>
        <version>1.2</version>
        <exclusions>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    -->
    <!-- Jackson JSON Processor -->
    <!--
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.8.1</version>
    </dependency>
    -->
    <!-- Rome Atom+RSS -->
    <!--
    <dependency>
        <groupId>net.Java.dev.rome</groupId>
        <artifactId>rome</artifactId>
        <version>1.0.0</version>
    </dependency>
    -->
    <!-- JSR 303 with Hibernate Validator -->
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.0.0.GA</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>5.0.2.Final</version>
    </dependency>

    <!--  MYSQL driver-->
<!--        <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-Java</artifactId>
        <version>5.1.27</version>
    </dependency> -->

    <!-- JDBC -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>

    <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>20030825.184428</version>
    </dependency>




    <!-- Joda Time Library -->  
    <!--
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>1.6.2</version>
    </dependency>
    -->
    <!-- Test -->
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>

    <!--
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${org.springframework-version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>Spring Milestone</id>
        <url>http://maven.springframework.org/milestone</url>
    </repository>
</repositories>

<build>
<finalName>spring-mvc-3</finalName>
<plugins>       
    <!--  embedded glassfish plugin -->

  <plugin>
    <groupId>org.glassfish</groupId>
    <artifactId>maven-embedded-glassfish-plugin</artifactId>
    <version>3.1.1</version>
    <configuration>
        <glassfishDirectory>${local.glassfish.home}</glassfishDirectory>
        <user>admin</user>
        <passwordFile>${local.glassfish.passfile}</passwordFile>
        <domain>
            <name>domain1</name>
            <httpPort>8080</httpPort>
            <adminPort>4848</adminPort>
            <resources>
                <jdbcDataSource>
                    <name>jdbc/TestDB</name>
                    <type>connectionPoolDataSource</type>
                    <poolName>SomePool</poolName>
         <className>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</className>
                    <description>Some JDBC Connection Pool</description>
                    <allowNonComponentCallers>false</allowNonComponentCallers>
                    <validateConnections>true</validateConnections>
                    <validationMethod>metaData</validationMethod>
                    <properties>
                        <property>
                            <name>portNumber</name>
                            <value>3306</value>
                        </property>
                        <property>
                            <name>password</name>
                            <value>xxxxxx</value>
                        </property>
                        <property>
                            <name>user</name>
                            <value>xxx</value>
                        </property>
                        <property>
                            <name>serverName</name>
                            <value>localhost</value>
                        </property>
                        <property>
                            <name>databaseName</name>
                            <value>xxxx</value>
                        </property>
                    </properties>
                </jdbcDataSource>
            </resources>
        </domain>
        <components>
            <component>
                <name>${project.artifactId}</name>
                <artifact>target/${project.build.finalName}.war</artifact>
            </component>
        </components>
        <debug>true</debug>
        <terse>false</terse>
        <echo>true</echo>
    </configuration>         

<!--         <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-Java</artifactId> driver mysql
            <version>5.1.27</version>
        </dependency>
    </dependencies> -->
  </plugin>

    <!-- Maven compiler plugin -->
    <plugin>
        <groupId>org.Apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <source>${Java-version}</source>
            <target>${Java-version}</target>
        </configuration>
    </plugin>
</plugins>

enter image description here

13
user3178994

question plus ancienne, mais qui mérite quand même d'être répondu ... Dans Eclipse, ouvrez le fichier pom.xml du projet. Lorsqu'il s'ouvre, sélectionnez l'onglet Hiérarchie des dépendances en bas. Ici, vous verrez ce qui se charge et d'où il est appelé. Dans le filtre de recherche, tapez le nom (ou une partie du nom) de la dépendance qui, selon vous, est en conflit, par exemple, vous pouvez mettre "slf4j" et voir toutes les dépendances qui dépendent de slf4j pour la journalisation. Si vous faites un clic droit sur une dépendance, vous pouvez choisir de l'exclure dans le fichier pom. Lorsque vous enregistrez le fichier pom.xml, vous verrez la modification de la hiérarchie des dépendances. Vous pouvez tester à nouveau votre application et voir si vous avez résolu votre problème, ou exclu la mauvaise version, etc.

La seule mise en garde à cela est que si vous souhaitez remettre la dépendance que vous avez exclue, vous devez basculer vers l'onglet "pom.xml" en bas et trouver le code qui ressemble à ceci et le supprimer:

<exclusions>
  <exclusion>
    <artifactId>[artifactId of what you removed]</artifactId>
    <groupId>[groupId of what you removed]</groupId>
  </exclusion>
</exclusions>

Les modifications ont lieu lorsque vous enregistrez le fichier pom.xml.

11
Jon

Essayez de rétrograder la version SLF4J. Cette erreur apparaît généralement lorsqu'une bibliothèque nécessite une version plus ancienne/plus récente de SLF4J.

Assurez-vous également que si vous avez plusieurs fichiers JAR SLF4J dans le chemin de classe, ils proviennent tous de la même version SLF4J (pour l'instant, il semble que ce ne soit pas votre problème).

EDIT: J'ai oublié qu'il s'agit d'un problème de poisson-verre intégré uniquement. Je n'utilise pas Glassfish, mais le problème sera avec le mélange de différentes versions de SLF4J. Voir quelle version SLF4J Glassfish utilise et utilisez la même.

2
jirka.pinkas