Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using EMF in Applets
Using EMF in Applets [message #421907] Mon, 18 August 2008 08:48 Go to next message
Ksenya Lossiev is currently offline Ksenya LossievFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

Is it possible to use EMF in untrusted applets? The idea is to create
EMF-based instances in the applet client code, serialize to XML string and
send it using sockets to the server side, which in turn will deserialize
the XML into EMF objects. I wrote a test that within Applet constructs
some EMF object using our generated MyMsgFactory - I got security
exception below during EPackageRegistry init. Are there any solutions for
this? Thanks in advance!

java.lang.ExceptionInInitializerError
at org.eclipse.emf.common.EMFPlugin.<clinit>(EMFPlugin.java:121)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.createGlobal Registry(EPackageRegistryImpl.java:69)
at org.eclipse.emf.ecore.EPackage$Registry.<clinit>(EPackage.java:81)
at
mycomp.model.mysmsg.impl.MyMsgFactoryImpl.init(MyMsgFactoryI mpl.java:37)
at mycomp.model.mysmsg.MyMsgFactory.<clinit>(MyMsgFactory.java:27)
at mycomp.client.ClientApplet.init(ClientApplet.java:100)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission
org.eclipse.emf.common.util.URI.encodePlatformResourceURIs read)
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.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at org.eclipse.emf.common.util.URI.<clinit>(URI.java:273)
... 8 more
Re: Using EMF in Applets [message #421909 is a reply to message #421907] Mon, 18 August 2008 09:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070409070205060207020002
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Ksenya,

We've certainly not done a lot of testing with security turned on. It's
possible to create a security profile/policy that would allow access to
the small number of specific system properties used by the EMF runtime
during stand alone execution

org.eclipse.emf.common.util.URI.encodePlatformResourceURIs
org.eclipse.emf.common.util.URI.archiveSchemes
line.separator
org.eclipse.emf.ecore.EPackage.Registry.INSTANCE

Have a look at the related links at the end of

http://java.sun.com/javase/6/docs/api/


Specifically
< http://java.sun.com/javase/6/docs/technotes/guides/security/ permissions.html#PropertyPermission>


http://java.sun.com/javase/6/docs/technotes/guides/security/ permissions.html#PropertyPermission


Ksenya Kveler wrote:
> Hello,
>
> Is it possible to use EMF in untrusted applets? The idea is to create
> EMF-based instances in the applet client code, serialize to XML string
> and send it using sockets to the server side, which in turn will
> deserialize the XML into EMF objects. I wrote a test that within
> Applet constructs some EMF object using our generated MyMsgFactory - I
> got security exception below during EPackageRegistry init. Are there
> any solutions for this? Thanks in advance!
>
> java.lang.ExceptionInInitializerError
> at org.eclipse.emf.common.EMFPlugin.<clinit>(EMFPlugin.java:121)
> at
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.createGlobal Registry(EPackageRegistryImpl.java:69)
>
> at org.eclipse.emf.ecore.EPackage$Registry.<clinit>(EPackage.java:81)
> at
> mycomp.model.mysmsg.impl.MyMsgFactoryImpl.init(MyMsgFactoryI mpl.java:37)
> at mycomp.model.mysmsg.MyMsgFactory.<clinit>(MyMsgFactory.java:27)
> at mycomp.client.ClientApplet.init(ClientApplet.java:100)
> at sun.applet.AppletPanel.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.security.AccessControlException: access denied
> (java.util.PropertyPermission
> org.eclipse.emf.common.util.URI.encodePlatformResourceURIs read)
> 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.checkPropertyAccess(Unknown Source)
> at java.lang.System.getProperty(Unknown Source)
> at org.eclipse.emf.common.util.URI.<clinit>(URI.java:273)
> ... 8 more
>
>

--------------070409070205060207020002
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ksenya,<br>
<br>
We've certainly not done a lot of testing with security turned on.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using EMF in Applets [message #421920 is a reply to message #421909] Mon, 18 August 2008 13:23 Go to previous message
Ksenya Lossiev is currently offline Ksenya LossievFriend
Messages: 3
Registered: July 2009
Junior Member
Thanks, Ed!
Previous Topic:EMF databinding - Observing multiple structural features on Eobject
Next Topic:Sequence Diagram to Java Code ATL Transformations
Goto Forum:
  


Current Time: Fri Apr 26 05:01:54 GMT 2024

Powered by FUDForum. Page generated in 0.03686 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top