[groovy-user] 1.5 Causes StackOverflowError with Ant Java Task

9 views
Skip to first unread message

Murray, Mike

unread,
Dec 9, 2007, 1:40:16 AM12/9/07
to us...@groovy.codehaus.org
I replaced groovy-all-1.0.jar with groovy-all-1.5.jar, and my Ant build now produces StackOverflowError all over the place.  It appears to happen for any java task that executes after a groovy script has executed.  The groovy script seems to run without problem.
 
Anyone have an idea about this?
 
Thanks, Mike
 
register:
     [java] Exception in thread "Thread-5" java.lang.StackOverflowError
     [java]  at java.util.HashMap.hash(HashMap.java:288)
     [java]  at java.util.HashMap.hash(HashMap.java:292)
     [java]  at java.util.WeakHashMap.get(WeakHashMap.java:340)
     [java]  at java.util.Collections$SynchronizedMap.get(Collections.java:1979)
     [java]  at org.apache.tools.ant.Project.getThreadTask(Project.java:2300)
     [java]  at org.apache.tools.ant.Project.demuxInput(Project.java:1244)
     [java]  at org.apache.tools.ant.taskdefs.Ant.handleInput(Ant.java:251)
     [java]  at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
     [java]  at org.apache.tools.ant.Project.demuxInput(Project.java:1248)
     [java]  at org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:70)
     [java]  at java.io.FilterInputStream.read(FilterInputStream.java:111)
     [java]  at org.apache.tools.ant.taskdefs.Redirector.handleInput(Redirector.java:666)
     [java]  at org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:667)
     [java]  at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
     [java]  at org.apache.tools.ant.Project.demuxInput(Project.java:1248)
     [java]  at org.apache.tools.ant.taskdefs.Ant.handleInput(Ant.java:251)
     [java]  at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
     [java]  at org.apache.tools.ant.Project.demuxInput(Project.java:1248)
     [java]  at org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:70)
     [java]  at java.io.FilterInputStream.read(FilterInputStream.java:111)
     [java]  at org.apache.tools.ant.taskdefs.Redirector.handleInput(Redirector.java:666)
     [java]  at org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:667)
     [java]  at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
     [java]  at org.apache.tools.ant.Project.demuxInput(Project.java:1248)
     [java]  at org.apache.tools.ant.taskdefs.Ant.handleInput(Ant.java:251)

Andres Almiray

unread,
Dec 9, 2007, 2:07:44 AM12/9/07
to us...@groovy.codehaus.org

Can you show us the xml please ?

--
View this message in context: http://www.nabble.com/1.5-Causes-StackOverflowError-with-Ant-Java-Task-tp14236221p14236320.html
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Guillaume Laforge

unread,
Dec 9, 2007, 4:33:33 AM12/9/07
to us...@groovy.codehaus.org
I suspect it's caused by my fix to the Grails issue with the input task.
We'll need some more information to debug this one.
Show us some code, please :-)
And file a JIRA issue, please.

--
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

Guillaume Laforge

unread,
Dec 9, 2007, 11:49:05 AM12/9/07
to us...@groovy.codehaus.org
A simple way of reproducing this problem would be welcome, so that we
can very quickly fix this problem.
Thanks in advance.

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Marc Guillemot

unread,
Dec 10, 2007, 6:58:30 AM12/10/07
to us...@groovy.codehaus.org
It would be particularly interesting to know which version of Ant is
used: 1.6.5 or 1.7.
Indeed the fix made by Guillaume was required for Ant 1.7 for code that
was working properly with Ant 1.6.5. I can imagine that the fix needed
for 1.7 has some side effects with 1.6.5

Cheers,
Marc.
-- Blog: http://mguillem.wordpress.com

Harnack Frank

unread,
Dec 10, 2007, 7:20:23 AM12/10/07
to us...@groovy.codehaus.org
Hello,

I have reported the bug. A little example is attached to the report.

http://jira.codehaus.org/browse/GROOVY-2370

Regards

Frank Harnack

-----Ursprüngliche Nachricht-----
Von: Marc Guillemot [mailto:mguil...@yahoo.fr]
Gesendet: Montag, 10. Dezember 2007 12:59
An: us...@groovy.codehaus.org
Betreff: Re: [groovy-user] 1.5 Causes StackOverflowError with Ant Java Task

>> k-tp14236221p14236320.html Sent from the groovy - user mailing list

>> archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

***********************************************************************

Die Information in dieser email ist vertraulich und ist ausschließlich
für den/die benannten Adressaten bestimmt. Ein Zugriff auf diese
email durch andere Personen als den/die benannten Adressaten ist
nicht gestattet. Sollten Sie nicht der benannte Adressat sein, löschen
Sie bitte diese email.

***********************************************************************

ARGE Informationssysteme
in der gesetzlichen Krankenversicherung GmbH
Paul-Klinger-Straße 15, 45127 Essen

Amtsgericht Essen HRB 11122
Vorsitzender des Aufsichtsrates: Wolfgang Schmeinck
Geschäftsführer: Frank Krause, Andreas Prenneis

Andres Almiray

unread,
Dec 10, 2007, 1:12:07 PM12/10/07
to us...@groovy.codehaus.org

Looking at the raised issue seems like it is broken with Ant 1.6.4 and 1.7
(??)

--
View this message in context: http://www.nabble.com/1.5-Causes-StackOverflowError-with-Ant-Java-Task-tp14236221p14258170.html

Guillaume Laforge

unread,
Dec 10, 2007, 1:39:47 PM12/10/07
to us...@groovy.codehaus.org
I've committed a potential fix.
Could you please check if the snapshot works?

Click on build artifacts and then on build deliverables:
http://build.canoo.com/groovy/

>>>      [java]  at java.util.HashMap.hash (HashMap.java:288)

>>>      [java]  at java.util.HashMap.hash(HashMap.java:292)
>>>      [java]  at java.util.WeakHashMap.get(WeakHashMap.java:340)
>>>      [java]  at
>>> java.util.Collections$SynchronizedMap.get (Collections.java:1979)

>>>      [java]  at
>>> org.apache.tools.ant.Project.getThreadTask(Project.java:2300)
>>>      [java]  at
>>> org.apache.tools.ant.Project.demuxInput (Project.java:1244)

>>>      [java]  at
>>> org.apache.tools.ant.taskdefs.Ant.handleInput(Ant.java:251)
>>>      [java]  at
>>> org.apache.tools.ant.UnknownElement.handleInput (UnknownElement.java:229)

>>>      [java]  at
>>> org.apache.tools.ant.Project.demuxInput(Project.java:1248)
>>>      [java]  at
>>> org.apache.tools.ant.DemuxInputStream.read (DemuxInputStream.java:70)

>>>      [java]  at
>>> java.io.FilterInputStream.read(FilterInputStream.java:111)
>>>      [java]  at
>>> org.apache.tools.ant.taskdefs.Redirector.handleInput (Redirector.java
>>> :666
>>> )
>>>      [java]  at
>>> org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:667)
>>>      [java]  at
>>> org.apache.tools.ant.UnknownElement.handleInput (UnknownElement.java:229)

>>>      [java]  at
>>> org.apache.tools.ant.Project.demuxInput(Project.java:1248)
>>>      [java]  at
>>> org.apache.tools.ant.taskdefs.Ant.handleInput (Ant.java:251)

>>>      [java]  at
>>> org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
>>>      [java]  at
>>> org.apache.tools.ant.Project.demuxInput (Project.java:1248)

>>>      [java]  at
>>> org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:70)
>>>      [java]  at
>>> java.io.FilterInputStream.read(FilterInputStream.java :111)
>>>      [java]  at
>>> org.apache.tools.ant.taskdefs.Redirector.handleInput(Redirector.java
>>> :666
>>> )
>>>      [java]  at
>>> org.apache.tools.ant.taskdefs.Java.handleInput (Java.java:667)

>>>      [java]  at
>>> org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
>>>      [java]  at
>>> org.apache.tools.ant.Project.demuxInput (Project.java:1248)

Murray, Mike

unread,
Dec 10, 2007, 3:00:35 PM12/10/07
to us...@groovy.codehaus.org
My test build seems to be working with http://build.canoo.com/groovy/artifacts/20071210185449/dist/groovy-all-1.6-beta-1-SNAPSHOT.jar.  I'll reply again if it does not successfully run to completion, but the java tasks are working again.
 
Thanks, Mike


From: Guillaume Laforge [mailto:glaf...@gmail.com]
Sent: Monday, December 10, 2007 12:40 PM
To: us...@groovy.codehaus.org
Subject: Re: [groovy-user] 1.5 Causes StackOverflowError with Ant Java Task

Guillaume Laforge

unread,
Dec 10, 2007, 3:02:58 PM12/10/07
to us...@groovy.codehaus.org
Great!

Harnack Frank

unread,
Dec 11, 2007, 5:26:02 AM12/11/07
to us...@groovy.codehaus.org
Hello Guillaume,
 
the snapshot groovy-all-1.6-beta-1-SNAPSHOT.jar works in our environment ( java version "1.4.2_10", ant 1.6.4, windows xp). The little example works and our very complex build scripts work too.
 
Great!
 
Thanks for your immediate help.
 
Regards
 
Frank
 

Von: Guillaume Laforge [mailto:glaf...@gmail.com]
Gesendet: Montag, 10. Dezember 2007 19:40

Guillaume Laforge

unread,
Dec 11, 2007, 5:32:26 AM12/11/07
to us...@groovy.codehaus.org
Wonderful!
We'll certainly roll out a 1.5.1 fix release soon.
Sorry for the inconvenience.

Al Rodgers

unread,
Jan 7, 2008, 4:35:43 AM1/7/08
to us...@groovy.codehaus.org

Hi Guillaume,

Unfortunately I've just encountered a similar issue and upgrading to Groovy
1.5.1 or 1.6-beta-1-SNAPSHOT doesn't fix it. I'm running Ant 1.7.0 on Sun
JDK 1.5.0_09-b01 on Win XP. I've tried a clean Ant install with just the
groovy JAR added (I tried both the groovy and groovy-all JARs), but the
following test script fails.

<project name="test" default="test" basedir=".">
<target name="test">
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>

<!-- This works -->
<input message="Test input" addproperty="tempPropertyName"/>
<echo>The message was ${tempPropertyName}</echo>

<groovy>
ant.echo("Local script 1")
<!-- This line fails -->
ant.input(message:"Local script input: ",
addproperty:"localScriptProperty")
<!-- This is never seen -->
ant.echo("Local script 2")
</groovy>
</target>
</project>

The script output is:

Buildfile: build.xml

test:
[input] Test input
test
[echo] The message was test
[echo] Local script 1
[input] Local script input:

BUILD FAILED
: java.lang.StackOverflowError


glaforge wrote:
>
> Wonderful!
> We'll certainly roll out a 1.5.1 fix release soon.
> Sorry for the inconvenience.
>
>
> On Dec 11, 2007 11:26 AM, Harnack Frank <Har...@iskv.de> wrote:
>
>> Hello Guillaume,
>>
>> the snapshot groovy-all-1.6-beta-1-SNAPSHOT.jar works in our environment
>> (
>> java version "1.4.2_10", ant 1.6.4, windows xp). The little example works
>> and our very complex build scripts work too.
>>
>> Great!
>>
>> Thanks for your immediate help.
>>
>> Regards
>>
>> Frank
>
>

--
View this message in context: http://www.nabble.com/1.5-Causes-StackOverflowError-with-Ant-Java-Task-tp14236221p14660964.html

Guillaume Laforge

unread,
Jan 7, 2008, 4:42:18 AM1/7/08
to us...@groovy.codehaus.org
Could you please create a JIRA issue?

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Al Rodgers

unread,
Jan 7, 2008, 5:06:18 AM1/7/08
to us...@groovy.codehaus.org

[Please ignore the earlier version of this message - I accidentally sent
before I was finished. Sorry!]

Hi Guillaume,

The script output is:

Buildfile: build.xml

BUILD FAILED
: java.lang.StackOverflowError


Incidentally, if I replace the ant.input() call with standard Java IO code,
it works:

BufferedReader reader = new BufferedReader( new InputStreamReader( System.in
) )
def a = reader.readLine()

I'm using this as a workaround for the time being.

Thanks,
Al.

Adam Chesney

unread,
Jan 7, 2008, 5:03:22 AM1/7/08
to us...@groovy.codehaus.org

Al Rodgers wrote:
> [Please ignore the earlier version of this message - I accidentally sent
> before I was finished. Sorry!]
>

> Incidentally, if I replace the ant.input() call with standard Java IO code,
> it works:
>
> BufferedReader reader = new BufferedReader( new InputStreamReader( System.in
> ) )
> def a = reader.readLine()
>
> I'm using this as a workaround for the time being.
>
> Thanks,
> Al.
>
>

> glaforge wrote:
>
>> Wonderful!
>> We'll certainly roll out a 1.5.1 fix release soon.
>> Sorry for the inconvenience.
>>
>>
>> On Dec 11, 2007 11:26 AM, Harnack Frank <Har...@iskv.de> wrote:
>>
>>
>>> Hello Guillaume,
>>>
>>> the snapshot groovy-all-1.6-beta-1-SNAPSHOT.jar works in our environment
>>> (
>>> java version "1.4.2_10", ant 1.6.4, windows xp). The little example works
>>> and our very complex build scripts work too.
>>>
>>> Great!
>>>
>>> Thanks for your immediate help.
>>>
>>> Regards
>>>
>>> Frank
>>>
>>
>
>

---------------------------------------------------------------------

Guillaume Laforge

unread,
Jan 7, 2008, 5:16:21 AM1/7/08
to us...@groovy.codehaus.org
Yup, but there's clearly a problem with the Ant input stream
infrastructure we have to work around.


On Jan 7, 2008 11:06 AM, Al Rodgers <rodge...@googlemail.com> wrote:
>
> [Please ignore the earlier version of this message - I accidentally sent
> before I was finished. Sorry!]
>
>

> Incidentally, if I replace the ant.input() call with standard Java IO code,
> it works:
>
> BufferedReader reader = new BufferedReader( new InputStreamReader( System.in
> ) )
> def a = reader.readLine()
>
> I'm using this as a workaround for the time being.
>
> Thanks,
> Al.
>
>
>

> glaforge wrote:
> >
> > Wonderful!
> > We'll certainly roll out a 1.5.1 fix release soon.
> > Sorry for the inconvenience.
> >
> >
> > On Dec 11, 2007 11:26 AM, Harnack Frank <Har...@iskv.de> wrote:
> >
> >> Hello Guillaume,
> >>
> >> the snapshot groovy-all-1.6-beta-1-SNAPSHOT.jar works in our environment
> >> (
> >> java version "1.4.2_10", ant 1.6.4, windows xp). The little example works
> >> and our very complex build scripts work too.
> >>
> >> Great!
> >>
> >> Thanks for your immediate help.
> >>
> >> Regards
> >>
> >> Frank
> >
> >
>
> --
> View this message in context: http://www.nabble.com/1.5-Causes-StackOverflowError-with-Ant-Java-Task-tp14236221p14660964.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages