Here's the full message.  Works just fine when run as an application:

/opt/jdk/jdk1.7.0_45/bin/appletviewer index.html
Exception in thread "Thread-1" java.security.AccessControlException: access
denied ("java.lang.RuntimePermission" "createClassLoader")
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
    at
java.security.AccessController.checkPermission(AccessController.java:559)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at
java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:611)
    at java.lang.ClassLoader.checkCreateClassLoader(ClassLoader.java:275)
    at java.lang.ClassLoader.<init>(ClassLoader.java:336)
    at
com.thoughtworks.xstream.core.util.CompositeClassLoader.<init>(CompositeClassLoader.java:73)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:364)
    at boofcv.io.UtilIO.loadXML(UtilIO.java:154)
    at
boofcv.alg.geo.rectify.ShowRectifyCalibratedApp.changeInput(ShowRectifyCalibratedApp.java:154)
    at
boofcv.gui.SelectAlgorithmAndInputPanel.performChangeInput(SelectAlgorithmAndInputPanel.java:326)
    at
boofcv.gui.SelectAlgorithmAndInputPanel.access$200(SelectAlgorithmAndInputPanel.java:44)
    at
boofcv.gui.SelectAlgorithmAndInputPanel$8.run(SelectAlgorithmAndInputPanel.java:300)

The code right now is slightly different from the way it was before:

    public static <T> T loadXML( Reader r ) {
        XStream xstream = new XStream(new PureJavaReflectionProvider());
        xstream.registerConverter(new
JavaBeanConverter(xstream.getMapper()));
        return (T)xstream.fromXML(r);
    }

Another issue I have now is that the PureJavaReflectionProvider() has
issues with capitalization.  The variable is capitalized in the class but I
have to modify the xml by hand to make it lower case or it won't parse.

I also have more time now and should be able to reply faster.  Sorry for
the previous delays.

- Peter



On Mon, May 26, 2014 at 3:52 PM, Jörg Schaible <[email protected]>
wrote:

> Hi Peter,
>
> Peter A wrote:
>
> > A bit late, but I'm finally checking out the latest version of xstream
> for
> > Applet compatibility.  So far no luck.  When I run the following code
> > inside of appletviewer it crashes on the "new XStream()" line.  Code and
> > exception below.  Am I doing something wrong or are there still issues
> > that
> > need to be worked around?
>
> It seems so.
>
> > I'm using version 1.4.7 from Maven central
> > repository.
> >
> > Thanks!
> >
> > --------------------- BEGIN -------------------------
> >     public static <T> T loadXML( Reader r ) {
> >         XStream xstream = new XStream(new
> PureJavaReflectionProvider(),new
> > DomDriver(),new
> >             ClassLoaderReference(r.getClass().getClassLoader()));
> >         xstream.registerConverter(new
> > JavaBeanConverter(xstream.getMapper()));
> >         return (T)xstream.fromXML(r);
> >     }
> > --------------------- END -------------------------
> >
> > Exception in thread "Thread-1"
> > com.thoughtworks.xstream.InitializationException: Could not instantiate
> > mapper : com.thoughtworks.xstream.mapper.EnumMapper : access denied
> > ("java.lang.RuntimePermission" "getClassLoader")
> >     at
> > com.thoughtworks.xstream.XStream.buildMapperDynamically(XStream.java:622)
> >     at com.thoughtworks.xstream.XStream.buildMapper(XStream.java:596)
> >     at com.thoughtworks.xstream.XStream.<init>(XStream.java:568)
> >     at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
> >     at com.thoughtworks.xstream.XStream.<init>(XStream.java:489)
> >     at com.thoughtworks.xstream.XStream.<init>(XStream.java:428)
> >     at boofcv.io.UtilIO.loadXML(UtilIO.java:157)
>
>
> Is this the complete stack trace? I am missing at least one additional
> "caused by".
>
> Cheers,
> Jörg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


-- 
"Now, now my good man, this is no time for making enemies."    — Voltaire
(1694-1778), on his deathbed in response to a priest asking that he
renounce Satan.

Reply via email to