美文网首页
Java | 那些年踩过的坑之bug锦集

Java | 那些年踩过的坑之bug锦集

作者: l王小一 | 来源:发表于2018-10-30 14:35 被阅读0次

1.build path entries are missing

类中报名报错
根据提示进入到Properties中时,上面提示
build path entries are missing


1.png

上图为此时显示内容

更改:

  1. 点击右侧 Add Library → 新增server Runtime
  2. 同方法新增JUnit

2.No compiler is provided in this environment.Perhaps you are running on a JRE rather than a JDK?

在run as → maven test时出现以下错误提示


2.png

更改:
window → preference → java → installed JREs
仔细看右侧你选择的, 一定是个jre, 将jre改成jdk
如果没有, 则新增一个jdk 选择所在路径

3.

java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;
    at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
    at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
    at com.sun.proxy.$Proxy22.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
    at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
    at com.sun.proxy.$Proxy23.findAllPerson(Unknown Source)
    at com.yoyo.test.service.impl.PersonImpl.findAllPerson(PersonImpl.java:21)
    at com.yoyo.test.service.Test.getPerson(Test.java:24)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)
    at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)
    at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

运行时报这个错误原因是
spring-mybatis和mybatis的版本不匹配
当前版本 spring 5.0.0.RELEASE
mybatis 3.4.5
(也有童靴此版本匹配没有问题, 更多的版本匹配还有待验证)

更改: spring 4.0.2.RELEASE
mybatis 3.2.6
修改之后就好了

相关文章

  • Java | 那些年踩过的坑之bug锦集

    1.build path entries are missing 类中报名报错根据提示进入到Properties中...

  • Android | 那些年踩过的坑之bug锦集

    1.窗体泄露 报错信息 发生窗体泄露的原因:在当前activity中弹框后, 弹框没有关闭的时候就销毁了activ...

  • 日常bug记录

    想记录日常碰到的bug,坑踩多了,以后应该碰到坑就比较容易处理或者会少踩坑,后面会慢慢记录bug,截图bug以及最...

  • 趣图:软件开发的路上,意想不到的坑

    面试中的这些坑,你踩过几个? 趣图:Bug 多了,总有一个会把你坑了

  • 那些年,英国留学的学长学姐替你踩过的坑

    那些年,你的前辈们踩过的坑,千万记得要避过去啊! 前人栽树,后人乘凉。想必一谈起英国留学时踩过的那些坑,很多人都能...

  • 那些年踩过的坑

    1.iphone手机,input元素readonly仍获取了焦点. 解决办法:直接在dom节点添加内联事件onfo...

  • 那些年踩过的坑

    RecyclerView的IndexOutOfBoundsException异常 大半年没有敲代码了,顺手写个上拉...

  • 那些年踩过的坑

    2016-07-27 使用nginx中转时,如后端服务时间过长,导致前段页面返回http的504 gateway ...

  • 那些年踩过的坑

    每个人都是长跑者,注定是孤独的,我们需要越跑越和谐,越跑越懂得和自己相融和解。 每一个试图与灵魂做朋友的人,都必需...

  • 那些年踩过的坑

    近日,看到了“教育孩子你犯过这52个错误吗?”这篇文章,深有感触,感觉自己曾经犯过其中的19个错误。这19个错误,...

网友评论

      本文标题:Java | 那些年踩过的坑之bug锦集

      本文链接:https://www.haomeiwen.com/subject/iyjgtqtx.html