Bug 603135 - Groovy fails to start
Groovy fails to start
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: groovy (Show other bugs)
13
All Linux
low Severity high
: ---
: ---
Assigned To: Lubomir Rintel
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-11 12:01 EDT by Dan O'Brien
Modified: 2010-06-17 12:15 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-17 12:15:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan O'Brien 2010-06-11 12:01:50 EDT
Description of problem:

Groovy command fails to start with error:

java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at org.codehaus.groovy.tools.LoaderConfiguration.loadFilteredPath(LoaderConfiguration.java:219)
   at org.codehaus.groovy.tools.LoaderConfiguration.configure(LoaderConfiguration.java:111)
   at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:88)
   at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)


Version-Release number of selected component (if applicable):

groovy-1.7.0-1.fc13.1.noarch

and with java:

rpm -qa | grep java

java-1.5.0-gcj-1.5.0.0-32.fc13.x86_64
subversion-javahl-1.6.9-2.fc13.x86_64
java-1.6.0-openjdk-plugin-1.6.0.0-39.b18.fc13.x86_64
lpg-java-compat-1.1.0-4.fc12.noarch
java-1.5.0-gcj-devel-1.5.0.0-32.fc13.x86_64
tzdata-java-2010j-1.fc13.noarch
java-1.5.0-gcj-javadoc-1.5.0.0-32.fc13.x86_64
java-1.6.0-openjdk-1.6.0.0-39.b18.fc13.x86_64
gcc-java-4.4.4-2.fc13.x86_64
ant-javamail-1.7.1-13.fc13.x86_64
libreadline-java-0.8.0-26.fc13.x86_64
antlr3-java-3.2-5.fc13.noarch
mysql-connector-java-5.1.12-1.fc13.x86_64
eclipse-mylyn-java-3.3.2-2.fc13.noarch
java_cup-0.11a-4.fc13.noarch
javamail-1.4.3-2.fc13.x86_64


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Dan O'Brien 2010-06-11 20:56:43 EDT
Some more data points.  Bash, /bin/sh fails while Ksh works, but emits an error:

/home/dmobrien: cat helloworld.groovy
println "hello"


/home/dmobrien: bash /usr/bin/groovy helloworld.groovy
java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at org.codehaus.groovy.tools.LoaderConfiguration.loadFilteredPath(LoaderConfiguration.java:219)
   at org.codehaus.groovy.tools.LoaderConfiguration.configure(LoaderConfiguration.java:111)
   at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:88)
   at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)

/home/dmobrien: sh /usr/bin/groovy helloworld.groovy
java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at org.codehaus.groovy.tools.LoaderConfiguration.loadFilteredPath(LoaderConfiguration.java:219)
   at org.codehaus.groovy.tools.LoaderConfiguration.configure(LoaderConfiguration.java:111)
   at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:88)
   at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)

/home/dmobrien: ksh /usr/bin/groovy helloworld.groovy 
/usr/bin/groovy[29]: local: not found [No such file or directory]
hello
Comment 2 Dan O'Brien 2010-06-11 21:07:45 EDT
More data:

Bash/sh evaluates to this exec line:

exec /usr/lib/jvm/java/bin/java -classpath /usr/share/java/ant.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/antlr.jar:/usr/share/java/objectweb-asm/asm.jar:/usr/share/java/objectweb-asm/asm-analysis.jar:/usr/share/java/objectweb-asm/asm-tree.jar:/usr/share/java/objectweb-asm/asm-util.jar:/usr/share/java/bsf.jar:/usr/share/java/commons-cli.jar:/usr/share/java/commons-logging.jar:/usr/share/java/groovy.jar:/usr/share/java/ivy.jar:/usr/share/java/jline.jar:/usr/share/java/jsp_2_0_api.jar:/usr/share/java/junit.jar:/usr/share/java/servlet_2_4_api.jar:/usr/share/java/xstream.jar: -Dscript.name=/usr/bin/groovy -Dprogram.name=groovy -Dgroovy.starter.conf=/etc/groovy-starter.conf -Dgroovy.home= -Dtools.jar=/usr/lib/java-1.5.0/../jvm/java/lib/tools.jar org.codehaus.groovy.tools.GroovyStarter --conf /etc/groovy-starter.conf --main groovy.ui.GroovyMain helloworld.groovy


But ksh evaluates to this exec line:

exec /usr/lib/jvm/jre/bin/java -classpath /usr/share/java/ant.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/antlr.jar:/usr/share/java/objectweb-asm/asm.jar:/usr/share/java/objectweb-asm/asm-analysis.jar:/usr/share/java/objectweb-asm/asm-tree.jar:/usr/share/java/objectweb-asm/asm-util.jar:/usr/share/java/bsf.jar:/usr/share/java/commons-cli.jar:/usr/share/java/commons-logging.jar:/usr/share/java/groovy.jar:/usr/share/java/ivy.jar:/usr/share/java/jline.jar:/usr/share/java/jsp_2_0_api.jar:/usr/share/java/junit.jar:/usr/share/java/servlet_2_4_api.jar:/usr/share/java/xstream.jar: -Dscript.name=/usr/bin/groovy -Dprogram.name=groovy -Dgroovy.starter.conf=/etc/groovy-starter.conf -Dgroovy.home= -Dtools.jar=/usr/lib/java-1.5.0/../jvm/java/lib/tools.jar org.codehaus.groovy.tools.GroovyStarter --conf /etc/groovy-starter.conf --main groovy.ui.GroovyMain helloworld.groovy

the difference is which java is invoked:

Bash: /usr/lib/jvm/java/bin/java
Ksh:  /usr/lib/jvm/jre/bin/java
Comment 3 Dan O'Brien 2010-06-11 21:10:48 EDT
And if I explicitly set JAVA_HOME to point to the openjdk on my machine (it was not set previously):

/home/dmobrien: whence java
/usr/bin/java
/home/dmobrien: ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jun 11 03:49 /usr/bin/java -> /etc/alternatives/java
/home/dmobrien: ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 46 Jun 11 03:49 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
/home/dmobrien: export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
/home/dmobrien: groovy helloworld.groovy
hello


It works.  So, the /usr/bin/groovy script is not finding the "default" java without JAVA_HOME set.

You may lower the severity since I have a work around. Thanks.
Comment 4 Dan O'Brien 2010-06-11 21:31:20 EDT
Ok, last point.  I installed the openjdk jdk and now everything works WITHOUT setting JAVA_HOME

/home/dmobrien: unset JAVA_HOME
/home/dmobrien: groovy helloworld.groovy
hello


/home/dmobrien: rpm -qa | grep java
java-1.5.0-gcj-1.5.0.0-32.fc13.x86_64
subversion-javahl-1.6.9-2.fc13.x86_64
java-1.6.0-openjdk-plugin-1.6.0.0-39.b18.fc13.x86_64
lpg-java-compat-1.1.0-4.fc12.noarch
java-1.5.0-gcj-devel-1.5.0.0-32.fc13.x86_64
javahelp2-2.0.05-8.fc12.noarch
tzdata-java-2010j-1.fc13.noarch
java-1.5.0-gcj-javadoc-1.5.0.0-32.fc13.x86_64
java-1.6.0-openjdk-1.6.0.0-39.b18.fc13.x86_64
gcc-java-4.4.4-2.fc13.x86_64
ant-javamail-1.7.1-13.fc13.x86_64
libreadline-java-0.8.0-26.fc13.x86_64
antlr3-java-3.2-5.fc13.noarch
mysql-connector-java-5.1.12-1.fc13.x86_64
eclipse-mylyn-java-3.3.2-2.fc13.noarch
java-1.6.0-openjdk-devel-1.6.0.0-39.b18.fc13.x86_64
java_cup-0.11a-4.fc13.noarch
javamail-1.4.3-2.fc13.x86_64

I guess this can be closed as "configuration issue"
Comment 5 Lubomir Rintel 2010-06-17 12:15:13 EDT
Yup. Thank you for the report anyway.

Note You need to log in before you can comment on or make changes to this bug.