groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Johnson <john...@cs.uiuc.edu>
Subject Re: wrong error message?
Date Fri, 06 Nov 2015 14:31:28 GMT
Thanks for the advice on reading error messages.

I am using the trunk of Poi, so it is the latest.   I rechecked the
classpath and that wasn't the problem.   The problem turned out to be that
the methods were annotated with @Beta, and that must have confused Groovy
in some way.  Perhaps the annotation changes the method name so that
Groovy's method lookup can't find it.   In any case, since I had source, I
got rid of the annotation and then my program could find the method.

The Beta annotation was developed by Google, but it appears that other
projects are using it, so it would be unfortunate if Groovy had trouble
with Java code that used the Beta annotation.

-Ralph Johnson

On Fri, Nov 6, 2015 at 7:01 AM, Winnebeck, Jason <
Jason.Winnebeck@windstream.com> wrote:

> It’s in there. For the primitive types, there’s no semi-colon at the end.
> For example void f(int, int, int) has signature f(III)V. With the L
> (object) type, it’s L<class>; with semi-colon at end. You can see L*;IL*;
> in there. That I before the second L is the int argument you are looking
> for.
>
>
>
> As for why you get no such method error, I don’t know. I use POI in my
> project and the version of POI that I have does not have this method at
> all. On the website
> https://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFSheet.html#copyRows%28java.util.List,%20int,%20org.apache.poi.ss.usermodel.CellCopyPolicy%29,
> it does has a signature you are trying to call.
>
>
>
> If you think your POI is new enough to have that method, a common issue
> I’ve seen in cases like this is that accidentially multiple versions of a
> library (POI in this case) are on the classpath at the same time and you’re
> really loading an older version than you think.
>
>
>
> Jason
>
>
>
> *From:* rjohnson.uiuc@gmail.com [mailto:rjohnson.uiuc@gmail.com] *On
> Behalf Of *Ralph Johnson
> *Sent:* Friday, November 06, 2015 5:29 AM
> *To:* users@groovy.incubator.apache.org
> *Subject:* wrong error message?
>
>
>
> I'm calling a Java library (Poi) from Groovy.  I get a "no such method"
> error that says to me that I am passing two arguments, but I am really
> passing three.   My code is
>
>
>
> int i -> sheet.copyRows([sourceRow], i, new CellCopyPolicy())
>
> and the error message is
>
>
>
> java.lang.NoSuchMethodError:
> org.apache.poi.xssf.usermodel.XSSFSheet.copyRows(Ljava/util/List;ILorg/apache/poi/ss/usermodel/CellCopyPolicy;)V
>
>
>
> The way I read it, I am giving copyRows two arguments, a List and a
> CellCopyPolicy.   It didn't seem to see the integer that was the second
> argument.
>
>
>
> Can anyone see what I am doing wrong?   I can give more context, but it is
> just as likely to confuse as to illuminate.
>
>
>
> -Ralph Johnson
> ------------------------------
> This email message and any attachments are for the sole use of the
> intended recipient(s). Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply email and destroy all copies of the original
> message and any attachments.
>

Mime
View raw message