You're specifying scope provided which means "I will provide this jar when it is needed". And then in your command line, you're not providing it. So you get the NPE.
Add the servlet-api-2.4.jar to the classpath and try again, it should work. And review what the various scopes mean on the Maven homepage if you haven't already. Wayne On 7/2/08, briantd <[EMAIL PROTECTED]> wrote: > > Hi, I am a recent maven user. > > The Good: > * Servlet code compiles after adding pom.xml dependencies for group_ids > "javax.servlet" (server-api) and "org.apache.xmlrpc" (xmlrpc-*). > > The Bad: > * Executing "java -jar MyNewServletService-1.0-SNAPSHOT.jar" yields -- > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/servlet/http/HttpServlet > > From the pom.xml... > <dependency> > <groupId>javax.servlet</groupId> > <artifactId>servlet-api</artifactId> > <version>2.4</version> > <scope>provided</scope> > </dependency> > > I'm guessing that the problem is related to the scope. Perhaps OSX Leopard > doesn't include EE javax jars? > > Changing the scope to "runtime" yields a compile-time error: > "cannot access javax.servlet.http.HttpServlet file > javax/servlet/http/HttpServlet.class not found" > > Why I'm perplexed: > * maven automatically downloads > ~/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar -- which > appears to include all the "missing" classes. > > For example: > jar -tf ~/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar > ... > javax/servlet/http/HttpServlet.class > ... > > Any suggestions? > > Thanks! > -B > -- > View this message in context: > http://www.nabble.com/Maven-dependency-quandary%3A-apache-xml-rpc-%2B-servlet-api-2.4.jar-%3D-javax-not-found--tp18250354p18250354.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
