无法理解以下错误:“(Ljava / lang / Integer;)V”不适用于此对象(Unable to understand the following error: “(Ljava/lang/

系统教程 行业动态 更新时间:2024-06-14 16:55:58
无法理解以下错误:“(Ljava / lang / Integer;)V”不适用于此对象(Unable to understand the following error: “(Ljava/lang/Integer;)V” is not applicable on this object)

当我从DB2获得结果并尝试设置为noOfLocations属性时,出现以下错误。

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

以下代码显示了该问题。

我正在使用rs来设置值。

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

rs.getInt("NO_LOC_PKG") is returning 0

NO_LOC_PKG is of datatype Integer in the DB

并且使用setter方法的noOfLocations类型是,

private Integer noOfLocations; public void setNoOfLocations(Integer noOfLocations) { this.noOfLocations = noOfLocations; }

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; }

最满意答案

您发布的错误消息表明它是与构建相关的问题,因为编译器和运行时错误通常不会通过其签名来描述方法。

确保您的构建是最新的,并且调试器可用的源与您正在运行的二进制文件的源相匹配。

根据您的构建系统,问题可能由以前的部分构建,文件的意外时间戳,复制/移动文件,崩溃的IDE,奇怪的构建系统等引起。

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.

更多推荐

本文发布于:2023-04-10 11:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/1c5cb11bd72f5efc612cf498c3e30c97.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:于此   不适用   对象   错误   lang

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!