Discussions

Web tier: servlets, JSP, Web frameworks: XML to Java Beans in an Applet

  1. XML to Java Beans in an Applet (1 messages)

    I'm trying to develop an applet that reads in some XML output from an HTTP request and tries to deserialize the xml stream to Java objects. There are a few open-source projects that help you in Serializing Java to XML and Deserializing XML to Java. I have used XStream on the server side in the past and it works great but unfortunately this framework does not in an <APPLET> framework because in an applet you cannot construct a "custom" classloader. So I end up getting the following exception:
        java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkCreateClassLoader(Unknown Source)
    at java.lang.ClassLoader.<init>(Unknown Source)
    at com.thoughtworks.xstream.core.util.CompositeClassLoader.<init>(CompositeClassLoader.java:39)
    at com.thoughtworks.xstream.core.DefaultClassMapper.<init>(DefaultClassMapper.java:28)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:144)
    at com.avedatech.tree.util.TreeNodeConverter.convertTreeNodeFromXML(TreeNodeConverter.java:35)
    at com.avedatech.tree.TreePanel.getRootNode(TreePanel.java:104)
    at com.avedatech.tree.TreePanel.<init>(TreePanel.java:40)
    at com.avedatech.tree.ViewTree.start(ViewTree.java:113)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    -----------------------

    Does anyone know of a open source product that does not use the "Class-Loading" methodology to deserialize and XML stream to Java beans?

    Thanks

    Venkatt Guhesan
    Aveda Technology

    Threaded Messages (1)

  2. Solved[ Go to top ]

    I have a solution to the problem. I'm using Castor and it seems to not use a classloader.

    Hope this tidbit helps someone using XML<->Java serializing and deserializing in an Applet Environment.

    Cheers

    Venkatt Guhesan
    Aveda Technology