1.nullpointexception 空指针异常
2.illegalargumentexception 非法参数
3.com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1(数据库id自增长字段值长度过长,解决办法,字段长度加长)
4.非法参数,传入参数为null
5.在阿里云oss上传图片遇到这么一个问题
腾讯云cos存储上传图片
StorageTemplate.uploadInputStream(fileallname, image.getInputStream(), contentType);
image 是MultipartFile[] images中的,可以正常上传
在上传到阿里云oss上时,进行了一次转换
将其进行裁剪,然后转换成ByteArrayInputStream
ByteArrayInputStream codeInputStream = new ByteArrayInputStream(os.toByteArray());
结果发现
ossClient.putObject("bucket591", fileName,codeInputStream );
方法保存到图片为空,uploadInputStream里接收第三个参数为inputStream
必须进行转化
InputStream inputStream = new ByteArrayInputStream(os.toByteArray());
ossClient.putObject("bucket591", fileName,inputStream );
其中ByteArrayInputStream是InputStream子类,为什么不能
InputStream inputStream =codeInputStream或者ossClient.putObject("bucket591", fileName,(InputStream)codeInputStream );
转化呢??????
——————————————————————————————————————————————