2014-01-26 16 views
11

Ich bin ein Neuling mit Maven , Frühling, eingebetteter Glasfisch, Abhängigkeitskonflikte (ich weiß nicht, wie man sie sieht und wie man sie löst) ... und ich kann dieses Problem nicht alleine beheben, selbst wenn ich stundenlang versucht habe ich weiß nicht, dieses Problem mit eingebetteter tomcat7 begegnen, aber ich habe mit eingebetteten Glasfischenjava.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log (Lorg/slf4j/Marker; Ljava/lang/Zeichenfolge; ILjava/lang/String; [Ljava/lang/Obje

I "Run-Konfiguration" von eclipse mit

  • ein eingebetteten mav laufen en Runtime 3.0.4/1.4.0,
  • Ziele: clean Paket eingebettet-Glasfischen: run
  • jre: jdk-7u51

Danke einige Zeit zu verbringen, das Problem zu helfen, zu lösen.

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

+0

Haben Sie dieses Problem lösen Welche Version hast du benutzt ? – Jackie

+0

nm check out this ... http://stackoverflow.com/questions/3519978/logging-framework-incompatibility – Jackie

+1

Vielen Dank! Gelöst mit Version 1.5.11 + Ausschluss von Spring-Data-Jpa – user3178994

Antwort

2

Try SLF4J Version herabzustufen. Dieser Fehler tritt normalerweise auf, wenn eine Bibliothek eine ältere/neuere Version von SLF4J benötigt.

Stellen Sie außerdem sicher, dass wenn Sie mehr als eine SLF4J JAR-Datei im Klassenpfad haben, dass alle von derselben SLF4J-Version stammen (momentan scheint es, dass dies nicht Ihr Problem ist).

EDIT: Ich habe übersehen, dass es Glassfish-only Problem eingebettet ist. Ich benutze Glassfish nicht, aber das Problem wird mit dem Mischen verschiedener Versionen von SLF4J sein. Sehen Sie, welche SLF4J-Version Glassfish verwendet und verwendet.

10

ältere Frage, aber trotzdem eine Antwort wert ... Öffnen Sie in Eclipse die Datei pom.xml aus dem Projekt. Wenn es geöffnet wird, wählen Sie die Registerkarte Abhängigkeitshierarchie im unteren Bereich. Hier sehen Sie, was geladen wird und wo es aufgerufen wird. Geben Sie im Suchfilter den Namen (oder einen Teil des Namens) der Abhängigkeit ein, von der Sie denken, dass sie in Konflikt ist. Sie könnten beispielsweise "slf4j" eingeben und alle Abhängigkeiten anzeigen, die für die Protokollierung von slf4j abhängen. Wenn Sie mit der rechten Maustaste auf eine Abhängigkeit klicken, können Sie diese in der Pom-Datei ausschließen. Wenn Sie die Datei pom.xml speichern, wird die Abhängigkeitshierarchie geändert. Sie können Ihre Anwendung erneut testen und sehen, ob Sie Ihr Problem gelöst oder die falsche Version ausgeschlossen haben.

Die einzige Einschränkung ist, dass Sie wechseln müssen, wenn Sie die von Ihnen ausgeschlossene Abhängigkeit wiederherstellen möchten zum "Pom.xml“Register am unteren Rand und den Code finden, der so aussieht, und löschen Sie es.?

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

Änderungen stattfinden, wenn Sie die pom.xml Datei speichern