AbstractMethodError:
AbstractMethodError:
This java.lang.AbstractMethodError is usually thrown when we try to invoke the abstract method.
we know that an abstract method cannot be invoked and if we try to do so then you will get a compile-time error.So you may think how this error is thrown at run-time?.
The reason is binary incompatibility-what does it mean?
Whenever a class is modified,other classes that refer to this (modified) class will not be aware of the changes made in it.So all the classes must be compiled as a whole.If not then you may encounter one of the subclasses of incompatible class change error.
"This error indicates that the method that you invoke is converted into an abstract method now".
see the following example to have an idea about this error
class B
{
public void display()
{
System.out.println("I am inside B");
}
}
import java.util.*;
public class A extends B
{
public static void main(String args[])
{
A a=new A();
a.display();
}
}
output:
C:\blog>javac A.java
C:\blog>java A
I am inside B
Now i am going to convert the display() method as an abstract method and compile it alone.
abstract class B
{
public abstract void display();
}
Output:
C:\blog>javac A.java
C:\blog>java A
I am inside B
C:\blog>javac B.java
C:\blog>java A
Exception in thread "main" java.lang.AbstractMethodError: B.display()V
at A.display(A.java:3)
at A.main(A.java:8)
AbstractMethodError:的更多相关文章
- 疑惑的 java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L
在MAVEN项目里面,在整合spring和mybatis在执行数据库操作的时候报出了: java.lang.AbstractMethodError: org.mybatis.spring.transa ...
- 使用DBCP时发生AbstractMethodError异常
使用DBCP时发生AbstractMethodError异常,错误描述: Exception in thread "main" java.lang.AbstractMethodEr ...
- 疑难杂症:java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion(Ljava/lang/String;)V
错误: java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion(Ljava/lang/Strin ...
- HIbernate java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z
[HIbernate]java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGe ...
- AbstractMethodError using UriBuilder on JAX-RS
问题描述:Eclipse调试JAX-RS服务没问题,但是在发布服务端时候抛出异常 java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder. ...
- java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer; at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.jav
在整合spring和mybatis在执行数据库操作的时候报出了: java.lang.AbstractMethodError: org.mybatis.spring.transaction.Sprin ...
- Spark踩坑——java.lang.AbstractMethodError
今天新开发的Structured streaming部署到集群时,总是报这个错: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: ...
- QA:Initialization of bean failed; nested exception is java.lang.AbstractMethodError
Q: <hibernate.version>5.2.10.Final</hibernate.version><dependency> <groupId> ...
- java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L
mybatis与springboot集成的时候,报错:java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManag ...
随机推荐
- JDBC API 可滚动可编辑的结果集
JDBC的API中的链接数据和创建statement并且执行读取ResultSet大家已经很熟悉了,这边介绍设置statement的属性使结果集可以移动并且进行编辑同步回数据库. Statement ...
- mobile_轮播图_style_left 版本
mobile 轮播图 小圆点逻辑(排他) 1. 统一给所有 span 元素加 class=""; 2. 切换到谁,谁的 class="active"; 移动端轮 ...
- uri&url
统一资源标志符URI就是在某一规则下能把一个资源独一无二地标识出来. 拿人做例子,假设这个世界上所有人的名字都不能重复,那么名字就是URI的一个实例,通过名字这个字符串就可以标识出唯一的一个人.现实当 ...
- Java程序生成一个Access文件
package access; import java.io.File;import java.io.IOException;import java.sql.SQLException;import j ...
- Hibernate-day02
OID 1,对象里面没有主键的概念,对象中对应主键的属性,称为OID(对象标识符);2,OID用来唯一标明一个对象实体(加上对象类型)3,OID在对象里面不见得只有一个属性;(映射复合主键)4,OID ...
- 解决 ASP.NET Core 自定义错误页面对 Middleware 异常无效的问题
我们基于 Razor Class Library 实现了自定义错误页面的公用类库(详见之前的随笔),但是在实际使用时发现如果在 middleware 中发生了异常,则不能显示自定义错误页面,而是返回默 ...
- 关于vue页面多了之后,webpack热更新速度慢的解决办法
vue项目大了之后,每次热更新都要10多秒的时间, 网上找了一大堆发现一个有用的办法 "env": { "development":{ "plugin ...
- 平安银行在开源技术选型上的思考和实践 RocketMQ
小结: 1. https://mp.weixin.qq.com/s/z_c5D8fvHaYvHSczm0nYFA 平安银行在开源技术选型上的思考和实践 平安银行·吴建峰 阿里巴巴中间件 3月7日 随着 ...
- VS2017 SVN插件-AnkhSVN
AnkhSVN 该插件可以直接在vs017扩展和工具里安装,安装完成即可使用 默认VS自带的源码管理工具是GIT 如果已经使用需要手动切换到SVN:工具==>选项菜单中设置 SVN使用方法: 1 ...
- python panda::dataframe常用操作
1.条件查询: result = df.query("((a==1 and b=="x") or c/d < 3))" print result 2.遍历 ...