xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Surendra Babu Kunka (JIRA)" <j...@apache.org>
Subject [jira] [Created] (BATIK-1079) SecurityException while generating JPEG from SVG string using batik
Date Fri, 22 Aug 2014 11:01:12 GMT
Surendra Babu Kunka created BATIK-1079:

             Summary: SecurityException while generating JPEG from SVG string using batik
                 Key: BATIK-1079
                 URL: https://issues.apache.org/jira/browse/BATIK-1079
             Project: Batik
          Issue Type: Bug
          Components: SVG Rasterizer
    Affects Versions: 1.7
         Environment: Windows/Linux
            Reporter: Surendra Babu Kunka

We are getting exception while exporting chart SVG string to JPEG file.

Batik Version : 1.7
Exception :

java.lang.SecurityException: The application cannot install or remove a security manager when
there is already one it place that it did not install.

Root cause: 

In my webapplication, we already installed the security manager to perform some checks.Now
when we try to export chart to JPEG we are invoking batik with arguments "-scriptSecurityOff".it
is failed to pass the security checks due to my application is already installed security

We are invoking batik Main.execute() method by passing arguments.

String[] inputArr = { "-scriptSecurityOff", "-m","JPEG", inputFileName };
(new org.apache.batik.apps.rasterizer.Main(inputArr)).execute();

After debugging the exception, we came to know there are security checks happening in ApplicationSecurityEnforcer.java.

Class Name :    ApplicationSecurityEnforcer.java
Method Name : enforceSecurity(boolean enforce) {

if (sm != null && sm != lastSecurityManagerInstalled) {
            // Throw a Security exception: we do not want to override
            // an 'alien' SecurityManager with either null or 
            // a new SecurityManager.
            throw new SecurityException

Please let us know , how to resolve the issue without commenting above code in ApplicationSecurityEnforcer.java,
when security Manager is already installed.

find the link somebody got the same kind of exception, but we don't have any solution in below


This message was sent by Atlassian JIRA

To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org

View raw message