You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/05/22 16:04:00 UTC

[jira] [Updated] (GROOVY-3527) groovyc ant task generates invalid class name with IBM jdk and some build.xml paths

     [ https://issues.apache.org/jira/browse/GROOVY-3527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-3527:
--------------------------------
    Labels: ClassFormatError  (was: )

> groovyc ant task generates invalid class name with IBM jdk and some build.xml paths
> -----------------------------------------------------------------------------------
>
>                 Key: GROOVY-3527
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3527
>             Project: Groovy
>          Issue Type: Bug
>          Components: Ant integration
>    Affects Versions: 1.6.3
>         Environment: Intel/PPC Linux, IBM JDK any recent version, groovy >= 1.6.0, ant >= 1.7.0
>            Reporter: Jay Berkenbilt
>            Assignee: Paul King
>            Priority: Major
>              Labels: ClassFormatError
>             Fix For: 1.6.4, 1.7-beta-1
>
>
> The way the groovyc ant task generates a class name for embedded Groovy from the path of the build.xml file causes errors to be reported when running with IBM's JDK when the path name follows a certain pattern.  Here's a specific recipe for reproducing the problem.
> Environment:
> {noformat}
> JAVA_HOME=.../ibm-java-i386-60
> ANT_HOME=.../apache-ant-1.7.1
> GROOVY_HOME=.../groovy-1.6.3
> {noformat}
> Put this build.xml in /tmp/a-1.1/build.xml:
> {code:xml}
> <project>
>  <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>
>  <groovy>println 'hello'</groovy>
>  <target name="all"/>
> </project>
> {code}
> Run
> {noformat}
> $ANT_HOME/bin/ant -lib $GROOVY_HOME/embeddable/groovy-all-1.6.3.jar
> {noformat}
> This is the output:
> {noformat}
> Buildfile: build.xml
> BUILD FAILED
> java.lang.ClassFormatError: JVMCFRE068 class name is invalid; class=embedded_script_in__tmp_a_1/1_build, offset=0
> 	at java.lang.ClassLoader.defineClassImpl(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
> 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
> 	at groovy.lang.GroovyClassLoader.access$200(GroovyClassLoader.java:54)
> 	at groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:468)
> 	at groovy.lang.GroovyClassLoader$ClassCollector.onClassNode(GroovyClassLoader.java:485)
> 	at groovy.lang.GroovyClassLoader$ClassCollector.call(GroovyClassLoader.java:489)
> 	at org.codehaus.groovy.control.CompilationUnit$10.call(CompilationUnit.java:727)
> 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:924)
> 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:462)
> 	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:278)
> 	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:590)
> 	at groovy.lang.GroovyShell.parse(GroovyShell.java:602)
> 	at groovy.lang.GroovyShell.parse(GroovyShell.java:582)
> 	at groovy.lang.GroovyShell.parse(GroovyShell.java:629)
> 	at org.codehaus.groovy.ant.Groovy.parseAndRunScript(Groovy.java:413)
> 	at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:404)
> 	at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:279)
> 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> 	at java.lang.reflect.Method.invoke(Method.java:599)
> 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> 	at org.apache.tools.ant.Task.perform(Task.java:348)
> 	at org.apache.tools.ant.Target.execute(Target.java:357)
> 	at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
> 	at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
> 	at org.apache.tools.ant.Main.runBuild(Main.java:743)
> 	at org.apache.tools.ant.Main.startAnt(Main.java:217)
> 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
> 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> Total time: 1 second
> {noformat}
> Observe the class name "embedded_script_in__tmp_a_1/1_build", which contains a / where the . used to be.  IBM's JDK doesn't like this, and I have a feeling it's probably right, though I haven't checked the spec.
> I observed this in an environment that was using groovy 1.6.0, ant 1.7.0, and version 1.5.0 of IBM's JDK, but I reproduced it with the latest version of each package.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)