Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-902

Batik can't be executed from a network path (win32 environment)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 1.7
    • None
    • SVG Rasterizer
    • None
    • Operating System: Windows XP
      Platform: PC

    Description

      If batik binaries are stored of a windows network share (or samba..), and the '-jar' parameter gave to java.exe is a UNC format, and not a mapped drive, batik crashes.

      What I tried is to create a network share on my own local hard drive, and tried the following, from jre bin directory :

      java.exe -jar \\lwpbk\batik-1.7\batik-rasterizer.jar

      When I do this, I get the message you can see below.
      I have all the R/W rights on the share, which is on my local machine.

      -If now I replace the UNC path by a local path (c:\... \batik\batik-rasterizer.jar), it works fine.
      -If I map the network share, and use the drive letter in the parameter it works also fine.
      If I give as parameter a UNC path to specify source svg (but letter drive for jar file), no problem, it handles properly.
      I tried to compile the last "nightly build" (batik-src-09-03-19.zip), but doesn't change anything.

      C:\Program Files\Java\jre6\bin>java.exe -jar \\lwpbk\batik-1.7\batik-rasterizer.
      jar
      Exception in thread "main" java.security.AccessControlException: access denied (
      java.util.PropertyPermission java.security.policy write)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.System.setProperty(Unknown Source)
      at org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityMana
      ger(ApplicationSecurityEnforcer.java:257)
      at org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(App
      licationSecurityEnforcer.java:173)
      at org.apache.batik.apps.rasterizer.Main.execute(Main.java:922)
      at org.apache.batik.apps.rasterizer.Main.main(Main.java:992)

      On version 1.7, I modified
      \batik-1.7\sources\org\apache\batik\apps\rasterizer\SVGConverter.java
      line 257, and set the variable securityOff to true.
      It seems to fix my problem.
      /** Controls whether scripts should be run securely or not */
      protected boolean securityOff = true;

      Of course it does the trick for me, but not satisfactory for your project. I don't have enough skills with Java to help you on this.

      Attachments

        Activity

          People

            batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
            pieuvrebdx-batik@yahoo.fr Pierre
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: