Bobza
Senior Newbie 
|
 |
«
Posted
2011-04-12 13:29:50 » |
|
Hi all,
I'm trying to get jogl running in an applet. My application runs well from Eclipse. The jogl.jar, jogl.dll and so are in the jar file called by the applet, but I still have got an AccessDenied exception when manualy trying to load the library with a System.loadLibrary command (just to test if the jvm find the native libraries)
I think this issue is caused by the jre 1.6 that contains a bad distribution of jogl In eclipse, I had the same kind of issue ; I resolved it puting the jre at the bottom of the list in the "Order and Export" Tab in the "Java build path" options.
But I dont know how to do the same with an applet (or using jvm parameters or so). How can I say my applet not to load jogl packages of the jre distribution ?
An other question is about the appletLauncher used in the GearsDemo for example. I don't really understand how it works (it seems to be an applet loading another applet is it right ?) and why it's usefull I undestood it uses the jnlp file, but all this seems more complicated than using a applet running the jar file ... What are the issues ?
|
|
|
|
gouessej
|
 |
«
Reply #1 - Posted
2011-04-12 13:51:53 » |
|
Hi
Which version of JOGL do you use? You should rather post on jogamp.org. I only use Java Web Start to deploy JOGL applications, some other users may help you on this forum.
|
|
|
|
kappa
|
 |
«
Reply #2 - Posted
2011-04-12 13:58:37 » |
|
But I dont know how to do the same with an applet (or using jvm parameters or so). How can I say my applet not to load jogl packages of the jre distribution ?
Hmm, i think your confusing something here as the jre doesn't contain a jogl package. Unless of course you put jogl files into the jre directory which you should never do. An other question is about the appletLauncher used in the GearsDemo for example. I don't really understand how it works (it seems to be an applet loading another applet is it right ?) and why it's usefull I undestood it uses the jnlp file, but all this seems more complicated than using a applet running the jar file ... What are the issues ?
Jogl requires native files (*.dll files on windows) to be able to function, these need to be downloaded and loaded by the jvm before it can function as an applet. One way to load natives in an applet is using the appletlauncher which will start as an applet (before the normal applet), download and load the natives for you before loading the normal applet. The other method to do this is through jnlp (java 1.6.0_10+).
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #3 - Posted
2011-04-12 14:20:41 » |
|
Thanks guys for your responses Hmm, i think your confusing concepts here a little as the jre doesn't contain a jogl package. Unless of course you put jogl files into the jre directory which you should never do.
You're right : it's not the jre but the jdk 1.6 that contains a jogl distribution (I checked it on my disk). My JAVA_HOME env variable is set to the JDK directory so ... could this be the issue with it ? Jogl requires native files (*.dll files on windows) to be able to function, these need to be downloaded and loaded by the jvm before it can function as an applet. One way to load natives in an applet is using the appletlauncher which will start as an applet (before the normal applet), download and load the natives for you before loading the normal applet. The other method to do this is through jnlp (java 1.6.0_10+).
So, using the applet launcher, you dont have to put jogl.jar and dll in the jar to deploy, am'i right ? Ok this makes sens ... but developping the jnlp file is not so easy (i already tried it) and i didn't find good articles or tutorials on it. Would you know some ? Trying to adapt the jnlp file from the GearsDemo but I get some ClassNotFoundException. Looks like the jar file is not found. Here follow my jnlp file 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <?xml version="1.0" encoding="utf-8"?> <jnlp href="file:///F:\work\site\test.jnlp"> <information> <title>JOGL JNLP Applet Gears Demo</title> <vendor>Sun Microsystems, Inc.</vendor> <homepage href="http://jogl-demos.dev.java.net/"/> <description>Gears Demo</description> <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description> <offline-allowed/> </information>
<resources> <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="file:///F:/work/site/builder.jar" main="true"/> // location of the jar file <extension name="jogl-all-awt" href="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp" /> </resources>
<applet-desc name="Gears-Applet" main-class="launchers.simpleLauncher.class" width="640" height="480"> </applet-desc> </jnlp> |
|
|
|
|
kappa
|
 |
«
Reply #4 - Posted
2011-04-12 14:33:11 » |
|
You're right : it's not the jre but the jdk 1.6 that contains a jogl distribution (I checked it on my disk). My JAVA_HOME env variable is set to the JDK directory so ... could this be the issue with it ?
Nope, thats wrong, JOGL is a third party library and is not part of the JRE or JDK. So, using the applet launcher, you dont have to put jogl.jar and dll in the jar to deploy, am'i right ? Ok this makes sens ... but developping the jnlp file is not so easy (i already tried it) and i didn't find good articles or tutorials on it. Would you know some ?
Nope that's also incorrect, the appletlauncher is only a utility class, you will still have to include jogl.jar and pass the native jars to the appletlauncher via parameters. I'm not aware of any documentation of the appletlauncher but learning from the gears example is probably your best bet. However when using the jnlp file you've linked to above ( http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp) it already contains the jogl.jar and natives files (which are hosted on that same domain) so should work. The class not found error usually means that your main class isn't found, check main-class="launchers.simpleLauncher.class" is correct.
|
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #6 - Posted
2011-04-12 14:57:01 » |
|
Nope, thats wrong, JOGL is a third party library and is not part of the JRE or JDK.
Really ? That's weird ... I was pretty sure of it cause I've the same issue when running jogl application from eclipse and I have to put the jdk at the bottom of the "Order list" in the class path tab ... I may have confused and copied dll and jar in the jdk installation directory ... Thanks all. It's not running yet, but I will get it !!! 
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #7 - Posted
2011-04-13 09:23:18 » |
|
Me again I'm getting crazy I try to make the gearsapplet run in "local mode" : has shown on http://download.java.net/media/jogl/demos/www/applettest-jnlp.html I created a jnlp file, downloaded the jogl-demos.jar and jodl-demos-util.jar (utility of this one for the gearsappet ?), changed the href values but ... I ran it once with a bad value for the href attribute of the jnlp tag (utility of this href ? a href that links to its file ?) 1
| <jnlp href="gearsapplet.jnlp"> |
JVM console says the href value is wrong. I already had this error so I know that the href value must contain the path to the jnlp file. SO I change it ... and I still have the same error... Some caching issue I guess ... how to flush the cach ?
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #8 - Posted
2011-04-13 09:27:57 » |
|
Changing the jnlp name file (and the associate href value in the jnlp tag) was "enougth" to solve the trouble ... but I guess A LOT of my past troubles were due to some caching issue. So if you know how to flush ALL the cash stuff, [size=10pt] please [/size]  let me know... Now I will try to get my own applet running...
|
|
|
|
kappa
|
 |
«
Reply #9 - Posted
2011-04-13 09:38:21 » |
|
to clear the applet cache you need to go to the java control panel (on windows you find this in the windows control panel) click settings and then delete files. This will clear the java cache for you.
Java's cache has always been kinda crappy like that, its mainly why its completely switched off in the LWJGL AppletLoader, which manages its own cache.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #10 - Posted
2011-04-13 10:09:11 » |
|
Thanks, this will be VERY useful ! I modified the gearsapplet to use my Applet 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?xml version="1.0" encoding="utf-8"?> <jnlp href="file:/F:/work/site/gearsapplet/builder5.jnlp"> <information> <title>JOGL JNLP Applet Gears Demo</title> <vendor>Sun Microsystems, Inc.</vendor> <homepage href="http://jogl-demos.dev.java.net/"/> <description>Gears Demo</description> <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description> <offline-allowed/> </information>
<resources> <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="file:/F:/work/site/gearsapplet/builder5.jar" main="true"/> <jar href="file:/F:/work/site/gearsapplet/jogl-demos-util.jar"/> <extension name="jogl-all-awt" href="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp" /> </resources>
<applet-desc name="Gears-Applet" main-class="launchers.MyAppletLauncher" width="640" height="480"> </applet-desc> </jnlp> |
my applet is launched but I still get a java.lang.NoClassDefFoundError: javax/media/opengl/GLCanvas The jvm can't find jogl.jar ... Why ? The 1
| <extension name="jogl-all-awt" href="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp" /> |
should do it ... Why the appletgears can find this jar and not my applet ?
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #11 - Posted
2011-04-13 10:14:59 » |
|
Holly s**t ...  The GearsApplet contains 1
| import javax.media.opengl.awt.GLCanvas; |
my applet contains 1
| import javax.media.opengl.GLCanvas; |
some version issue I guess ...
|
|
|
|
gouessej
|
 |
«
Reply #12 - Posted
2011-04-13 12:01:35 » |
|
Holly s**t ...  The GearsApplet contains 1
| import javax.media.opengl.awt.GLCanvas; |
my applet contains 1
| import javax.media.opengl.GLCanvas; |
some version issue I guess ... I already told you that you are using an obsolete version. [size=20pt]It is a bit outdated, it would be better to use this: http://jogamp.org/deployment/webstart-next/jogl-all-awt.jnlp[/size]
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #13 - Posted
2011-04-13 13:19:17 » |
|
I already told you that you are using an obsolete version.
.... you just dont even succeed in porting your game in an applet and encountered troubles like mine ... your post was really useless ; you'd better shut up this trouble is not linked to the jnlp usage but to my code. I like to understand what lies behind troubles, if you dont, this is your problem ; I dont change of version "just to" ... Now I can understand what happened and could eventually help other people
|
|
|
|
gouessej
|
 |
«
Reply #14 - Posted
2011-04-13 13:46:50 » |
|
I already told you that you are using an obsolete version.
.... you just dont even succeed in porting your game in an applet and encountered troubles like mine ... I have never wanted to port my game into an applet as I have realized by myself that the support of applet is quite poor on some browsers especially on Google Chrome/Chromium and Opera. your post was really useless ; you'd better shut up No comment. this trouble is not linked to the jnlp usage but to my code. I like to understand what lies behind troubles, if you dont, this is your problem ; I dont change of version "just to" ...
Now I can understand what happened and could eventually help other people You wrote: Holly s**t ...  The GearsApplet contains 1
| import javax.media.opengl.awt.GLCanvas; |
my applet contains 1
| import javax.media.opengl.GLCanvas; |
some version issue I guess ... I only tell you that the GearsApplet uses the current version of JOGL 2. As you can see, GLCanvas is there now: http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/awt/GLCanvas.htmlJOGL is no more on jogl.dev.java.net, it has been moved to jogamp.org. You're using a completely obsolete version, you will have some other problems if you don't switch to a more recent version as lots of bugs have been fixed since this move. JOGL is not a part of the JRE or JDK, it is a third party library, it is anew a community project as Oracle abandoned this project last year which explains why Sven and Michael moved all the stuff from dev.java.net to jogamp.org. My comment does not directly help you to solve your current problem but using a recent version is the best way to benefit of bug fixes. The version you're using is almost 2 years old, that is why I say it is obsolete, I'm not exagerating. The API has changed since 2009, you won't be able to use our examples as is if you go on using this old version. I hope my comment is not useless. Best regards.
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #15 - Posted
2011-04-13 14:03:24 » |
|
I have never wanted to port my game into an applet as I have realized by myself that the support of applet is quite poor on some browsers especially on Google Chrome/Chromium and Opera.
liar  Dont try to fool me, you gave up because you were not able to make your applet run ! I rode your posts on forums (java-fr I think) this week-end, where you had similar issues that the one I had (caching issues I guess) Short memory or selective memory ? mdr Your posts are REALLY useless  for the applet programming domain at least
|
|
|
|
gouessej
|
 |
«
Reply #16 - Posted
2011-04-13 15:33:51 » |
|
I have never wanted to port my game into an applet as I have realized by myself that the support of applet is quite poor on some browsers especially on Google Chrome/Chromium and Opera.
liar  Dont try to fool me, you gave up because you were not able to make your applet run ! I rode your posts on forums (java-fr I think) this week-end, where you had similar issues that the one I had (caching issues I guess) Short memory or selective memory ? mdr Your posts are REALLY useless  for the applet programming domain at least These posts on java-fr are completely outdated, I wrote this in 2007: http://www.javafr.com/forum/sujet-JOGL-APPLET_900532.aspxI wrote that in one of the posts: Je suis passé à Java Web Start translation: "I have moved to Java Web Start" I was still studying at the university at this time whereas I work as an engineer in computer science since the middle of 2007, I use JOGL every day, I improved a lot the port of JMonkeyEngine 2.0 for JOGL 1.1.1a with Mathias Henze (alias cylab), I ported JMonkeyEngine 3 and NiftyGUI to JOGL 2.0 alone, I gave some minor fixes (on the JOGL renderer) and contributions (MD2 loader) to Ardor3D... I know Google Chrome as I provided a fix for it, look in this thread: http://code.google.com/p/chromium/issues/detail?id=10877and there: http://codereview.chromium.org/5971007/The ancestor of TUER (d3caster) was an applet, that was why I was trying to make it work as an applet. However, I explained in 2007 in the thread about my game here that I prefer converting it into a full screen application. You have a very selective reading, don't you? I'm not a newbie and you have a very selective way of using information. You have insulted me several times, you don't make me laugh. You have found some four-year-old posts, you have just exhumed them to laugh about me. This has to come to an end. You're wrong, I have nothing to prove, read the lonnnnnng thread about TUER if you still believe I like applets very much (which is wrong). I only wanted to avoid you some problems by giving you a useful tip, someone else in the newbie section has solved his problem only by updating its JOGL build, my advises are not useless. Good luck (and please stop insulting me).
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #17 - Posted
2011-04-13 15:46:45 » |
|
Please stop flooding my thread ; your responses are useless for me. So please, let other people with interesting things to write ; you look better in writing lybian restaurant tour mdr
I insulted you ? Who first lacked respect to the other ? You with size=20 response.
kappa had really intersting responses ; let him and others posts. You are not intersted in helping people, you're just interested in showing you're right
|
|
|
|
Mike
|
 |
«
Reply #18 - Posted
2011-04-13 16:49:23 » |
|
Bobza,
Seeing as gouessej is the strongest power on this forum trying to keep JOGL alive, and keeps defending it at every chance possible, I very much doubt that he wasn't sincerely trying to help you. If you want people to dare to post in your future threads I suggest that you take advice for what it is, advice. It is a lot better to say "thank you but I've already tried that", and not "your post was really useless ; you'd better shut up".
Kind regards, Mike
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #19 - Posted
2011-04-14 07:51:55 » |
|
Man, you're right and wise man.
Misunderstandings led to confusion. My apologizes to gouessej (but please stop using size=20 response mdr)
|
|
|
|
gouessej
|
 |
«
Reply #20 - Posted
2011-04-14 08:48:33 » |
|
(but please stop using size=20 response mdr)
I'm sorry for that, really, I did it because you did not take into account of it the first time, it was neither an order, nor a lack of respect. I have nothing against you. As Mickelukas said, I try to keep JOGL alive. Since Sven moved all stuffs on jogamp.org, a lot of people still use outdated versions which lead to various problems. JOGL 1.1.1a is no more maintained, we only maintain JOGL 2.0 (the official JogAmp version, not Sun's one). When they come here, on jogamp.org or elsewhere (stackoverflow, javafr.com, etc...), sometimes we "waste" a noticeable amount of time only because they use a "bad" version and this is rarely the first thing they say. We try to help as much people as possible, I have never wanted to offense anyone, I apologive to you for using a big font size, it was an inappropriate reaction. Sven, DzzD (the french guy who created 3DzzD engine) and of course Lilian Chamontin (the main contributor of the JOGL applet launcher, see "Zoltar's return") are the best people to help you on JOGL and applets. If you switch to IzPack, Mr Ponge will be more helpful. If you plan to use Java Web Start, I can provide you a JNLP file and help you to modify your source code to make it work. <offtopic> you look better in writing lybian restaurant tour mdr
The word "lybian" does not exist ("Libyan" does). The article you're talking about has been published in both languages, its title is: Les cèdres du Liban : restaurant libanais à Paris [Cedars of Lebanon: Lebanese restaurant in Paris] http://gouessej.wordpress.com/2011/04/10/les-cedres-du-liban-restaurant-libanais-a-paris-cedars-of-lebanon-lebanese-restaurant-in-paris/Libyan != Lebanese </offtopic>
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #21 - Posted
2011-04-14 17:13:01 » |
|
It's ok now, with jogl 2.0 b23 it's running fine, both jnlp and applet (with fireforx) I had hard times particulary cause I thought I had to use a local newt-all-awt.jnlp, but actually, only jar in the resources tag are needed to be at the same location that the jnlp file ; for an extension, an online version is all right. I also had troubles getting the good things, libraries, source codes and so on the jogamp web site ; it's a bit messy (or am'i getting old ? mdr) ... that's one of the reason why I was still using jogl 1.1, cause I felt a bit lost  Nevertheless, it's working !!! Thanks all ! I learnt a lot of things (still have a lot to improve ; ant or maven using for example mdr)
|
|
|
|
gouessej
|
 |
«
Reply #22 - Posted
2011-04-14 21:05:25 » |
|
I also had troubles getting the good things, libraries, source codes and so on the jogamp web site ; it's a bit messy (or am'i getting old ? mdr) ... that's one of the reason why I was still using jogl 1.1, cause I felt a bit lost  When you plan to switch to JOGL 2, take the most recent release candidate or the most recent dev build. I still use JOGL 1.1.1a on my hobby project but I know I will have to switch. Sorry, the webpage is still a bit confusing. Nevertheless, it's working !!! Thanks all ! I learnt a lot of things (still have a lot to improve ; ant or maven using for example mdr)
You can find an example of use of ANT to create JARs, sign them, generate a JNLP file, etc... in my repository. You can use scp or something like that if you want to automatize the copy of the local JNLP file from your machine to your FTP server. Some JOGL users on JogAmp have tried to use Maven.
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #23 - Posted
2011-04-20 08:16:52 » |
|
I did checkout your projet ; it sure will be helpfull. Your ant file is so complexe !  I still have a few askings ; I did a few search on the net, but wasn't able to find something - my application opens a modal dialog (JDialog) ; when it closes, the parent "frame" and glcanvas lose the focus ; I have to manually give it back (by clicking). - events (mouse wheel down and up) are caught by my applet (it's all right with this) but also by the browser that scrolls the page up and down for example that is very annoying. I tried the "consume" method but it doesn't work.
|
|
|
|
gouessej
|
 |
«
Reply #24 - Posted
2011-04-20 13:56:32 » |
|
Hi! I did checkout your projet ; it sure will be helpfull. Your ant file is so complexe !  Things have to be complicated before becoming simple  My ANT file is complicated but it is commented and very helpful. I'm lazzy, I only have to enter my password and it compiles everything, it generates the JARs and the JNLP files, it does almost all the deployment. I still have a few askings ; I did a few search on the net, but wasn't able to find something - my application opens a modal dialog (JDialog) ; when it closes, the parent "frame" and glcanvas lose the focus ; I have to manually give it back (by clicking). - events (mouse wheel down and up) are caught by my applet (it's all right with this) but also by the browser that scrolls the page up and down for example that is very annoying. I tried the "consume" method but it doesn't work.
You can programmatically manipulate the focus, can't you? I don't reproduce the last bug you're talking about. Are you sure you now use the latest build of JOGL 2?
|
|
|
|
ra4king
|
 |
«
Reply #25 - Posted
2011-04-21 02:38:55 » |
|
@gouessej Sorry to butt in on this thread, but I'm trying to learn how to use ANT, so where is your repository? 
|
|
|
|
Bobza
Senior Newbie 
|
 |
«
Reply #26 - Posted
2011-04-21 09:10:05 » |
|
It's ok ; requestFocus and consume methods are working fine ... I was just using the wrong jar file ...  For other people information - when using a JDialog in an applet, you should give the parent frame the focus back with requestFocus when closing the dialog. - when dealing with MouseWheelEvents, you should consume the event after it processing so that the browser doesnt get it and scroll the page up and down. This working may be different depending on the browser I guess...
|
|
|
|
gouessej
|
 |
«
Reply #27 - Posted
2011-04-21 12:52:24 » |
|
Hi! It's ok ; requestFocus and consume methods are working fine ... I was just using the wrong jar file ...  I'm glad to know it works for you  @gouessej Sorry to butt in on this thread, but I'm trying to learn how to use ANT, so where is your repository?  The repository is there: http://tuer.svn.sourceforge.net/You can learn how to use all these files there: http://tuer.sourceforge.net/download.php
|
|
|
|
ra4king
|
 |
«
Reply #28 - Posted
2011-04-21 18:01:10 » |
|
Thanks! 
|
|
|
|
|