错误汇集

####1.Cause: org.apache.ibatis.binding.BindingException: Parameter 'title' not found. Available parameters are [1, 0, param1, param2]

  • 类别:mybatis
  • 原因:在给mybatis传参数的时候,会把参数包装成一个map,参数名称作为Key。
  • 解决方案:
    • 在xml里面写成condition.name(比如传入的参数是一个叫condition的类)
    • 把所有参数转成一个map("name",condition.name),在xml里面直接使用。(推荐)

####2.Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]

  • 类别:tomcat
  • 原因:配置文件web.xml里面有两个路径一样了
  • 解决方案:改掉一个路径

####3. Every derived table must have its own alias.

  • 类别:mybatis

  • 原因:select count() from (select count() from a) 没有对里面的子sql命名

  • 解决方案:给子sql起个名字:

      select count(*) 
      from (
      select count(*) from a) aa
    

####4.Caused by: java.lang.IllegalStateException: Native library for Attach API not available in this JRE

  • 类别:java testng
  • 原因:跑testng的jre环境是eclipse自带的,应该改成本地jdk
  • 解决方案:参见

An 图片示例

####4.java.lang.OutOfMemoryError: PermGen space

  • 类别:web
  • 原因:内存溢出
  • 解决方案:

双击server-->open launch configuration-->arguments--> -XX:MaxPermSize=256m

参考链接

####5.addAll UnsupportedOperationException

  • 类别:java

  • 原因:有些list不支持addAll方法,比如我追溯代码发现这个list来自:

      return Collections.emptyList();
    
  • 解决方案: 确保你的list是ArrayList:

      return new ArrayList<Long>();
    

####6.eclipse打不开:

  • 类别:java
  • 原因:异常关闭
  • 解决方案:
  1. 进入workspace/.metadata/.plugins/目录
  2. 把org.eclipse.core.resources改名为org.eclipse.core.resources_old
  3. 启动eclipse
  4. 关闭eclipse
  5. 删除org.eclipse.core.resources
  6. 把org.eclipse.core.resources_old改回来

####7. java.lang.NoSuchMethodError: junit.framework.ComparisonFailure.getExpected()Ljava/lang/String;

  • 类别:junit
  • 原因:Assert的时候引了junit.framework的包,应该引org.junit的包
  • 解决方案:引入的包改成org.junit

####8. Using platform encoding (GBK actually) to copy filtered resources

  • 类别:java web

  • 原因:没有指定编码格式,会导致类中的中文识别不了

  • 解决方案:

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties>
    

####9.java.lang.OutOfMemoryError: Java heap space

  • 类别:eclipse
  • 原因:内存不够
  • 解决方案:
  1. 修改Eclipse.ini不起作用,因为它只增加eclipse的内存,不增加jvm的

  2. Run As ”-> “Run Configurations ”,在Arguments 参数中的“VM arguments: ”中填入如下值即可。

-Xms256m -Xmx512m -XX:MaxNewSize=64m -XX:MaxPermSize=128m

####10.jar包乱码

  • 类别:eclipse
  • 原因:问题来源是在eclipse中直接查看springside的class(由eclipse自动反编译)里面注释的乱码问题
  • 解决方案:

Preferences-General-Workspace-Text file encoding 设置为uft-8

最后重启一下eclipse通常就ok了。

####11.java.lang.classnotfoundexception context listener

  • 类别:eclipse
  • 原因:Build Path里(Libraries和Order and Export)面有错误的包
  • 解决方案:删掉错误的包

####12.Missing artifact com.sun:tools:jar 1.5.0

  • 类别:eclipse
  • 原因:在pom.xml中添加struts2-core.jar包后,需要依赖java运行时的tools.jar进行依赖。但是,此时eclipse无法读取tools包
  • 解决方案:自己加入依赖

所以将C:\Program Files\Java\jdk1.6.0_10\lib\目录下的tools.jar拷贝到C:\Documents and Settings\DELL.m2\repository\com\sun\tools\1.5.0\目录下,并将tools.jar改名为tools-1.5.0.jar,并在pom.xml中作如下配置: <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.5.0</version> </dependency>

####13.Result Maps collection already contains value for ...

  • 类别:mybatis

  • 原因:修改工程pom版本号,会在classes路径下留下多个persistence层jar包,导致多次加载

  • 解决方案:pom文件里面加入清理插件:maven-clean-plugin

      <plugin>
      		<artifactId>maven-clean-plugin</artifactId>
      		<version>2.5</version>
      		<configuration>
      			<filesets>
      				<fileset>
      					<directory>${basedir}/WebContent/WEB-INF/</directory>
      					<includes>
      						<include>classes/**/**        </include>
      						<include>lib/*</include>
      					</includes>
      				</fileset>
      			</filesets>
      		</configuration>
      	</plugin>
    

####14. BeanUtils.copyProperties No value specified for 'BigDecimal'

  • 类别:java

  • 原因:copy的时候有null值

  • 解决方案:在BeanUtils.copyProperties上一行,注册个默认值

      ConvertUtils.register(new BigDecimalConverter(null), BigDecimal.class);
    

####15.Error:java: Compilation failed: internal java compiler error

  • 类别:intellij
  • 原因:工程的compiler版本不对
  • 解决方案:解决方法图片

####16.IDEA导入subvision无法更新

  • 类别:intellij
  • 原因:设置问题
  • 解决方案:解决方法图片

转载于:https://my.oschina.net/SearchVera/blog/414504

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值