Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 59797 invoked from network); 2 Nov 2010 15:04:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Nov 2010 15:04:48 -0000 Received: (qmail 37701 invoked by uid 500); 2 Nov 2010 15:05:17 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 37462 invoked by uid 500); 2 Nov 2010 15:05:16 -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 35182 invoked by uid 99); 2 Nov 2010 15:03:11 -0000 X-ASF-Spam-Status: No, hits=-0.1 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ben.hsu@bluefly.com designates 74.125.149.201 as permitted sender) MIME-Version: 1.0 In-Reply-To: <201011011556.oA1Fu0df038926@barrierL241.nike.com> References: <201011011556.oA1Fu0df038926@barrierL241.nike.com> Date: Tue, 2 Nov 2010 11:02:43 -0400 Message-ID: Subject: Re: Surefire NPE From: Ben Hsu To: surefire-users@maven.apache.org Cc: "users@maven.apache.org" Content-Type: multipart/alternative; boundary=0015175cd1da7f7f2e0494133765 --0015175cd1da7f7f2e0494133765 Content-Type: text/plain; charset=ISO-8859-1 Blind guess: maybe ${resource-bundle-path} is being set to a different value when the user runs it? On Mon, Nov 1, 2010 at 11:55 AM, Hinkle, Cameron wrote: > Greetings, > > I've been using Maven and Surefire on a project for about a year now and > have sporadically seen a problem that I've always been able to get around > but want to get to the bottom of. It's a null pointer exception sometimes > when I run "mvn" and it tries to run all our tests. It happens rarely but > four different people on the project have run into it at one point or > another. For some reason if I bypass the tests and start my Jetty server > through maven, I can go back to run the tests after stopping Jetty and the > tests run just fine. This is typically my workaround. > > Here is the output from the command line: > > C:\workspaces\tesla\readiness-mobile\tesla-src-mobile>mvn > [INFO] Scanning for projects... > [INFO] > ------------------------------------------------------------------------ > [INFO] Building Templated Service Layer Assembler > [INFO] task-segment: [package] > [INFO] > ------------------------------------------------------------------------ > [INFO] [resources:resources {execution: default-resources}] > [WARNING] Using platform encoding (Cp1252 actually) to copy filtered > resources, i.e. build is platform dependent! > [INFO] Copying 6 resources > Downloading: > http://repo1.maven.org/maven2/com/nike/classes/2.2/classes-2.2.pom > [INFO] Unable to find resource 'com.nike:classes:pom:2.2' in repository > central (http://repo1.maven.org/maven2) > [INFO] [compiler:compile {execution: default-compile}] > [INFO] Compiling 1 source file to > C:\workspaces\tesla\readiness-mobile\tesla-src-mobile\target\classes > [INFO] [resources:testResources {execution: default-testResources}] > [WARNING] Using platform encoding (Cp1252 actually) to copy filtered > resources, i.e. build is platform dependent! > [INFO] Copying 76 resources > [INFO] [compiler:testCompile {execution: default-testCompile}] > [INFO] Nothing to compile - all classes are up to date > [INFO] [surefire:test {execution: default-test}] > [INFO] Surefire report directory: > C:\workspaces\tesla\readiness-mobile\tesla-src-mobile\target\surefire-reports > [INFO] > ------------------------------------------------------------------------ > [ERROR] FATAL ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] null > [INFO] > ------------------------------------------------------------------------ > [INFO] Trace > java.lang.NullPointerException > at java.util.Hashtable.put(Hashtable.java:394) > at java.util.Properties.setProperty(Properties.java:143) > at > org.apache.maven.surefire.booter.SurefireBooter.setForkProperties(SurefireBooter.java:510) > at > org.apache.maven.surefire.booter.SurefireBooter.forkSuites(SurefireBooter.java:483) > at > org.apache.maven.surefire.booter.SurefireBooter.runSuitesForkOnce(SurefireBooter.java:385) > at > org.apache.maven.surefire.booter.SurefireBooter.run(SurefireBooter.java:246) > at > org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:581) > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) > at > org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 6 seconds > [INFO] Finished at: Mon Nov 01 08:49:35 PDT 2010 > [INFO] Final Memory: 19M/46M > [INFO] > ------------------------------------------------------------------------ > C:\workspaces\tesla\readiness-mobile\tesla-src-mobile> > > And here is the Surefire configuration in the pom.xml: > > > org.apache.maven.plugins > maven-surefire-plugin > 2.5 > > > > ${resource-bundle-path} > > > > > I'm thinking this is probably a bug in Maven or Surefire but I can't find > any mention of it on Google. Has anyone run into this or know what causes > it? > > Thanks, > Cameron > > Cameron Hinkle | Senior Application Engineer | Nike DCIT | > 503.532.3075 | 7. Evolve Immediately | > > --0015175cd1da7f7f2e0494133765--