修改jdk版本
idea—>File—>Priject Structure—>SDKs
idea的Maven项目运行报程序包找不到的错误
IDEA的Terminal命令行输入mvn idea:idea
或者mvn idea:module
, 即可解决
IDEA2020版Maven依赖成功导入但任然报错找不到包解决方案
报错原因:
IDEA启动程序按钮和maven的build使用的jar包环境不一样
解决方案:
设置idea构建/运行操作委托给maven就行了。具体设置:
Settings搜索Runner,勾选delegate ide build/run actions to maven
还要注意编码是否设置UTF-8
java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell
使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
如下图,读取绿色框中的值不抛异常,读取红色框中值出抛出异常,POI认为这是一个数字。
解决
解决方法是在读取某单元格时,使用setCellType()方法先将该单元格的类型设置为STRING,代码如下:
//此处省略N行代码
sheet.getRow(6).getCell(6).setCellType(CellType.STRING);
String cellValue = sheet.getRow(6).getCell(6).getStringCellValue();
//此处省略N行代码
这样就会按字符串类型来读取单元格了。
Data truncation: Data too lang for column ‘salt’ at row 1
该属性输入的长度跟数据库的长度不匹配,数据库长度设置过短!
解决Maven项目右侧maven不显示方法
Ctrl+shift+A --> maven–> add maven projects -->选择对应的pom.xml
org.springframework.beans.factory.UnsatisfiedDependencyException
HTTP状态 500 - 内部服务器错误
类型 异常报告
消息 Servlet[dispatcherServlet]的Servlet.init()引发异常
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'empController': Unsatisfied dependency expressed through field 'jmsTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.jms.core.JmsTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
maven报错maven only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT
解决办法 :
1.找到项目所在 的maven库,然后删除 maven-metadata.xml 这个文件
2.删除整个文件夹
3 重新编译