Ok, try this (assuming you're using Tomcat): 1. Copy the working STATIC html file into <tomcat_home>/webapps/qguide
2. Copy your applet class into <tomcat_home>/webapps/qguide/applet (I'm assuming that the class does not need any third party libraries) 3. Try to get the above to work, if it doesn't then you have issues at the tomcat level, perhaps wrong mime type or something, permissions, etc., which can be sorted out later. Hopefully it works.. ** Assuming the above works: 4. Copy the <applet>..</applet> tag from the STATIC html file into your screen .vm file and put the .vm file in <tomcat_home>/webapps/qguide/templates/screens FIX UP THE PATHS (use relative paths). Note that in this case you can treat the Turbine "templates" directory like any other directory in your HTML code. 5. Try and see if that works, which should, unless you got the paths wrong. 6. Now, try to do it "dynamically" using $content.getURI('applet'), so use similar code provided previously by "McTaggart, Peter". Put your new screen .vm file in <tomcat_home>/webapps/qguide/templates/screens 7. Try to access the page. If it works, voila, done! If not, view the source code for the page. It should yield the same code as your STATIC html page. If it isn't the same, then you'll know where the problem is. The idea here is to have Turbine generate the *exact* same html page as your static one. Regards, Dan On Fri, 21 Nov 2003, David Ramsey wrote: > There must be something so amazingly basic I'm overlooking. No, your > example does not work. I can easily build and run the clock applet in a > separate HTML page. But it doesn't work when invoked from my webapp. > > I've reverted to my original web.xml file. The application name is > "qguide", and the hierarchy looks like this: > > webapps--qguide--applet--Clock.class > > The Velocity files are in: > > webapps--qguide--templates--screens > > In screens, a file named StatusSummary.vm contains these lines: > > <applet codebase="$content.getURI('applet')" code="Clock.class" > width='150' height='150'> > alt="Your browser understands the <APPLET> tag but isn't > running the applet, for some reason." > Your browser is completely ignoring the <APPLET> tag! > </applet> > > ...and I STILL get the gray box with a red "X" in it. God must hate me. > > So I thought hey, I'm trying this on a Mac running OS X. Everybody > knows Macs are weird. So I'll move the files over to my Win XP box and > try them there. > > Exact. Same. Error. > > Setting the trace level on the Java consoles in both Mac and Windows > produces the same trace: > > User home directory = /Users/dramseyTrace level set to 5: basic, net, > security, ext, liveconnect ... completed. > Stopping applet ... > Joining applet thread ... > Destroying applet ... > Disposing applet ... > Quiting applet ... > Joined applet thread ... > Finding information ... > Releasing classloader: [EMAIL PROTECTED], refcount=0 > Caching classloader: [EMAIL PROTECTED] > Current classloader cache size: 1 > Done ... > Referencing classloader: [EMAIL PROTECTED], refcount=1 > Loading applet ... > Connecting http://67.115.140.147:8080/qguide/applet/Clock.class with no > proxy > Connecting http://67.115.140.147:8080/qguide/applet/Clock.class with > cookie "JSESSIONID=o51tfqwhk1" > Initializing applet ... > Starting applet ... > Cached file name: Clock.class-63505803-51a234a9.class > java.lang.ClassFormatError: Clock (Bad magic number) > at java.lang.ClassLoader.defineClass0(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:502) > at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) > at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:156) > at > sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java: > 168) > at java.lang.ClassLoader.loadClass(ClassLoader.java:299) > at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:122) > at java.lang.ClassLoader.loadClass(ClassLoader.java:255) > at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:509) > at sun.applet.AppletPanel.createApplet(AppletPanel.java:574) > at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1831) > at sun.applet.AppletPanel.runLoader(AppletPanel.java:503) > at sun.applet.AppletPanel.run(AppletPanel.java:292) > at java.lang.Thread.run(Thread.java:554) > Exception: java.lang.ClassFormatError: Clock (Bad magic number) > > ...but of course that trace is COMPLETELY USELESS. I edited the > information in the <applet> tag to a non-existent directory and class > file and got this: > > Connecting http://67.115.140.147:8080/qguide/raskin/glotzy.class with > no proxy > Connecting http://67.115.140.147:8080/qguide/raskin/glotzy.class with > cookie "JSESSIONID=o51tfqwhk1" > Loading applet ... > Initializing applet ... > Starting applet ... > Cached file name: glotzy.class-121913cc-40fad96f.class > java.lang.ClassFormatError: glotzy (Bad magic number) > at java.lang.ClassLoader.defineClass0(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:502) > at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) > at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:156) > at > sun.plugin.security.PluginClassLoader.findClass(PluginClassLoader.java: > 168) > at java.lang.ClassLoader.loadClass(ClassLoader.java:299) > at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:122) > at java.lang.ClassLoader.loadClass(ClassLoader.java:255) > at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:509) > at sun.applet.AppletPanel.createApplet(AppletPanel.java:574) > at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1831) > at sun.applet.AppletPanel.runLoader(AppletPanel.java:503) > at sun.applet.AppletPanel.run(AppletPanel.java:292) > at java.lang.Thread.run(Thread.java:554) > Exception: java.lang.ClassFormatError: glotzy (Bad magic number) > > Same trace, different names. > > I'm about ready to give up, frankly. Auto-reloading the page is looking > better and better. Writing applications in C++, which I did for almost > a decade and caused me to develop hives, bad breath, and a surly > attitude, is suddenly looking pretty good, too... > > -- David > > On Nov 20, 2003, at 8:18 PM, EXT-McTaggart, Peter wrote: > > > > > I tried this on my current app with a demo applet from Sun. > > Clock.class. > > I also tried it with an applet that > > uses multiple classes --- the MoleculeViewer example. > > Both worked without any changes to my default config. > > > > I just added this class to my page and put the class files in the > > applet > > directory located at webapps/<myapp>/applet. > > I had all of the class files in the same directory (ie. the applet > > directory ). This demo applet can be found at > > http://java.sun.com/products/plugin/1.4.2/demos/applets.html or in your > > j2sdk demos/applets directory. > > > > <applet codebase="$content.getURI('applet')" code="Clock.class" > > width='150' height='150'> > > alt="Your browser understands the <APPLET> tag but isn't > > running the applet, for some reason." > > Your browser is completely ignoring the <APPLET> tag! > > </applet> > > > > Can you get something simple like this working? > > > > Have you fiddled with the web.xml file? I was able to serve up the > > class > > in an applet directory as above without > > touching my vanilla web.xml. If you can serve images then you should be > > able to serve other files out of your root directory. (You could even > > try to serve your applet out of your images directory to be really sure > > ...) > > > > Not much help really... > > > > If you haven't already... can you turn tracing on in the java plugin > > console and see where it is looking for your applet classes to load? > > > > good luck > > Peter > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]