Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 713A610024 for ; Thu, 24 Oct 2013 03:43:39 +0000 (UTC) Received: (qmail 76577 invoked by uid 500); 24 Oct 2013 03:43:26 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 76513 invoked by uid 500); 24 Oct 2013 03:43:22 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 76445 invoked by uid 99); 24 Oct 2013 03:43:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 03:43:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gunrockseenu@gmail.com designates 209.85.220.193 as permitted sender) Received: from [209.85.220.193] (HELO mail-vc0-f193.google.com) (209.85.220.193) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 03:43:14 +0000 Received: by mail-vc0-f193.google.com with SMTP id id10so195175vcb.8 for ; Wed, 23 Oct 2013 20:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wyaGN+wGycSHL5skpmozf8F9Ttt0OlEAyUkuzAWdnL4=; b=TFSwxdMS9KjPxPxKj8BC2MRq4Yqh1a66C4LBFBt45b2YKlCcGjw8t01yPVDITB3Fp4 iu0+P8RGRT61v3G8XOSTYsAxFZ3ZvhopyeDYJj3ykj1vMTsqAdgMJs+hVdRutbBrYYlV 05WlhvX0NO03Gd1kNyNXLfBAku5Hnc48y9CMz1cPa1jgUhG5HntiyQhXYQThz8XtwO4X Oh+TiDpzZflH6gzPVunSL3nlufQmtKvd2PHU2ILmTXNFxfnPq1G3cM8ud10kPlfXDLes qF9UA9jN4yCnGb0X33kg0vqMpHWLPv0myfRtoa6FRZl8Kzoe0pZsvh9HwTh6aYMziSDy RDMA== MIME-Version: 1.0 X-Received: by 10.52.166.200 with SMTP id zi8mr80838vdb.38.1382586173174; Wed, 23 Oct 2013 20:42:53 -0700 (PDT) Received: by 10.221.58.202 with HTTP; Wed, 23 Oct 2013 20:42:53 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Oct 2013 23:42:53 -0400 Message-ID: Subject: Re: Maven - slf4j noclassdeffound error From: gunrock seenu To: Maven Users List Content-Type: multipart/alternative; boundary=089e01634aa6b954f404e9746db0 X-Virus-Checked: Checked by ClamAV on apache.org --089e01634aa6b954f404e9746db0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ~/M101J$ mvn dependency:tree [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building M101J 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ M101J --- [INFO] com.tengen:M101J:jar:1.0-SNAPSHOT [INFO] +- org.mongodb:mongo-java-driver:jar:2.11.3:compile [INFO] +- com.sparkjava:spark-core:jar:1.1:compile [INFO] | +- org.eclipse.jetty:jetty-server:jar:9.0.2.v20130417:compile [INFO] | | +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile [INFO] | | +- org.eclipse.jetty:jetty-http:jar:9.0.2.v20130417:compile [INFO] | | | \- org.eclipse.jetty:jetty-util:jar:9.0.2.v20130417:compile [INFO] | | \- org.eclipse.jetty:jetty-io:jar:9.0.2.v20130417:compile [INFO] | \- org.eclipse.jetty:jetty-webapp:jar:9.0.2.v20130417:compile [INFO] | +- org.eclipse.jetty:jetty-xml:jar:9.0.2.v20130417:compile [INFO] | \- org.eclipse.jetty:jetty-servlet:jar:9.0.2.v20130417:compile [INFO] | \- org.eclipse.jetty:jetty-security:jar:9.0.2.v20130417:compile [INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile [INFO] \- junit:junit:jar:4.9:test [INFO] \- org.hamcrest:hamcrest-core:jar:1.1:test [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.925s [INFO] Finished at: Wed Oct 23 23:42:09 EDT 2013 [INFO] Final Memory: 8M/30M [INFO] ---------------------------------------------------- On Wed, Oct 23, 2013 at 11:04 AM, Thomas Broyer wrote: > None of the transitive dependencies of spark are in the classpath. It > generally happens if the POM is "invalid". > What does "mvn dependency:tree" says? Is there any error/warning in IDEA? > Le 23 oct. 2013 14:28, "Seenu" a =E9crit : > > > I am using intellij and maven, > > > > I have used the following pom.xml : > > > > > http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation=3D" > > > http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.= xsd > > "> > > 4.0.0 > > > > com.tengen > > M101J > > 1.0-SNAPSHOT > > jar > > > > M101J > > http://maven.apache.org > > > > > > UTF-8 > > > > > > > > > > > > org.mongodb > > mongo-java-driver > > 2.11.3 > > > > > > > > > > > > com.sparkjava > > spark-core > > 1.1 > > > > > > > > junit > > junit > > 4.9 > > test > > > > > > > > > > > > ------------------------------ > > > > package com.tengen; > > > > > > import spark.Request; > > import spark.Response; > > import spark.Route; > > import spark.Spark; > > > > /** > > * Created with IntelliJ IDEA. > > * User: seenu > > * Date: 10/19/13 > > * Time: 7:44 PM > > * To change this template use File | Settings | File Templates. > > */ > > public class HelloWorldSparkStyle { > > public static void main(String[] args){ > > Spark.get(new Route("/") { > > @Override > > public Object handle(Request request, Response response) { > > return "Hello World from Spark!"; //To change body of > > implemented methods use File | Settings | File Templates. > > } > > }); > > } > > } > > > > > > > > > > > > ---------------------------------- > > > > > > when I run, via intellij here is what I see, > > > > /usr/lib/jvm/jdk1.7.0_40/bin/java -Didea.launcher.port=3D7536 > > -Didea.launcher.bin.path=3D/home/sree/IDEA/idea-IC-129.1359/bin > > -Dfile.encoding=3DUTF-8 -classpath > > > /usr/lib/jvm/jdk1.7.0_40/jre/lib/jfr.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib= /jsse.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/deploy.jar:/usr/lib/jvm/jdk1.7.0= _40/jre/lib/javaws.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/management-agent.ja= r:/usr/lib/jvm/jdk1.7.0_40/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.7.0_40/jr= e/lib/jce.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/jfxrt.jar:/usr/lib/jvm/jdk1.= 7.0_40/jre/lib/plugin.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/resources.jar:/u= sr/lib/jvm/jdk1.7.0_40/jre/lib/rt.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/ext/= localedata.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/ext/sunpkcs11.jar:/usr/lib/= jvm/jdk1.7.0_40/jre/lib/ext/dnsns.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/ext/= sunec.jar:/usr/lib/jvm/jdk1.7.0_40/jre/lib/ext/sunjce_provider.jar:/usr/lib= /jvm/jdk1.7.0_40/jre/lib/ext/zipfs.jar:/home/sree/M101J/out/production/main= :/home/sree/.m2/repository/org/mongodb/mongo-java-driver/2.11.3/mongo-java-= driver-2.11.3.jar:/home/sree/.m2/repository/com/sparkjava/spark-core/1.1/sp= ark-core-1.1.jar:/home/sree/IDEA/idea-IC-129.1359/lib/idea_rt.jar > > com.intellij.rt.execution.application.AppMain > > com.tengen.HelloWorldSparkStyle > > Exception in thread "main" java.lang.NoClassDefFoundError: > > org/slf4j/LoggerFactory > > at > > spark.route.RouteMatcherFactory.(RouteMatcherFactory.java:27) > > at spark.Spark.init(Spark.java:299) > > at spark.Spark.addRoute(Spark.java:282) > > at spark.Spark.get(Spark.java:168) > > at com.tengen.HelloWorldSparkStyle.main(HelloWorldSparkStyle.java:1= 8) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :57) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > > at java.lang.reflect.Method.invoke(Method.java:606) > > at > com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) > > Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory > > at java.net.URLClassLoader$1.run(URLClassLoader.java:366) > > at java.net.URLClassLoader$1.run(URLClassLoader.java:355) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:354) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > > ... 10 more > > > > Process finished with exit code 1 > > > > > > ----------------------------- > > > > > > what could be wrong here? can someone please point me whre to look? I w= as > > hoping maven would put the slf4j-api into the classpath when I add > > dependency but it is not. > > > > Sent from my iPhone > --089e01634aa6b954f404e9746db0--