NormalDistributionImpl and NoClassDefFoundError: MathException

View: New views
5 Messages — Rating Filter:   Alert me  

NormalDistributionImpl and NoClassDefFoundError: MathException

by Patrick Meyer-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using the following code in a method that catches and throws
org.apache.commons.math.MathException.

NormalDistributionImpl normal = new NormalDistributionImpl();
double invNorm = normal.inverseCumulativeProbability(itemDifficulty);

I import the class using

import org.apache.commons.math.MathException;

but when I compile and run my code I get this error message
java.lang.NoClassDefFoundError: org/apache/commons/math/MathException

Any ideas what is happening? With my import statement, it seems like I
should not be getting this error.

Thanks



Re: [math] NormalDistributionImpl and NoClassDefFoundError: MathException

by Luc Maisonobe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First of all, could put a [math] marker in the subject line when posting to this list ? It is shared among all commons components and this policy helps people setting up filters.

----- "Patrick Meyer" <meyerjp@...> a écrit :

> I am using the following code in a method that catches and throws
> org.apache.commons.math.MathException.
>
> NormalDistributionImpl normal = new NormalDistributionImpl();
> double invNorm = normal.inverseCumulativeProbability(itemDifficulty);
>
> I import the class using
>
> import org.apache.commons.math.MathException;
>
> but when I compile and run my code I get this error message
> java.lang.NoClassDefFoundError: org/apache/commons/math/MathException
>
> Any ideas what is happening? With my import statement, it seems like I
>
> should not be getting this error.

Do you have the commons-math jar in your classpath at runtime ?

Luc

>
> Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Parent Message unknown re: [math] NormalDistributionImpl and NoClassDefFoundError: MathException

by Patrick Meyer-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using Netbeans and I have added the commons-math jar as a library. Is that the same thing?
The following simple test case works fine, but the complete application produce the error.

package test;

import org.apache.commons.math.MathException;
import org.apache.commons.math.distribution.NormalDistributionImpl;


/**
 *
 * @author meyerjp
 */
public class Main {

   


    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        NormalDistributionImpl normal = new NormalDistributionImpl(0.0,1.0);
        try{
            double invNorm = normal.inverseCumulativeProbability(0.4);
            System.out.println(invNorm);
        }catch(MathException ex){
            ex.printStackTrace();
        }


    }

}





First of all, could put a [math] marker in the subject line when posting to this list ? It
is shared among all commons components and this policy helps people setting up filters.

----- "Patrick Meyer" <meyerjp@...> a écrit :

> I am using the following code in a method that catches and throws
> org.apache.commons.math.MathException.
>
> NormalDistributionImpl normal = new NormalDistributionImpl();
> double invNorm = normal.inverseCumulativeProbability(itemDifficulty);
>
> I import the class using
>
> import org.apache.commons.math.MathException;
>
> but when I compile and run my code I get this error message
> java.lang.NoClassDefFoundError: org/apache/commons/math/MathException
>
> Any ideas what is happening? With my import statement, it seems like I
>
> should not be getting this error.

Do you have the commons-math jar in your classpath at runtime ?

Luc



Re: [math] NormalDistributionImpl and NoClassDefFoundError: MathException

by Luc Maisonobe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Patrick Meyer a écrit :
> I am using Netbeans and I have added the commons-math jar as a library.
> Is that the same thing?

I have not used Netbeans in years, but I suppose this is correct.

> The following simple test case works fine, but the complete application
> produce the error.

Does the compilation performs completely without warning nor errors ?
You could perhaps check the output manually by exploring the directory
where Netbeans puts its classes (perhaps some directory with a name like
bin or target or classes).

Luc

>
> package test;
>
> import org.apache.commons.math.MathException;
> import org.apache.commons.math.distribution.NormalDistributionImpl;
>
>
> /**
> *
> * @author meyerjp
> */
> public class Main {
>
>  
>
>    /**
>     * @param args the command line arguments
>     */
>    public static void main(String[] args) {
>
>        NormalDistributionImpl normal = new NormalDistributionImpl(0.0,1.0);
>        try{
>            double invNorm = normal.inverseCumulativeProbability(0.4);
>            System.out.println(invNorm);
>        }catch(MathException ex){
>            ex.printStackTrace();
>        }
>
>
>    }
>
> }
>
>
>
>
>
> First of all, could put a [math] marker in the subject line when posting
> to this list ? It
> is shared among all commons components and this policy helps people
> setting up filters.
>
> ----- "Patrick Meyer" <meyerjp@...> a écrit :
>
>> I am using the following code in a method that catches and throws
>> org.apache.commons.math.MathException.
>>
>> NormalDistributionImpl normal = new NormalDistributionImpl();
>> double invNorm = normal.inverseCumulativeProbability(itemDifficulty);
>>
>> I import the class using
>>
>> import org.apache.commons.math.MathException;
>>
>> but when I compile and run my code I get this error message
>> java.lang.NoClassDefFoundError: org/apache/commons/math/MathException
>>
>> Any ideas what is happening? With my import statement, it seems like I
>>
>> should not be getting this error.
>
> Do you have the commons-math jar in your classpath at runtime ?
>
> Luc
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: [math] NormalDistributionImpl and NoClassDefFoundError: MathException

by Mike Baranski-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If it compiles but does not run, make sure the compile classpath and runtime
classpath are the same.

I have no idea how netbeans determines this, because I use emacs, but that's
where I'd start.

M.

-----Original Message-----
From: Luc Maisonobe [mailto:Luc.Maisonobe@...]
Sent: Thursday, June 11, 2009 2:42 PM
To: Commons Users List
Subject: Re: [math] NormalDistributionImpl and NoClassDefFoundError:
MathException

Patrick Meyer a écrit :
> I am using Netbeans and I have added the commons-math jar as a library.
> Is that the same thing?

I have not used Netbeans in years, but I suppose this is correct.

> The following simple test case works fine, but the complete application
> produce the error.

Does the compilation performs completely without warning nor errors ?
You could perhaps check the output manually by exploring the directory
where Netbeans puts its classes (perhaps some directory with a name like
bin or target or classes).

Luc

>
> package test;
>
> import org.apache.commons.math.MathException;
> import org.apache.commons.math.distribution.NormalDistributionImpl;
>
>
> /**
> *
> * @author meyerjp
> */
> public class Main {
>
>  
>
>    /**
>     * @param args the command line arguments
>     */
>    public static void main(String[] args) {
>
>        NormalDistributionImpl normal = new
NormalDistributionImpl(0.0,1.0);

>        try{
>            double invNorm = normal.inverseCumulativeProbability(0.4);
>            System.out.println(invNorm);
>        }catch(MathException ex){
>            ex.printStackTrace();
>        }
>
>
>    }
>
> }
>
>
>
>
>
> First of all, could put a [math] marker in the subject line when posting
> to this list ? It
> is shared among all commons components and this policy helps people
> setting up filters.
>
> ----- "Patrick Meyer" <meyerjp@...> a écrit :
>
>> I am using the following code in a method that catches and throws
>> org.apache.commons.math.MathException.
>>
>> NormalDistributionImpl normal = new NormalDistributionImpl();
>> double invNorm = normal.inverseCumulativeProbability(itemDifficulty);
>>
>> I import the class using
>>
>> import org.apache.commons.math.MathException;
>>
>> but when I compile and run my code I get this error message
>> java.lang.NoClassDefFoundError: org/apache/commons/math/MathException
>>
>> Any ideas what is happening? With my import statement, it seems like I
>>
>> should not be getting this error.
>
> Do you have the commons-math jar in your classpath at runtime ?
>
> Luc
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...