
-----------------------------------
Homer_simpson
Tue Aug 07, 2012 1:42 am

java applet only runs locally
-----------------------------------
hi,
I made a java applet which is a simple simulation.. it compiles ok and when i make an html file with 
  
locally on my computer  the applet runs as it should. but when i upload the applet to my website it gives me this error : NoClassDefFoundError           fft
fft is part of java.lang.math.fft which I assume is part of the java core.. 
I have spent hours googling the problem but with no results... 
the applet is uploaded here : http://www.nimaaj.com/cn.html

any ideas?
thanks

-----------------------------------
Ultrahex
Tue Aug 07, 2012 3:27 pm

Re: java applet only runs locally
-----------------------------------
java.lang.math does not include fft. I can't get it to work at all locally, probably problem with java locally. That is the advice I can give.

-----------------------------------
DemonWasp
Tue Aug 07, 2012 4:00 pm

RE:java applet only runs locally
-----------------------------------
There is no standard java.lang.math.fft, and if you're using a third-party library for FFTs, it shouldn't be polluting java.lang.math, it should be in com.company.fft or org.organisation.fft .

It might help if you told us more about what libraries your project uses, and showed at least the import section of your code in "cranknicjb".

-----------------------------------
Homer_simpson
Tue Aug 07, 2012 5:17 pm

Re: java applet only runs locally
-----------------------------------
thanks for your reply...
its odd since I'm not importing any other libraries other than lapack and jblas... and the code runs fine on my computer..
here is the code import java.applet.*;
import java.awt.*;
import java.lang.Math;
import java.awt.event.*;
import java.util.*;
import org.jblas.*;
import org.netlib.lapack.Dstedc;
import org.netlib.util.*;
public class cranknicjb extends Applet implements AdjustmentListener,MouseListener, MouseMotionListener,Runnable   {
/////////////GUI stuffs///////////////////
	CheckboxGroup radioGroup; 
	 // The radio buttons to be selected 
		 Checkbox radioeditpot; 
		 Checkbox radiosetpot; 
		 Scrollbar sb_pot;
		 Scrollbar sb_psi;
		 Scrollbar sb_psip;
		 Scrollbar sb_simspd;
		 AdjustmentListener adjustmentListenersimspd = new AdjustmentListener() {
			public void adjustmentValueChanged(AdjustmentEvent adjustmentEvent) {
				System.out.println("Adjusted: " + adjustmentEvent.getValue());
				simspd=	adjustmentEvent.getValue();
			}
		};

		AdjustmentListener adjustmentListener = new AdjustmentListener() {
			public void adjustmentValueChanged(AdjustmentEvent adjustmentEvent) {
				System.out.println("Adjusted: " + adjustmentEvent.getValue());
				pmult=	adjustmentEvent.getValue()*20;
			}
		};
	  
		AdjustmentListener adjustmentListenerpsi = new AdjustmentListener() {
			public void adjustmentValueChanged(AdjustmentEvent adjustmentEvent) {
				System.out.println("Adjusted: " + adjustmentEvent.getValue());
				psimult=	adjustmentEvent.getValue()*100;
			}
		};

		AdjustmentListener adjustmentListenerpsip = new AdjustmentListener() {
			public void adjustmentValueChanged(AdjustmentEvent adjustmentEvent) {
				System.out.println("Adjusted: " + adjustmentEvent.getValue());
				psipmult=	adjustmentEvent.getValue()*1;
			}
		};
		/////////////GUI stuffs///////////////////
	public static final double PI = 3.141592653;
	FFT fft;
	int app_width, app_height,width;
	int mx, my,lastmx,lastmy,tempmx,tempmy;  // the mouse coordinates
	boolean isButtonPressed = false;
	boolean mouseclicked = false;
	boolean potchanged = false;
	double time;
	Thread t = null;
	boolean threadSuspended;
	boolean statstate=true,editing_pot_flag=false,xspace_flag=false;
	Image potbuffer,xspaceampbuffer,xspacebuffer,pspacebuffer;
	Graphics potg,xspaceampg,xspaceg,pspaceg;
	Color phasecolor

-----------------------------------
Homer_simpson
Tue Aug 07, 2012 5:18 pm

Re: java applet only runs locally
-----------------------------------
also i think this is the FFT I'm using http://commons.apache.org/math/api-1.2/org/apache/commons/math/transform/FastFourierTransformer.html

-----------------------------------
chrisbrown
Tue Aug 07, 2012 8:50 pm

Re: java applet only runs locally
-----------------------------------
The Apache Commons math library doesn't abbreviate FFT as a class name so it's probably not using that one, and none of your jars contain a class named FFT so it must be finding it on your local classpath.
What's the output of [code]FFT.class.getName();[/code]

-----------------------------------
Homer_simpson
Tue Aug 07, 2012 10:50 pm

Re: java applet only runs locally
-----------------------------------
that command returns "FFT"   :? 
my local class path is:
 C:\Program Files (x86)\Java\jre7\lib\jlapack-0.8\netlib-java-0.9.3.jar;C:\Program Files (x86)\Java\jre7\lib\jlapack-0.8\arpack_combined_all.jar;C:\Users\4dmin\Documents\java works\Jama-1.0.2.jar;C:\Users\4dmin\Documents\java works\jblas-1.2.0.jar;C:\Users\4dmin\Documents\java works\jtransforms-2.4.jar;


I'm stumped  :(

-----------------------------------
Homer_simpson
Tue Aug 07, 2012 11:05 pm

Re: java applet only runs locally
-----------------------------------
Oh i figured it out i simply had not uploaded all the class files to the server... now its running well: http://nimaaj.com/schsim.html
thanks for ur help guys

-----------------------------------
chrisbrown
Wed Aug 08, 2012 12:22 am

Re: java applet only runs locally
-----------------------------------
Don't forget to add netlib and arpack to the archive parameter. As it is now, it throws a NoClassDefFound on netlib's initW. And unless there's something hiding in there, I don't think you need jtransform either. As far as I can tell, it works fine for me when I use That aside, it looks like a neat tool. What's it going to be used for?

-----------------------------------
Homer_simpson
Wed Aug 08, 2012 12:45 pm

Re: java applet only runs locally
-----------------------------------
Thanks, I wrote it to help demonstrate the behavior of Schrodinger's equation for students taking third year quantum mechanics course at YorkU.
