You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Princess <he...@googlemail.com> on 2009/03/12 11:44:11 UTC

removeRow()

HSSFSheet Sheet = wb.getSheetAt(0);
HSSFRow row = Sheet.getRow(i);
            if (row != null ){
                Sheet.removeRow(row);
            }
this code worked fine with POI.3.0.2-Final

With POI 3.5-beta5 throws the following error

java.lang.NoSuchMethodError:
org.apache.poi.hssf.usermodel.HSSFSheet.removeRow(Lorg/apache/poi/ss/usermodel/Row

Re: removeRow()

Posted by Princess <he...@googlemail.com>.
thanks for the inputs ..it works now..


On Thu, Mar 12, 2009 at 12:33 PM, Christian Gosch <christian.gosch@inovex.de
> wrote:

> Looks like a try & failure for drop-in replacement.
>
> If a newer version of an API is not fully binary backwards compatible in
> terms of package structure, class names and method signatures, and one
> replaces an older API version by this newer API version, one gets
> "ClassDefNotFound" or "NoSuchMethod" type of exceptions.
>
> This may e. g. happen with code compiled for Java 1.3 against the Java
> 1.4 runtime when using StringBuffer.append(StringBuffer): This signature
> is explicitly available in Java 1.4+ and thus a matching method call is
> compiled into the Java 1.3 byte code, but in a Java 1.3 RE this method
> is not available because in Java 1.3 StringBuffer.append(Object) is used
> for that purpose. The result is a NoSuchMethodError at runtime.
>
> Thus recompile your code against the new lib version, and you will
> immediately find deprecations and removed methods and constants.
>
> If the "client" code accessing POI is not editable for you because it is
> a library which you use as a third-party lib only, than chances are that
> you will not be able to update POI in your project without changing or
> updating this "POI client" lib also. :-(
>
> --cg
>
> > -----Original Message-----
> > From: Sander Ruitenbeek [mailto:s.ruitenbeek@qualityonline.nl]
> > Sent: Thursday, March 12, 2009 12:21 PM
> > To: POI Users List
> > Subject: RE: removeRow()
> >
> > Hi,
> >
> > Looks like you have conflicting versions in your classpath. Did you
> > remove the old jars?
> >
> > Met vriendelijke groet / Kind regards,
> >
> > Sander Ruitenbeek
> > Developer
> > Quality On-Line
> >
> > Tel.: +31 (0)53-4809090
> > s.ruitenbeek@qualityonline.nl
> > www.qualityonline.nl
> >
> > Disclaimer: http://www.qualityonline.nl/disclaimer
> >
> > -----Original Message-----
> > From: Princess [mailto:hepzibahr@googlemail.com]
> > Sent: donderdag 12 maart 2009 11:44
> > To: POI user
> > Subject: removeRow()
> >
> > HSSFSheet Sheet = wb.getSheetAt(0);
> > HSSFRow row = Sheet.getRow(i);
> >             if (row != null ){
> >                 Sheet.removeRow(row);
> >             }
> > this code worked fine with POI.3.0.2-Final
> >
> > With POI 3.5-beta5 throws the following error
> >
> > java.lang.NoSuchMethodError:
> >
> org.apache.poi.hssf.usermodel.HSSFSheet.removeRow(Lorg/apache/poi/ss/use
> > rmodel/Row
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
> >
> >
> > !DSPAM:49b8f057326661377030032!
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>


-- 
Hepzibah
**Hope can be ignited by a spark of encouragement *****

RE: removeRow()

Posted by Christian Gosch <ch...@inovex.de>.
Looks like a try & failure for drop-in replacement.

If a newer version of an API is not fully binary backwards compatible in 
terms of package structure, class names and method signatures, and one 
replaces an older API version by this newer API version, one gets 
"ClassDefNotFound" or "NoSuchMethod" type of exceptions. 

This may e. g. happen with code compiled for Java 1.3 against the Java 
1.4 runtime when using StringBuffer.append(StringBuffer): This signature 
is explicitly available in Java 1.4+ and thus a matching method call is 
compiled into the Java 1.3 byte code, but in a Java 1.3 RE this method 
is not available because in Java 1.3 StringBuffer.append(Object) is used 
for that purpose. The result is a NoSuchMethodError at runtime.

Thus recompile your code against the new lib version, and you will 
immediately find deprecations and removed methods and constants.

If the "client" code accessing POI is not editable for you because it is 
a library which you use as a third-party lib only, than chances are that 
you will not be able to update POI in your project without changing or 
updating this "POI client" lib also. :-(

--cg

> -----Original Message-----
> From: Sander Ruitenbeek [mailto:s.ruitenbeek@qualityonline.nl]
> Sent: Thursday, March 12, 2009 12:21 PM
> To: POI Users List
> Subject: RE: removeRow()
> 
> Hi,
> 
> Looks like you have conflicting versions in your classpath. Did you
> remove the old jars?
> 
> Met vriendelijke groet / Kind regards,
> 
> Sander Ruitenbeek
> Developer
> Quality On-Line
> 
> Tel.: +31 (0)53-4809090
> s.ruitenbeek@qualityonline.nl
> www.qualityonline.nl
> 
> Disclaimer: http://www.qualityonline.nl/disclaimer
> 
> -----Original Message-----
> From: Princess [mailto:hepzibahr@googlemail.com]
> Sent: donderdag 12 maart 2009 11:44
> To: POI user
> Subject: removeRow()
> 
> HSSFSheet Sheet = wb.getSheetAt(0);
> HSSFRow row = Sheet.getRow(i);
>             if (row != null ){
>                 Sheet.removeRow(row);
>             }
> this code worked fine with POI.3.0.2-Final
> 
> With POI 3.5-beta5 throws the following error
> 
> java.lang.NoSuchMethodError:
> 
org.apache.poi.hssf.usermodel.HSSFSheet.removeRow(Lorg/apache/poi/ss/use
> rmodel/Row
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> !DSPAM:49b8f057326661377030032!
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: removeRow()

Posted by Sander Ruitenbeek <s....@qualityonline.nl>.
Hi,

Looks like you have conflicting versions in your classpath. Did you
remove the old jars?

Met vriendelijke groet / Kind regards,
 
Sander Ruitenbeek
Developer
Quality On-Line
 
Tel.: +31 (0)53-4809090
s.ruitenbeek@qualityonline.nl
www.qualityonline.nl
 
Disclaimer: http://www.qualityonline.nl/disclaimer

-----Original Message-----
From: Princess [mailto:hepzibahr@googlemail.com] 
Sent: donderdag 12 maart 2009 11:44
To: POI user
Subject: removeRow()

HSSFSheet Sheet = wb.getSheetAt(0);
HSSFRow row = Sheet.getRow(i);
            if (row != null ){
                Sheet.removeRow(row);
            }
this code worked fine with POI.3.0.2-Final

With POI 3.5-beta5 throws the following error

java.lang.NoSuchMethodError:
org.apache.poi.hssf.usermodel.HSSFSheet.removeRow(Lorg/apache/poi/ss/use
rmodel/Row

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org