struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grish <gin1...@hotmail.com>
Subject Re: [S2] Problems loading applet in Struts 2
Date Tue, 11 Dec 2007 14:51:17 GMT

well that's one of my problems, it seems like my browser hangs everytime the
page is rendered. I can't view the source of the page, so i can't verify the
codebase. So what I did try was putting the jar in the same folder as the
page. That didn't work, so I tried putting the class files in the same
directory as the page and jsut placed the class names. Unfortunately I get
the same error and my browser has to be killed in order to retry cuz it
seems to be in some kind of loop or hang.



Laurie Harper wrote:
> 
> Grish wrote:
>> Hi,
>> 
>> I just learned how to create applets and made my own ticker. It works
>> fine
>> but when I try to integrate it to my struts 2 project I have problems
>> loading the page with the applet. It seems like my browser hangs and I
>> need
>> to kill the process. 
>> 
>> I first did was package my applet and its files in a jar and placed it in
>> my
>> applets/ folder. Then on my page I had the following:
>> 
>> <applet code="TickerApplet.class" 
>>     codebase="${pageContext.request.contextPath}/applets/"
>> archive="ticker.jar">    
>>   </applet>
>> 
>> but my applet doesn't load because it cannot find the TickerApplet class
>> and
>> my browser seems to hang. 
>> 
>> I get the following error:
>> 
>> load: class TickerApplet.class not found.
>> java.lang.ClassNotFoundException: TickerApplet.class
>> 	at sun.applet.AppletClassLoader.findClass(Unknown Source)
>> 	at java.lang.ClassLoader.loadClass(Unknown Source)
>> 	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
>> 	at java.lang.ClassLoader.loadClass(Unknown Source)
>> 	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
>> 	at sun.applet.AppletPanel.createApplet(Unknown Source)
>> 	at sun.plugin.AppletViewer.createApplet(Unknown Source)
>> 	at sun.applet.AppletPanel.runLoader(Unknown Source)
>> 	at sun.applet.AppletPanel.run(Unknown Source)
>> 	at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: open HTTP connection failed.
>> 	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
>> 	at sun.applet.AppletClassLoader.access$100(Unknown Source)
>> 	at sun.applet.AppletClassLoader$1.run(Unknown Source)
>> 	at java.security.AccessController.doPrivileged(Native Method)
>> 	... 10 more
>> 
>> I tried moving around my applet to the same directory as the page or just
>> use the class files but none of those approaches work.
>> 
>> Can anyone share any insight with my problem? Many thanks!
> 
> Look at the rendered HTML (view source) and check what's actually being 
> rendered as the value of the 'codebase' attribute. Does it look right? 
> What happens if you try visiting that URL? What happens if you append 
> 'ticker.jar' to that URL? Does the JAR file download?
> 
> Assuming that's all OK, check the contents of the JAR file (use 'jar -t 
> applets/ticker.jar); does it correctly contain all your applet's .class 
> files?
> 
> L.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Problems-loading-applet-in-Struts-2-tp14270527p14275440.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message