groovy
  1. groovy
  2. GROOVY-1386

command line tools fail with SecurityException on OSX

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-6
    • Fix Version/s: 1.0-RC-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      mac os x 10.4.7, java 1.5.0_06
    • Number of attachments :
      0

      Description

      running groovy, groovysh or groovyc results in
      java.lang.SecurityException: Prohibited package name: java.lang
      at java.lang.ClassLoader.preDefineClass(ClassLoader.java:479)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:143)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:143)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:121)
      at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:160)

        Activity

        Hide
        Alex Wouda added a comment -

        I get a similar error again on Groovy Version: 1.5.7 JVM: 1.5.0_16 and Win2000.

        I have a script and a WSDL that's causing the problems. How do I attach these?

        Show
        Alex Wouda added a comment - I get a similar error again on Groovy Version: 1.5.7 JVM: 1.5.0_16 and Win2000. I have a script and a WSDL that's causing the problems. How do I attach these?
        Hide
        Travis Wellman added a comment -
        ~$ groovysh
        java.lang.SecurityException: Prohibited package name: java.lang
        	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:476)
        	at java.lang.ClassLoader.defineClass(ClassLoader.java:610)
        	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        	at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152)
        	at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
        	at java.lang.ClassLoader.defineClass1(Native Method)
        	at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        	at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152)
        	at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
        	at java.lang.ClassLoader.defineClass1(Native Method)
        	at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        	at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152)
        	at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:98)
        	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
        ~$ echo "$CLASSPATH"
        /usr/share/java/*:./lib/*:./*
        ~$ export CLASSPATH='./lib/*:./*'
        ~$ groovysh
        Groovy Shell (1.7.2, JVM: 1.6.0_17)
        Type 'help' or '\h' for help.
        -----------------------------------------------------------------------------------------------------------------------------------------------
        groovy:000> 
        
        ~$ java -version
        java version "1.6.0_17"
        Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
        Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
        ~$ lsb_release -d
        Description:	Ubuntu 9.04
        ~$ date
        Wed Apr 21 10:31:34 PDT 2010
        
        Show
        Travis Wellman added a comment - ~$ groovysh java.lang.SecurityException: Prohibited package name: java.lang at java.lang.ClassLoader.preDefineClass(ClassLoader.java:476) at java.lang.ClassLoader.defineClass(ClassLoader.java:610) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:98) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130) ~$ echo "$CLASSPATH" /usr/share/java/*:./lib/*:./* ~$ export CLASSPATH='./lib/*:./*' ~$ groovysh Groovy Shell (1.7.2, JVM: 1.6.0_17) Type 'help' or '\h' for help. ----------------------------------------------------------------------------------------------------------------------------------------------- groovy:000> ~$ java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing) ~$ lsb_release -d Description: Ubuntu 9.04 ~$ date Wed Apr 21 10:31:34 PDT 2010
        Hide
        blackdrag blackdrag added a comment -

        what version of Groovy are you using and is it a fresh installationfrom our zip distribution?

        Show
        blackdrag blackdrag added a comment - what version of Groovy are you using and is it a fresh installationfrom our zip distribution?
        Hide
        Daniel McQuillen added a comment -

        I installed groovy-1.8.0 on mac osx 10.6.7 and get the following error when typing "groovy" in the command shell. When I type in "sudo groovy" it works fine.
        Any thoughts or suggestions? Thanks!

        java.lang.SecurityException: Prohibited package name: java.lang
        at java.lang.ClassLoader.preDefineClass(ClassLoader.java:480)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152)
        at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152)
        at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:98)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)

        Show
        Daniel McQuillen added a comment - I installed groovy-1.8.0 on mac osx 10.6.7 and get the following error when typing "groovy" in the command shell. When I type in "sudo groovy" it works fine. Any thoughts or suggestions? Thanks! java.lang.SecurityException: Prohibited package name: java.lang at java.lang.ClassLoader.preDefineClass(ClassLoader.java:480) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:98) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
        Hide
        blackdrag blackdrag added a comment -

        is it possible for you to find the startGroovy script and the line

        TOOLS_JAR="$JAVA_HOME/lib/tools.jar"

        and replace it by:

        TOOLS_JAR=""

        to see if that fixes the problem?

        Show
        blackdrag blackdrag added a comment - is it possible for you to find the startGroovy script and the line TOOLS_JAR="$JAVA_HOME/lib/tools.jar" and replace it by: TOOLS_JAR="" to see if that fixes the problem?

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Andy Fyfe
          • Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: