console控制台错误及处理过程

本文介绍了在Java开发中遇到的编译错误及其解决方法,包括因使用了不支持的语法导致的错误、源码版本不匹配的问题,以及依赖打包缺失和Spring Bean初始化失败等故障。针对这些问题,提出了升级JDK、修改编译器设置、更新pom.xml配置以及检查并打包依赖项目的解决方案。
摘要由CSDN通过智能技术生成
1.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project lietou-bg-investigate-service: Compilation failure (编译失败)
[ERROR] D:\workspace\javaall\lietou-java\lietou-service\lietou-bg-investigate-service\src\main\java\com\lietou\bg\investigate\service\InvestigateService.java:[211,41] 错误: -source 1.6 中不支持 diamond 运算符
[ERROR] -> [Help 1]

原因:代码中包含不支持编译的语法。

解决办法:1)修改jdk为高级版本。
2)修改编译器compiler为高级版本。
3)删除掉不支持语法部分。[221,41]


2.
错误信息:大概是source 1.6 编译不支持 1.7,请使用更高版本。

解决方法:1)修改build path ,configration,libraries jdk1.7版本以上。
2)修改修改编译器compiler为高级版本。
3)在pom.xml下 添加以下配置:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
</properties>

<dependencies>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>

3.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project lietou-webapp: Compilation failure
[ERROR] \workspace\javaall\lietou-java\lietou-web\lietou-webapp\src\main\java\com\lietou\web\controller\HomeController.java:[1844,24] 错误: 无法将类 HunterService中的方法 updatePrivateCustomize应用到给定类型;
[ERROR] -> [Help 1]

错误原因:有依赖没有打包,没有生成相应的jar包,所以调用失败。

解决办法:找到对应的项目打包即可。 或者使用批处理命令进行打包。

4.

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'candidateController': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire field: private com.lietou.crawler.resume.dedup.service.DuplicateService com.lietou.web.controller.CandidateController.duplicate;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'duplicate' defined in ServletContext resource [/WEB-INF/app-web-dao-beans.xml]:
Cannot resolve reference to bean 'segementWordUtil' while setting bean property 'segementWordUtil';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'segementWordUtil' defined in ServletContext resource [/WEB-INF/app-web-dao-beans.xml]:
Initialization of bean failed;
nested exception is org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type 'com.lietou.commons.thrift.ThriftClient' to required type
'com.lietou.commons.thrift.PooledThriftClient' for property 'tclient';
nested exception is java.lang.IllegalStateException:
Cannot convert value of type [com.lietou.commons.thrift.ThriftClient] to required type
[com.lietou.commons.thrift.PooledThriftClient] for property 'tclient':
no matching editors or conversion strategy found


问题所在:Error creating bean with name 'segementWordUtil' defined in ServletContext resource [/WEB-INF/app-web-dao-beans.xml]:
Initialization of bean failed;
Cannot convert value of type [com.lietou.commons.thrift.ThriftClient] to required type
[com.lietou.commons.thrift.PooledThriftClient] for property 'tclient':
no matching editors or conversion strategy found
首先初始化位于 [/WEB-INF/app-web-dao-beans.xml]下的'segementWordUtil'失败,
找到对应的resources;
然后property 'tclient'属性里的ThriftClient与想要的PooledThriftClient不一致;
则需要为其配置需要的类型。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值