近期整理的初级开发遇到的问题,希望对大家有用。

1、Unsatisfied dependency expressed through field 'baseMapper'
    于是在pom.xml中搜索mybatis关键字,发现的确有多个,
    把其他有mybatis关键字的都删掉,只留下以下一份mybatis starter
    <!--mybatis-plus支持 -》 Mybatis-Plus学习官方文档:https://baomidou.oschina.io/mybatis-plus-doc/#/quick-start-->
    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>2.2.0</version>
    </dependency>
    但发现运行后仍然报这个错。

刚开始怀疑是不是这个有问题,又继续定位,
    发现baseMapper的确没有映射,于是人工在对象前加上@Mapper
    @Mapper
    public interface SkyUserMapper extends BaseMapper<SkyUser> {

}
    问题搞定。
    总结:
    那这里就有两个问题,一个是mybatis-plus包是否正确的问题,第二个是生成的Mapper代码没有进行@Mapper映射。

当然这里也可以在Application中进行@MapperScan。
2、A component required a bean of type 'com.hll.mapdataservice.common.service.impl.ReportPoiServiceImpl' that could not be found
    原因:有一个被我注入其它类的 业务类上没有给注解:@service 。
    PS:还有2种原因
    1) 要求 service 和 controller 需要在同一个包下 。
    2)有可能没有引入依赖的服务bean。
    1.controller层没有加@ResponseBody
    2.Service层实现类未添加注解@Autowired
    3.@RestController使用成了@Controller
    https://jiming.blog.csdn.net/article/details/103185972
3、在使用mybatisplus插件进行分页查询时分页参数不起作用,总是查出来全部数据。
    解决方案:
    查阅资料通过添加配置类MybatisPlusConfig解决问题:
    @Configuration
    public class MybatisPlusConfig {
        @Bean
        public PaginationInterceptor paginationInterceptor(){
            return new PaginationInterceptor();
        }
    https://blog.csdn.net/u010274856/article/details/105775931
4、springboot swagger配置,Unable to infer base url
    两个方案:
    1. 使用@EnablerSwagger2注解
    2. 允许匿名访问下列URL

5、Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
    1.controller层没有加@ResponseBody
    2.Service层实现类未添加注解@Autowired
    3.@RestController使用成了@Controller
6、自动注入失败的两种可能:NoSuchBeanDefinitionException: No qualifying bean of type 'com.aaa.xxx'' available
    1)注解
    检查@Controller、@Service、@Repository、 @Component 是否加上其中的一个.
    2)检查包扫描的路径
    SpringBoot项目的Bean装配默认规则是根据Application类所在的包位置从上往下扫描!
7、docker rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:235: starting container process caused "exec: \"/bin/bash/\": stat /bin/bash/: not a directory"
8、org.postgresql.util.PSQLException: ERROR: relation "mnr_netw_geo_link" does not exist
    原来,PG库用户登录后,默认搜索的schema名字为search_path = '"$user", public',而我操作的schema恰恰不是当前用户,所以如果使用的不同用户连接不同的schema时,配置连接url,需要指定当前需要访问的schema名,如下:
    jdbc:postgresql://localhost:5432/cmpdb?useUnicode=true&characterEncoding=utf8&currentSchema=xxxxx
9、Feign调用时,要指定Content-Type,提示“Invalid mime type "{Content-Type}": does not contain '/'”
    https://blog.csdn.net/u010131277/article/details/76033794
    解决办法: consumes = MediaType.APPLICATION_JSON_VALUE
    @RequestMapping(value = "/generate/password", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
10、pip3 install geopandas 提示:No such file or directory: 'gdal-config'
    解决办法:1、brew install gdal
            2、pip3 install geopandas
11、No serializer found for class
    原因:相应的Bean中没有生成getter和setter方法,并且最好提供无参构造
    https://blog.csdn.net/qq_39240270/article/details/88840574
12、shp2pgsql导数据入库,“Unable to convert data value to UTF-8 (iconv reports "无效或不完整的多字节字符或宽字符"). Current encoding is "UTF-8". Try "LATIN1" (Western European)”
    原因:Shape数据中的字符集与pg的不符,pg的是utf-8,如果不是的话,需要在参数中指定(-w):
    解决:shp2pgsql -s 3857 -c -W "GBK" /tmp/shp/CLLX.shp public.CLLX2 | psql -d shp2pgsqldemo -U gisdb -W
    https://www.cnblogs.com/think8848/p/6929351.html
13、A compent required a bean of type 'java.lang.String' that could not found
    项目中用到了@Resource注解,但是@Resource下面并没有任何变量和方法,就会引发这个问题
    https://blog.csdn.net/zhanglei082319/article/details/88394299
14、Cause: java.sql.BatchUpdateException: Batch entry 0
    数据类型的比对,不匹配
15、org.postgresql.util.PSQLException: ERROR: relation "tl_test" does not exis
    当你跟postsql连接的时候出现这个错误,那就证明你hibernamte或者数据库发送sql语句的时候没有tl_test这个表;hibernate连接postsql数据库里的表名称要小写,因为hibernate在连接的时候会自己把映射表名转换小写
16、Caused by: org.postgresql.util.PSQLException: ERROR: relation "user_task" does not exist
    修改
    @TableName("USER_TASK")
    为
    @TableName("\"USER_TASK\"")
    后面创建表的时候一定要按照规范把表名创建为小写的,坑啊
17、Injection of resource dependencies failed;
    我的问题是dao的调用出现死循环,即XyyyyDao实现里面,调用了他接口的本身方法
18、待解决问题:使用mybatis-plus 的 savebatch 方法速度很慢,3600条要用2分钟多
    https://blog.csdn.net/u012572955/article/details/88534485
19、gradle项目使用lombok的@Slf4j注解输出日志时报了这么个错:错误: 找不到符号
            log.info("xxxx");
    解决,解决方法如下:build.gradle里除了引用
    org.projectlombok:lombok:1.18.8
    之外还需:
    annotationProcessor 'org.projectlombok:lombok:1.18.8'
    https://blog.csdn.net/liulangGG/article/details/114369461
20、postgres ERROR: column “id” does not exist?
    pg的字段都是小写,如果不是小写需要加"":
    @TableField("\"LINK_ID\"")
    private Integer linkId;
    在请求的时候也需要加转义
    QueryWrapper<HereThaStreets> scenicFileQueryWrapper = new QueryWrapper<>();
    scenicFileQueryWrapper.eq("\"LINK_ID\"",Integer.parseInt(id));
21、postgresql自动更新时间戳
    1)首先需要通过代码创建函数,也就是定义触发器。

create or replace function cs_timestamp() returns trigger as
    $$
    begin
        new.updatetime= current_timestamp;
        return new;
    end
    $$
    language plpgsql;

cs_timestamp():为你定义函数的名称。
    updatetime:为你表中更新时间戳字段名称(pgsql不可以大写的 欧巴)。
    其他的不用管执行就可以了。此过程只能通过sql实现.
    2)接下来就是创建触发器了

create trigger cs_name before update on student for each row execute procedure cs_timestamp();
    1
    cs_name:触发器名称,可以随意设置,但是不要虎了吧唧整成中文的。
    student:表名
    cs_timestamp():触发器所要用的函数名称,与第一步函数名称保持一致。

https://blog.csdn.net/J926926/article/details/109173738

22、Vue项目请求时间过长(1分钟左右)断开连接的
    vue中axios设置timeout超时
    https://blog.csdn.net/qq_36727756/article/details/93738441?utm_medium=distribute.pc_relevant_download.none-task-blog-2~default~BlogCommendFromBaidu~default-1.nonecase&dist_request_id=&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-2~default~BlogCommendFromBaidu~default-1.nonecas
    后台跨域时间设置
    最后的原因是:网关请求时间设置,使用的是konga:
    Connect timeout
    optional
    6000000
    The timeout in milliseconds for establishing a connection to your upstream server. Defaults to 60000

Write timeout
    optional
    6000000
    The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server. Defaults to 60000

Read timeout
    optional
    6000000
    The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. Defaults to 60000
23、com.alibaba.fastjson.JSONException: syntax error, expect {, actual [, pos 64, fieldName ***, fasjson
    错误来源是:JSON转实体类时抛出此异常
    其实关键就出在异常提示的 expect 后的 "{" 与 actual "["
    expect(期望的) "{"
    actual   (真实的)  "["
    看到这里可能懂了。其实就是在接 Member 这个内部类,这个字段是个集合,真实的数据是 "[ Object, Object ]"
    而写的程序是 Object "{}" 本来是一个List<Object>集合对象,一定要它返回Map键值对对象,它能听话么?
    所以把实体类结构改为List
    https://blog.csdn.net/qq_43227967/article/details/90179364
24、因fastjson版本不同,导致的在测试类中main成功(1.2.75),在方法中调用失败(1.2.37)
    1)把所有的fastjson的版本改成1.2.37,在main和方法中都报同样的问题了;依赖中也只有1.2.37了
    2)我再把1.2.37全部改成1.2.75,依赖中也只有1.2.75了
    然后就成功了
25、Failed to configure a DataSource: 'url' attribute is not specified and no embedded
    分析一下:上面的描述是说没有配置数据源,未能确定合适的驱动程序类
    原因:因为我在pom文件中添加了mybatis依赖,但是我没有配置连接数据库的url、用户名user 、和密码 password
    解决方法:添加数据库连接配置
    https://blog.csdn.net/qq_38423256/article/details/87472968
26、Intellij Idea诡异报红解决办法
    1)Idea Preferences配置Java Compiler(这步必做)
    钩上:Use '--release' option for cross-compilation (Java 9 and later)
    2)Idea Preferences配置Javac Options(这步可以跳过)
    钩上:Generate no warnings
    3)Idea Preferences配置Annotation Processors(这步必做)
    钩上:Enable annotation processing
    4)清空idea的缓存:File > Invalidate Caches /Restart即可清理缓存(必须做的最后一步,效果最好的一步)
    https://blog.csdn.net/ranjio_z/article/details/110861253
27、Unterminated string literal started at position 545 in SQL select xxx . Expected  char
    Mapper中的@select的sql中,多了个‘号(WHERE (a.group_id = ? AND b.group_id = ?)')
28、 No serializer found for class com.hll.roadedit.common.Dto.RestrictionDto and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.hll.roadedit.common.ResponseResult["data"])
    才知道原来如果需要将某个类转成Json串的话,那么必须要求其属性为public,或者提供public的get()方法。
    注意:必须要是public 的get()方法。
    https://blog.csdn.net/weixin_30332705/article/details/98445347
29、RETURNING "id" was aborted: ERROR: duplicate key value violates unique constraint "here_pha_places_pkey"
    出现的原因是: 以device表为列子.id是唯一的且id在数据库中是自增的. 而现在数据库中存在的id的值大于了id现在应该自增的值.比如现在数据库device表中现在的id是100,而id自增才增长到95.那你在添加一条数据的时候,id是96,id为96的这条数据已经有了,所以id就违反了唯一性约束.
    解决方案:
    1.先要查看这张表中已经存在的id的最大值是多少. 直接在数据库连接工具中输入sql查询.
    Select max(id) from device;
    2.查询这张表的id的自增序列是多少.
    Select nextval(‘device_id_seq’);
    3 . 如果这张表的id的最大值大于 id的自增序列的值.那就证明添加的时候会出现id被占用,而导致id违反唯一性约束的问题. 我们只需要重新给id的自增序列赋值,赋一个大于现在表中id的最大值就可以了.
    SELECT setval('device_id_seq', xxx);
    4.在重新查询一下,id的自增序列的值是多少,如果和上一步我们设置的值一样的话,就没有问题了.
    Select nextval(‘device_id_seq’);
    https://blog.csdn.net/qq_35976271/article/details/80523042
30、docker denied: requested access to the resource is denied
    需要先修改docker的tag,再进行push
    https://sample.blog.csdn.net/article/details/70156144
31、Java String split("|")时,字符串中不包含“|”时,会按单个字母进行切割
    解决:需要加一下黑底"\\|"
    https://blog.csdn.net/qq_41785135/article/details/82840626
32、docker 部署时区不对,差8个小时

https://sg.jianshu.io/p/43e5d72b0f63
    解决:
    FROM openjdk:8-jdk-alpine
    ADD roadedit-0.0.1-SNAPSHOT.jar /
    EXPOSE 8080

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    RUN echo 'Asia/Shanghai' > /etc/timezone

# you can put your own leaf.properties file into the '/' path
    CMD ["java", "-Xbootclasspath/a:./", "-jar", "roadedit-0.0.1-SNAPSHOT.jar"]
33、mac  make docker_build_push:
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    解决:
    终端输入
    xcode-select --install

https://blog.csdn.net/weixin_39172380/article/details/88388913
34、Navicat导出excel数据量过大,只有1048575
    解决:
    导出csv或txt
    原因:Excel一张Sheet最多只能达到1048575行
    https://blog.csdn.net/c851204293/article/details/89874542
35、A problem was found with the configuration of task ':business:bootJar' 
    解决:重新clean,再次build
36、npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree
    原因:因为npm7.x对某些事情比npm6.x更严格
    npm i --legacy-peer-deps
    https://blog.csdn.net/weixin_40461281/article/details/115543024
37、dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.67.dylib   Referenced from: /usr/local/bin/node   Reason: image not found
    原因:简单来说就是链接失效了,其实就是版本的问题
    解决方案:简单粗暴,直接更新node版本即可 brew upgrade node
    https://blog.csdn.net/ssjdoudou/article/details/107447022?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-6.vipsorttest&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-6.vipsorttest
38、Type handler was null on parameter mapping for property ‘geom’。It was either not specified and/or could not be found for the javaType (org.postgis.geometry) : jdbcType (null) combination.
    Java Geometry空间几何数据的处理应用
    https://www.jianshu.com/p/5e9c9131d75e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
    https://blog.csdn.net/YYZZHC999/article/details/102863403
    https://www.jianshu.com/p/e27e28996ad1
39、 has been injected into other beans [linkSw2021q133ServiceImpl] in its raw version as part of a circular reference
    原因:在linkSw2021q133ServiceImpl,引用了linkSw2021q133ServiceImpl或者mapper,导致循环依赖
    解决:在linkSw2021q133ServiceImpl中使用this进行相关的访问

40、PostgreSQL:ERROR: column xx is of type geometry but expression is of type character var
    解决:
    url后面加上stringtype=unspecified就可以使用任意格式插入了,除了json和array之外,其他的特殊类型,比如地址,间隔,时间等都可以使用string
    https://www.cnblogs.com/haolb123/p/14263133.html
41、PostgreSQL:Tried to send an out-of-range integer as a 2-byte value: 839916
    原因:从源代码中可以看到pgsql使用2个字节的integer,故其取值范围为[-32768, 32767]。这意味着sql语句的参数数量,即行数*列数之积必须小于等于32767.
    解决:如果一次插入的数据量太多,使得参数数量超过了最大值,只能分批插入了
    https://blog.csdn.net/ziranqiuzhi/article/details/104331348
42、Null return value from advice does not match primitive return type for: public abstract int
    原因:接口是返回基本类型(primitive),切面拦截后返回了null
    解决:将int 改为包装类型Integer
43、使用sublist分组数据,总数量少了
    原因:subList返回的是bookList中索引从fromIndex(包含)到toIndex(不包含)的元素集合
    注意:
    不过还是有以下几点要注意,否则会造成程序错误或者异常:
    修改原集合元素的值,会影响子集合
    修改原集合的结构,会引起ConcurrentModificationException异常
    修改子集合元素的值,会影响原集合
    修改子集合的结构,会影响原集合
44、required string parameter ‘XXX‘is not present
    原因:接口中必填的参数没有
    解决:检查接口的参数,将必填的参数加进去
45、ERR! configure error 
    ERR! stack Error: EACCES: permission denied, mkdir '/root/.jenkins/workspace/wf-task-frontend/node_modules/node-sass/.node-gyp'
    ERR! System Linux 3.10.0-957.21.3.el7.x86_64
    原因:还是权限问题
    就是说 npm 出于安全考虑不支持以 root 用户运行,即使你用 root 用户身份运行了,npm 会自动转成一个叫 nobody 的用户来运行,而这个用户几乎没有任何权限。这样的话如果你脚本里有一些需要权限的操作,比如写文件(尤其是写 /root/.node-gyp),就会崩掉了。
    解决:为了避免这种情况,要么按照 npm 的规矩来,专门建一个用于运行 npm 的高权限用户;要么加 --unsafe-perm 参数,这样就不会切换到 nobody 上,运行时是哪个用户就是哪个用户,即是 root。
    https://blog.csdn.net/qq_31325079/article/details/102565223
46、[GC (Allocation Failure) [PSYoungGen: 2097664K->230481K(2446848K)] 2150928K->283754K(8039424K), 0.7424012 secs] [Times: user=0.89 sys=0.27, real=0.74 secs] 
    回收参数说明:
    https://blog.csdn.net/weixin_43821874/article/details/90675264
47、nested exception is org.postgresql.util.PSQLException: FATAL: password authentication failed for user \"postgres\""
    原因:这主要是由于用户密码认证方式引起的,Postgresql数据库安装好后默认采用md5密码加密认证方式。
    解决方法:
    打开Postgresql安装目录下的data文件夹,找到pg_hba.conf文件并打开。
    修改认证方式,将md5改为trust,然后保存。
    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          trust
48、在使用mybatis-plus,updatebatchbyid方法时,一个字段属性没有赋值,但更新为0
    原因:该字段使用的是double类型,默认值为0.0;在使用updatebatchbyid的时候,只有为null的时候才不会更新;如果为0.0,刚会更新为0.0
    解决:将类型改为封装类型Double
49、使用javadbf对dbf文件进行写时,提示Fields should be set before adding records
    原因:没有写表头/字段名
    解决:先写表头信息,再进行内容填写 dbfWriter.setFields(fields);
50、使用javadbf保存数据时,报java.lang.ArrayStoreException: java.lang.Integer
    原因:Value的值是Object型,要装到Object[]数组中,而不是String[](String[] data= new String[fields.length];)。往数组里装不匹配的类型,就抛这个异常;应该使用object类型
    解决:Object[] data= new Object[fields.length];

51、git提交时报错:Updates were rejected because the tip of your current branch is behind
    有如下3种解决方法:
    1.使用强制push的方法:
    git push -u origin master -f
    这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候。

2.push前先将远程repository修改pull下来
    git pull origin master
    git push -u origin master

3.若不想merge远程和本地修改,可以先创建新的分支:
    git branch [name]
    然后push
    git push -u origin [name]
    https://www.cnblogs.com/651434092qq/p/11015806.html
52、Prefix must be in canonical form
    写配置数据源的时候发现,prefix里面不能用驼峰写法,全部小写。
53、spring boot configuration annotation processor not configured
    解决办法:
    在pom.xml中增加如下依赖

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
    https://blog.csdn.net/weixin_42362496/article/details/103805993
54、使用gradle将maven的pom.xml转换成gradle的build.gradle
    gradle init --type pom
    https://blog.csdn.net/qq275949034qq/article/details/40978847
55、profile指定使用test,但启动时还是提示使用了默认配置的datasource
    原因:使用mybatis-plus的动态数据源,需要写两个datasource,第一个指spring的datasource,第二个指mybatis-plus的动态数据源的datasource;只写了动态数据源的datasource,导致找不到对应的数据源配置
    解决:在profile里把spring的datasource添加进去
56、Failure to find XXXX in https://repo.rdc.aliyun.com/repository/136395-release-3TvI6F/ was cached in the local repository
    graphhopper-web-bundle-4.0-SNAPSHOT.jar.lastUpdated
57、Parsing error was found in mapping #{}. Check syntax #{property|(expression), var1=value1, var2=val
    初学spring boot遇到一个这样的报错,百度之后发现是因为有一个mapper文件里面有一个#{}是空的。加上值之后解决报错。
58、通过shape2pgsl往postgre里导数据时,提示current transaction is aborted, commands ignored until end of transaction block
    原因:postgre创建库后没有创建extension postgis;
    解决:在库中执行create extension postgis;
59、为什么我加了spring事务注解(@Transactional(rollbackFor = Exception.class)),切换数据源失败了?   
    https://blog.csdn.net/trayvonnn/article/details/108473833
    https://www.pianshen.com/article/16831451622/
    https://www.jianshu.com/p/216e17c3a9ba
60、ERROR: Geometry SRID (0) does not match column SRID (4326)
    原因:插入数据时,未指定“SRID=4326”
    解决:INSERT INTO testgeom(the_geom) VALUES (‘SRID=4326;MULTIPOLYGON(((120.5311 31.3652,120.5578 31.3390,120.5623 31.3383,120.5923 31.2795,120.5949 31.2685,120.606803 31.2659,120.6066 31.2707,120.6143 31.2711,120.6178 31.2846,120.63531 31.2870,120.6372 31.2837,120.64341 31.2892,120.653707 31.28808,120.6587 31.2859,120.660157 31.288142,120.661709 31.298719,120.655937 31.3194,120.654671  31.32327,120.648623  31.334765,120.6525 31.3399,120.6469 31.3422,120.6545 31.3430,120.6462 31.3426,120.6373 31.3529,120.6226 31.3525,120.6122 31.3627,120.5937 31.3667,120.5869 31.3618,120.5809 31.3627,120.5745 31.3767,120.5599 31.3852,120.5311 31.3652)))’);
    https://blog.csdn.net/qq_44912644/article/details/89810560

61、在针对使用Arrays.asList(numArr)返回的list进行的remove操作时,提示“Method threw 'java.lang.UnsupportedOperationException' exception”
    原因:Arrays.asList(numArr)方法返回的是Arrays内部类AyyayList
    使用工具类Arrays.asList()把数组转换成集合时,不能使用其修改集合相关的方法,它的add/remove/clear方法会抛出UnsupportedOperationException异常。说明:asList的返回对象是一个Arrays内部类,并没有实现集合的修改方法。Arrays.asList体现的是适配器模式,只是转换接口,后台的数据仍是数组。
    解决:重新创建一个list,copy一下再进行处理
62、 Error creating bean with name 'linkSw2021q133Controller': Injection of resource dependencies failed
    原因:循环引用,比如在aServiceImpl中引用了bServiceImpl;在bServiceImpl中引用了aServiceImpl
    解决:使用mapper对应的方法
63、服务不支持 chkconfig 的解决办法
    原因:缺少#chkconfig行
    解决:在shell脚本中添加#chkconfig:  2345 81 96
    https://blog.csdn.net/denglunqiao1560/article/details/101469831
64、postgresql Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: deadlock detected   详细:Process 6877 waits for ShareLock on transaction 13642922; blocked by process 7002
    原因:更新死锁;https://rcoh.svbtle.com/postgres-unique-constraints-can-cause-deadlock
    解决:
    https://www.cybertec-postgresql.com/en/postgresql-understanding-deadlocks/
65、Atrays.asList不能对基本类型进行转换
    原因: asList接受的參数是一个泛型的变长參数。我们知道基本数据类型是无法发型化的。也就是说8个基本类型是无法作为asList的參数的, 要想作为泛型參数就必须使用其所相应的包装类型。可是这个这个实例中为什么没有出错呢?由于该实例是将int 类型的数组当做其參数。而在Java中数组是一个对象,它是能够泛型化的。
        坑
        1. 不能把基本类型的数组转为list, 因为基本类型不能泛型化
        2. 原数组和转换成的集合会同步改变,改变原数组会导致转换后的集合改变
        3. Arrays.ArrayList是定长的,没有add/remove方法
    解决:基本类型可使用CollectionUtils.arrayToList
    List<String> linkIds = Arrays.asList("111111111,22222222,3333333,4444444".split(",").clone());
    long[] result = linkIds.stream().mapToLong(Long::valueOf).toArray();
    List<Long> resultLont0 = CollectionUtils.arrayToList(result);
    List<Long> resultLong1 = linkIds.stream().map(s -> Long.parseLong(s)).collect(Collectors.toList());
66、ERROR c.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error
    原因:mysql-connector-java版本过低
    解决:mysql-connector-java版本过低,更新到最新版本即可正常运行
    https://blog.csdn.net/weixin_40322495/article/details/111298821
67、使用mybatis操作数据库,sql语句执行成功之后数据库没有更新
    原因:没有自动更新
    解决:设置自动提交事务(sqlSession = sqlSessionFactory.openSession(true);)
    https://blog.csdn.net/weixin_56456610/article/details/120921120?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&utm_relevant_index=1
68、Cannot evaluate com.fasterxml.jackson.databind.node.POJONode.toString()
    原因:使用jackson进行nodeObject赋值时,赋值为对象,没有将对象转成String再赋值
    解决:将对象转为string进行赋值(jsonPath.putPOJO("points", pointsEncoded ? encodePolyline(p.getPoints(), enableElevation, 1e5) : p.getPoints().toLineString(enableElevation).toString());)
69、本地测试,程序运行较长时间后就会报以下错误:Communications link failure,The last packet successfully received from the server was *** millisecond ago.The last packet successfully sent to the server was ***  millisecond ago。
    原因:未知
    解决:将代码放到服务器正常了;可能是你使用了科学上网(有人是这种情况)
    https://blog.csdn.net/qq_27471405/article/details/80921846

The last packet successfully received from the server was 294,336,376 milliseconds ago. The last packet sent successfully to the server was 294,336,379 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    补充:https://www.cnblogs.com/igoodful/p/13086191.html
70、使用javax.json解释json文件时提示Provider org.glassfish.json.JsonProviderImpl not found
    原因:在引入依赖时,只引用了javax.json » javax.json-api,这个只对编译时有效,运行时,需要添加依赖org.glassfish » javax.json
    解决:添加org.glassfish » javax.json依赖
    http://cn.voidcc.com/question/p-ysjhbnrk-bhe.html
71、在使用java调用postgre 备份数据时,使用/usr/pgsql-12/bin/pg_dump -U postgres -h 192.168.160.13 -p 15999 -E utf8 here_hk_q3 > /data/oversea/databasebackup/backup_20220428185405.sql时,备份失败
    原因:>为文件流重定向符号,最好不要在脚本中使用
    解决:使用参数 -f; /usr/pgsql-12/bin/pg_dump -U postgres -h 192.168.160.13 -p 15999 -E utf8 here_hk_q3 -f /data/oversea/databasebackup/backup_20220428185405.sql
72、使用Java调用minio-api上传数据时,提示minio object-prefix is already an object please choose a different object-prefix name
    原因:minioUpload(endPoint,accessKey,secretKey,bucketName,"test/dbbackup/backup_" + sdf.format(d) +".sql",backupPath) 里objectName里的前缀test与已有的一个bucketName,test一样;不能使用
    解决:换个bucket未使用的前缀
    https://github.com/minio/minio/issues/9865
73、gradle no main manifest attribute, in xxx jar
    原因:build.gradle文件缺少了gradle的打包插件
    解决:在gradle文件中添加以下语句:
        apply plugin: "java"
        apply plugin: "org.springframework.boot"
    https://www.yht7.com/news/80404
74、pg_ctl: no database directory specified and environment variable PGDATA unset
    Try "pg_ctl --help" for more information.
    原因:无
    解决:cd /usr/pgsql-12/bin/
        ./pg_ctl -D /data/postgres/mapdata_oversea reload
75、intellij idea Cpu占用率很高,风扇一直转
    原因:只要打开编辑器 <unidentified: JobScheduler FJ pool> 就会占用很高;因为插件需要更新
    解决:打开插件管理(plugins),看里面的插件,有几个需要更新,点击更新后,CPU回落到正常水平
76、mysqldump: Couldn't execute 'SELECT COLUMN_NAME,JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'archery' AND TABLE_NAME = '2fa_config';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
    原因:这是因为我的客户端mysqldump的版本大于8,而我的MySQL数据库是比较老的版本的缘故。
    解决:解决方法就是添加--column-statistics=0选项
    https://blog.csdn.net/hzgaoshichao/article/details/124063884
77、mac OSError: [Errno 30] Read-only file system: '/datasets'
    原因:路径问题,不能放在根目录下
    解决:修改目录
78、 size mismatch for cls.2.weight: copying a param with shape torch.Size([16968, 2048]) from checkpoin
    原因:len_num 是3条,配置里写了2条;维度不匹配问题,首先考虑数据集名称与输入特征是否对应
    解决:修改配置中的len_num为3
    https://blog.csdn.net/xxxxxxbaby/article/details/124398100
79、AssertionError: Torch not compiled with CUDA enabled
    原因:没有使用GPU
    解决:将.CUDA()修改为.to('cpu')
    https://www.jianshu.com/p/bd1218391bdc
    https://blog.csdn.net/dujuancao11/article/details/114006234
80、called with incorrect property value 4
    原因:,有人给出的建议是改输入法,不要有任何的不是英文的输入
    解决:将输入法切为英文
    https://blog.csdn.net/weixin_59498739/article/details/122284053

常见问题(持续更新)相关推荐

  1. 网络安全运维面试常见问题持续更新【1】:

    网络安全类常见知识: 1.怎么样提高局域网安全? 第一:安全漏洞时时修补 第二:择优使用防火墙[1.过滤型防火墙2.检测型防火墙3.代理型防火墙] 第三:及时升级杀毒软件 第四:安全策略,定期进行漏洞 ...

  2. [持续更新]UnsatisfiedLinkError常见问题及解决方案

    [持续更新]UnsatisfiedLinkError常见问题及解决方案 参考文章: (1)[持续更新]UnsatisfiedLinkError常见问题及解决方案 (2)https://www.cnbl ...

  3. 【帆软报表】使用技巧及常见问题汇总-持续更新

    [帆软报表]使用技巧及常见问题汇总-持续更新 1.重复与冻结设置,做用:冻结区域 模板-重复与冻结设置 2.单元格有效小数设置 选中单元格-格式-数字-#0.00 3.图表中有效小数设置 图表属性表- ...

  4. TS 常见问题整理(60多个,持续更新ing)

    TS 常见问题整理(60多个,持续更新ing) https://cloud.tencent.com/developer/article/1593335

  5. 快应用开发常见问题以及解决方案【持续更新】

    接触快应用也有一段时间了,踩过了大大小小的坑,让我活到了今天.准备在此立贴持续更新,记录遇到的问题以及解决方案,造福大众. css 方面 1.文字竖排不支持 目前官方还不支持writing-mode, ...

  6. Android:WebView使用常见问题汇总(持续更新)

    前言 从事Android以来,几乎离不开WebView的使用.但是使用WebView的过程中,总会出一些令人意想不到的问题,故打算写一篇文章专门用来记录开发过程中遇到的问题吧.如果大家有遇到什么奇怪的 ...

  7. Java 最常见的 10000+ 面试题及答案整理:持续更新

    Java面试题以及答案整理[最新版]Java高级面试题大全(2021版),发现网上很多Java面试题都没有答案,所以花了很长时间搜集,本套Java面试题大全,汇总了大量经典的Java程序员面试题以及答 ...

  8. 分享大神的一些博文、视频、资料--持续更新

    心理学家 Ericsson 的研究发现:决定伟大水平和一般水平的关键因素,既不是天赋,也不是经验,而是[刻意练习]的程度. 教育最重要的不是灌输,而是引发思考.这样的话就没有必要按时间顺序,介绍很多细 ...

  9. Android面试总结(持续更新修改)

    ###Android面试总结(持续更新修改) 1.Android 的四大组件是哪些,它们的作用? ①Activity是Android程序与用户交互的窗口,是Android构造块中最基本的一种,它需要为 ...

最新文章

  1. C++ 中在函数的前面加上static的作用
  2. pytorch中的pre-train函数模型引用及修改(增减网络层,修改某层参数等)
  3. 前端学习(2063):vue的生命周期
  4. Linux系统编程5:入门篇之在Linux下观察C/C++程序编译过程 gcc/g++使用详解
  5. 【codevs1298】凸包周长,计算几何
  6. mysql 全局权限入门
  7. 【Android安全】ActivityManager.isUserAMonkey API
  8. 用狼的处世哲学做SOHO 一
  9. 计算机音频接口,一台计算机的两个音频输出
  10. 我欢喜,为着时光所有的馈赠
  11. 使用Visual Leak Detector工具检测内存泄漏
  12. Cinemachine 之简单的相机跟随
  13. R语言 - 集成开发环境IDE
  14. python中成绩及格判断代码_用python输入一个百分制考试成绩,判断是否及格并输出结果?...
  15. 求10000内的质数
  16. Myeclipse 2013 professional 破解,下载
  17. 大学四年Java后端学习路线规划,所有私藏资料我都贡献出来了,不看毕业肯定后悔!!!
  18. php超实用正则表达式有哪些
  19. URL、URN、URI
  20. 用微信公众号控制你的树莓派

热门文章

  1. 如何查看端口号是否被占用
  2. 阅文集团换帅:程武辞任CEO职务 总裁侯晓楠接任
  3. linux自学笔记(2)
  4. Salesforce中jquery ui中的autoComplete实现自动联想
  5. java入门学习笔记(二)—— Eclipse入门学习之快捷键、java语言基础知识之各类关键字及其用法简析
  6. MongoDB相关操作
  7. PAPR论文阅读笔记2之On the distribution of the peak-to-average power ratio in OFDM signals
  8. Drupal Theme 主题系统:入门与进阶教程
  9. Unity接入科大讯飞SDK-安卓篇
  10. 《Secrets》 秘密 中英互译——【one republic英文经典歌曲】