• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem running Spring in a java applet

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anybody managed to get Spring to work within a java applet?

We using Spring 2.5 to initialise an applet. Our requirement is to provide a user interface both as a Swing standalone and web enabled version (applet) to run by Jetty.

Our Swing version works fine. However when we try to run the same code in an applet, we get the error seen below

The applet code is quite simple. Any help or advice warmly welcome.




[ July 03, 2008: Message edited by: Ulf Dittmer ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Usually Applets aren't very complex so a Spring context would rarely be of any real benefit. Assuming you're that rare case...

This thread suggests that you might be able to pull this off from a JFrame class inside your Applet.
 
Andrew Och
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Marc

Thank you for your response. Actually we are not using Spring RCP just pure Spring and embedding the applet in a jar combined with Jetty (embedded Jetty server).

My colleague Mr. Zhang Han found a solution to this problem/error displayed in previous post:



The above snippet was added to the Jetty's Context handler.

The problem was caused by Jetty redirecting to the root context when receiving an invalid URL (naturally it needs at least the root context in the url). Rather then giving an error 404 it would then return html. However the java.beans.Introspector which searches for BeanInfo before analysising the class (this search in the applet effectively inputs an invalid url). The java.bean.Introspector then no longer anaylsed the bean because BeanInfo had data (html). Then the class loader tries to load the BeanInfo class which is actually only html. Ugh. The above fixes this :-)

Although this then removed the problem. He hit another problem which was related to permission and this was solved by signing all the jars.

Andrew & Han
[ July 03, 2008: Message edited by: Andrew Och ]
 
I am Arthur, King of the Britons. And this is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic