File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JNLP and Web Start and the fly likes Using xstream with JWS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Using xstream with JWS" Watch "Using xstream with JWS" New topic

Using xstream with JWS

Aaron Roberts
Ranch Hand

Joined: Sep 10, 2002
Posts: 174
I've got an app that uses xstream ( to serialize objects in and out for me. I can jar my application up and run it fine. When I try to deploy it using java web start, I get a security error.

Caused by: access denied (java.lang.RuntimePermission accessDeclaredMembers)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
at java.lang.Class.checkMemberAccess(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at com.thoughtworks.xstream.core.JVM.<clinit>(

Has anyone used xstream with jws?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

JWS apps run in the same security sandbox as applets run in. Are you serializing these objects to the file system? If so, you'll need to make sure ALL your JAR files used by JWS have been signed. Also, you'll need to specify access in your jnlp file as such:

Each application is, by default, run in a restricted execution environment, similar to the Applet sandbox. The security element can be used to request unrestricted access.

If the all-permissions element is specified, the application will have full access to the client machine and local network. If an application requests full access, then all JAR files must be signed. The user will be prompted to accept the certificate the first time the application is launched.

which is taken from the documentation here.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Using xstream with JWS
It's not a secret anymore!