kamalchopra / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Exception when using latest source in an applet #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using JSyntaxPane within an applet.  I recently built the latest
source from the r095 branch and now when I try to call
DefaultSyntaxKit.initKit I get the following exception:

Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader)
        at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:323)
        at java.security.AccessController.checkPermission
(AccessController.java:546)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
        at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1303)
        at jsyntaxpane.util.JarServiceProvider.findResource
(JarServiceProvider.java:232)
        at jsyntaxpane.util.JarServiceProvider.readProperties
(JarServiceProvider.java:120)
        at jsyntaxpane.DefaultSyntaxKit.loadConfig(DefaultSyntaxKit.java:621)
        at jsyntaxpane.DefaultSyntaxKit.getConfig(DefaultSyntaxKit.java:601)
        at jsyntaxpane.DefaultSyntaxKit.initKit(DefaultSyntaxKit.java:480)
        at jsyntaxpane.DefaultSyntaxKit.<clinit>(DefaultSyntaxKit.java:97) 

 I can still use the 0.9.5-b17 release in an applet without getting an an
exception.

getSystemClassLoader shouldn't be called in a secure environment such as an
applet.  I think I have a fix for this.  I will submit a patch here soon

Original issue reported on code.google.com by TomPo...@gmail.com on 8 Apr 2009 at 4:19

GoogleCodeExporter commented 9 years ago
Here's my diff file produced with svn diff.  I hope it makes sense, I'm new to
creating these files.

Essentially I've made sure the code doesn't call getSystemClassLoader without 
trying
to call getLoader from the class instead.  Does this sounds appropriate?

Original comment by TomPo...@gmail.com on 8 Apr 2009 at 4:31

Attachments:

GoogleCodeExporter commented 9 years ago
Good job.  I think I remember now that I did change some JarService loading 
settings
to load from different locations.  
I'll have a look at your fix and should commit it in 1-2 days.
Thanks again.

Original comment by ayman.al...@gmail.com on 8 Apr 2009 at 5:15

GoogleCodeExporter commented 9 years ago
Issue 80 has been merged into this issue.

Original comment by ayman.al...@gmail.com on 8 Apr 2009 at 5:17

GoogleCodeExporter commented 9 years ago
I'm not convinced that issue 80 is related but time will tell I suppose. I'm not
really in a position to test with JNLP right now (we're still using a good old
fashioned applet tag)

Original comment by TomPo...@gmail.com on 8 Apr 2009 at 5:18

GoogleCodeExporter commented 9 years ago
fixed in r110, please also check if it sorts out issue 80 about JNLP.

Original comment by ayman.al...@gmail.com on 9 Apr 2009 at 5:59

GoogleCodeExporter commented 9 years ago
Hi!, i'm user from #80. I've tested JNLP with r110, and it doesn`t work. 
Differences:
Version 0.9.5-b17 wroted to console the message quotted in issue #80, an r110 
does
not (nothing wroted).

Both cases doesn't syntax highlighting and there was no line numbers.  :(

Original comment by victor.martinez.conte@gmail.com on 13 Apr 2009 at 10:58