We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Export does not work
Pages: 1 2 
Export does not work (Read 7177 times)
Export does not work
May 28th, 2010, 2:23am
 
Hi there

I (or actually: my students) have programmed a little game with Processing. The game works fine, but I can't export it to a Java Applet. Although the files are generated, the applet does not start.
(With another game, I could export, and the applet works.)

Can anybody help me? What could be the problem?  Huh

(As the program contains several classes, it's a bit complicated to post it here. Or is it possible to upload the files?)
Re: Export does not work
Reply #1 - May 28th, 2010, 3:23am
 
there are a lot of online storage websites like http://uploaded.to/ where you can quickly upload files without registration and get a link you can post here.

Re: Export does not work
Reply #2 - May 28th, 2010, 5:04am
 
Common cause of such issue: security.
In an applet, if you don't sign it, you cannot access filesystem (using file chooser, writing a file), you cannot access a different site, you cannot use the clipboard, etc.
Activate the Java console (eg. in the Java entry of the Control Panel in Windows, elsewhere in other systems..., eg. running javaws -viewer on the command line, or as option of your browser) to see if you have error messages.
Re: Export does not work
Reply #3 - May 28th, 2010, 10:45pm
 
Hi there

Thanks for the upload-website. Here are the two applets which do not run:

http://ul.to/mdmvyt
http://ul.to/0f7p37

Could someone take a look at it? Please, please, please...  Roll Eyes

I'm not sure whether it is a security problem or not, because two other games which were programmed quite similarly and under the same circumstances run fine.

(If you want to play them:
http://www.ksh.edu/?id=959
http://www.ksh.edu/?id=960
Have fun!  Cheesy )
Re: Export does not work
Reply #4 - May 29th, 2010, 12:36am
 
I don't know if it can be the reason for failure, but the MP3/WAV files are missing from the archive found at the first link.

Again, activate the Java console to see error messages.
Re: Export does not work
Reply #5 - May 30th, 2010, 12:06am
 
Bonjour, PhiLho!  Smiley

Here are the error messages:

If I try to start the first applet:

Exception in thread "Animation Thread" java.lang.NullPointerException
     at ddf.minim.javasound.JSMinim.getAudioInputStream(JSMinim.java:604)
     at ddf.minim.javasound.JSMinim.getAudioRecordingStream(JSMinim.java:200)
     at ddf.minim.Minim.loadFile(Minim.java:357)
     at GravitBall$levels.startseiteset(GravitBall.java:798)
     at GravitBall$levels.<init>(GravitBall.java:783)
     at GravitBall.setup(GravitBall.java:465)
     at processing.core.PApplet.handleDraw(Unknown Source)
     at processing.core.PApplet.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)

If I try to start the second applet:

Exception in thread "Animation Thread" java.lang.NullPointerException
     at ddf.minim.javasound.JSMinim.getAudioInputStream(JSMinim.java:604)
     at ddf.minim.javasound.JSMinim.getAudioRecording(JSMinim.java:474)
     at ddf.minim.Minim.loadSnippet(Minim.java:317)
     at MoritzFinal.setup(MoritzFinal.java:100)
     at processing.core.PApplet.handleDraw(Unknown Source)
     at processing.core.PApplet.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)

Re: Export does not work
Reply #6 - May 30th, 2010, 12:26am
 
just a guess. did you use some audio files and put them in the root folder instead of the data folder? it works when running the sketch from processing, but they only get exported/archived when they are in the data folder
Re: Export does not work
Reply #7 - May 30th, 2010, 7:55am
 
Thanks for the hint! I moved the audio-files to the "data"-folder. Now the second applet works, but, unfortunately, the first one still does not...  Embarrassed

Here is what the Java Console says:

security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws,com.sun.
deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws,com.sun.
deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws,com.sun.
deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws,com.sun.
deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.javaws,com.sun.
deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
basic: Applet geladen
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 264019 us, pluginInit dt 1024607 us, TotalTime: 1288626 us
basic: Applet initialized
basic: Applet made visible
basic: Starting applet
basic: completed perf rollup
basic: Applet started
basic: Told clients applet is started
==== JavaSound Minim Error ====
==== Don't know the ID3 code WXXX

==== JavaSound Minim Error ====
==== Don't know the ID3 code TOPE

==== JavaSound Minim Error ====
==== Don't know the ID3 code APIC

Re: Export does not work
Reply #8 - Jun 1st, 2010, 4:28am
 
Hi there

I really tried everything, but I still can't export the sketch to an applet which works  Undecided
At least the music starts...

Here is the sketchbook: http://ul.to/2xkr0f

Could someone take a look at it? Please!!  Cry
Re: Export does not work
Reply #9 - Jun 2nd, 2010, 11:23pm
 
Please, please, please... Sad Cry

What wrong with this? http://ul.to/2xkr0f

I really can't export it.
Re: Export does not work
Reply #10 - Jun 3rd, 2010, 1:09am
 
hmm, i checked it, and i am pretty sure you shouldnt put size, somewhere in a function in your level class.
It has to be at the beginning of Setup.

Quote:
Again, the size() method must be the first line of the code (or first item inside setup). Any code that appears before the size() command may run more than once, which can lead to confusing results.


Re: Export does not work
Reply #11 - Jun 3rd, 2010, 3:13am
 
Hi Cedric

Thank you very much for your hint.

However, I've corrected it, but it still does not work  Sad

What I find strange is that the application (Exe-file) works fine, but the applet (html-file) does not  Lips Sealed
It must be something very small, just a minor mistake which makes it not run, i.e. not start correctly.

Here is the new version:
http://ul.to/fru14c

Re: Export does not work
Reply #12 - Jun 3rd, 2010, 3:18am
 
Agreed:

You seem to want to reset the levels with levels.startseteset() but there's no need to make another call to size() here and probably no need to run loadFont again either...

It's also worth pointing out that in your setup() method (on the Spielfeld tab) you don't have size() as the first line of code.  Whilst it seems there are caveats to this rule, it's best to stick to it unless you have good reason not to.  So your variable declarations, and (probably more importantly) object instantiations, loadFont etc. should be placed after size is set (and not least if, for example, your levels object depends on the results of size() in some way...)
Re: Export does not work
Reply #13 - Jun 3rd, 2010, 3:37am
 
Also you declare and try to instantiate a PImage array before setup has run:

Code:
PImage[] Wolke = new PImage[numFrames];  //Array 



Instead probably best to declare it and then instantiate it in setup:

Code:
PImage[] Wolke;

// snip

void setup() {
 size (675,420) {

 Wolke = new PImage[numFrames];

 // snip...
}


I can export it and run the HTML file fine here; though for some reason the size info isn't being applied to the HTML - but fixing that is a trivial edit to index.html Wink
Re: Export does not work
Reply #14 - Jun 3rd, 2010, 4:27am
 
yep, that was the only problem i had as well. didnt think of doing it by hand though Smiley
Pages: 1 2