Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.Parameter Exception
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ken Geis  
View profile  
 More options Dec 6 2011, 7:28 pm
From: Ken Geis <geis....@gmail.com>
Date: Tue, 6 Dec 2011 16:28:11 -0800 (PST)
Local: Tues, Dec 6 2011 7:28 pm
Subject: testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

I've attached a simple project that seems like it should work, but I get

   [testng] Exception in thread "main" java.lang.NoClassDefFoundError:

> com/beust/jcommander/ParameterException
> ...

   [testng] Caused by: java.lang.ClassNotFoundException:

> com.beust.jcommander.ParameterException

I print the classpath is printed before TestNG is run, and it's clear that
JCommander is in the classpath. Now from the size, the testng-6.3.1.jar
that's in the Maven repo looks like the distribution jar that has no BSH or
Guice. BSH is on the classpath. If you add Guice, it still fails. If you
instead use the full testng-6.3.1.jar that's distributed in the TestNG zip,
it works fine.

Please look into this.

  test.zip
2K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cédric Beust ♔  
View profile  
 More options Dec 6 2011, 7:41 pm
From: Cédric Beust ♔ <ced...@beust.com>
Date: Tue, 6 Dec 2011 16:41:59 -0800
Local: Tues, Dec 6 2011 7:41 pm
Subject: Re: [testng-dev] testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

Note that this is a NoClassDefFoundException, not ClassNotFoundException...

You're missing something else in your classpath.

--
Cédric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Geis  
View profile  
 More options Dec 6 2011, 7:58 pm
From: Ken Geis <geis....@gmail.com>
Date: Tue, 6 Dec 2011 16:58:01 -0800 (PST)
Local: Tues, Dec 6 2011 7:58 pm
Subject: Re: [testng-dev] testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

*Caused by: java.lang.ClassNotFoundException*
*
*
This project is too simple to be missing anything. It only references one
class, org.testng.annotations.Test. If there is something missing on the
classpath, I'm saying it's not my fault. There seems to be something wrong
with the jars or poms that are on the Maven repo.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Geis  
View profile  
 More options Dec 6 2011, 8:00 pm
From: Ken Geis <geis....@gmail.com>
Date: Tue, 6 Dec 2011 17:00:18 -0800 (PST)
Local: Tues, Dec 6 2011 8:00 pm
Subject: Re: testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

Similar thing was posted on StackOverflow<http://stackoverflow.com/questions/7100821/suddenly-cant-run-testng-t...>.
It wasn't fully resolved (the OP used a workaround), so I'm posting a test
case that shows the problem.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cédric Beust ♔  
View profile  
 More options Dec 6 2011, 8:12 pm
From: Cédric Beust ♔ <ced...@beust.com>
Date: Tue, 6 Dec 2011 17:12:40 -0800
Local: Tues, Dec 6 2011 8:12 pm
Subject: Re: [testng-dev] Re: testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

testng.jar in the Maven repository has *no* dependencies, only the TestNG
classes. By definition.

If you're using ivy, it should have downloaded all the classes you need,
you might want to rm your .ivy directory and try to compile again, just to
make sure you don't have a corrupt set of jar files.

--
Cédric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Geis  
View profile  
 More options Dec 6 2011, 8:40 pm
From: Ken Geis <geis....@gmail.com>
Date: Tue, 6 Dec 2011 17:40:08 -0800 (PST)
Local: Tues, Dec 6 2011 8:40 pm
Subject: Re: [testng-dev] Re: testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

Already tried that.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cédric Beust ♔  
View profile  
 More options Dec 6 2011, 9:15 pm
From: Cédric Beust ♔ <ced...@beust.com>
Date: Tue, 6 Dec 2011 18:15:28 -0800
Local: Tues, Dec 6 2011 9:15 pm
Subject: Re: [testng-dev] Re: testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

I'm seeing the same problem you are, even with older versions of TestNG.
And JCommander is indeed in the classpath that ivy is displaying:

$ javap -classpath
/Users/cedric/.ivy2/cache/org.testng/testng/jars/testng-6.3.jar:/Users/cedr ic/.ivy2/cache/junit/junit/jars/junit-3.8.1.jar:/Users/cedric/.ivy2/cache/o rg.beanshell/bsh/jars/bsh-2.0b4.jar:/Users/cedric/.ivy2/cache/com.beust/jco mmander/jars/jcommander-1.12.jar:/Users/cedric/.ivy2/cache/org.yaml/snakeya ml/jars/snakeyaml-1.6.jar
com.beust.jcommander.ParameterException

Compiled from "ParameterException.java"
public class com.beust.jcommander.ParameterException extends
java.lang.RuntimeException{
    public com.beust.jcommander.ParameterException(java.lang.Throwable);
    public com.beust.jcommander.ParameterException(java.lang.String);

}

No idea what's going on, I suspect a bug in ivy.

--
Cédric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Geis  
View profile  
 More options Dec 7 2011, 12:33 am
From: Ken Geis <geis....@gmail.com>
Date: Tue, 6 Dec 2011 21:33:52 -0800 (PST)
Local: Wed, Dec 7 2011 12:33 am
Subject: Re: [testng-dev] Re: testng fails from Ant/Ivy with ClassNotFoundException: com.beust.jcommander.ParameterException

Thank you very much for looking into it. Sorry for the accusations.

I figured it out. The example I gave was never going to work because it
needs to have TestNG on the runtime classpath inside the <testng> task. My
project was not working because I was misunderstanding the Ant pathelement
path attribute. I was using

       <pathelement path="${testng.classpath}" />                      

when I needed to use

       <pathelement path="${toString:testng.classpath}" />                


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »