Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to understand the following error: "(Ljava/lang/Integer;)V" is not applicable on this object

Tags:

java

resultset

When I am getting the result from the DB2 and trying to set to this attribute noOfLocations I am getting the following error.

Method "setNoOfLocations" with signature "(Ljava/lang/Integer;)V" is not applicable on this object

Following code shows the problem.

I am using rs to set the value.

packDO.setNoOfLocations(rs.getInt("NO_LOC_PKG"));

and

rs.getInt("NO_LOC_PKG") is returning 0

and

NO_LOC_PKG is of datatype Integer in the DB

and noOfLocations type with setter method is,

private Integer noOfLocations;

public void setNoOfLocations(Integer noOfLocations) {
        this.noOfLocations = noOfLocations;
    }
like image 559
Amarnath Avatar asked Dec 16 '22 07:12

Amarnath


1 Answers

The error message you posted suggests that it's a build-related issue, as compiler and runtime errors don't generally describe methods by their signatures.

Make sure that your build is up-to-date and that the source available to your debugger matches the source of the binary you are running.

Depending on your build system, issues could result from previous partial builds, unexpected timestamps on files, copying/moving files, a crashed IDE, a quirky build system, etc.

like image 161
Jason C Avatar answered Feb 01 '23 23:02

Jason C