首页 文章 新番
动漫 学习 生活 日记 书籍 服务器 Bing
  • docker-compose常用配置

    ```version:"3.1"services:redis:container_name:redisimage:redis:6.2.6restart:alwaysprivileged:truecommand:redis-server/etc/redis/redis.confports:-6379:6379volumes:-/etc/localtime:/etc/localtime:ro-$PWD/redis/data:/data-$PWD/redis/redis.conf:/etc/redis/redis.confenvironment:-TZ=Asia/Shanghaies:container_name:esimage:docker.elastic.co/elasticsearch/elasticsearch:7.9.1restart:alwaysprivileged:trueports:-9200:9200-9300:9300volumes:-/etc/localtime:/etc/localtime:ro-$PWD/elasticsearch/data:/usr/share/elasticsearch...

    2022年05月10日 docker-compose
  • Linux加载Java图形验证码错误

    错误信息:```Causedby:java.lang.reflect.InvocationTargetException:nullatjava.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atjava.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)atjava.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)atjava.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)atjava.base/java.lang.reflect.Construct...

    2022年05月08日 Linux Java 验证码
  • 解决方向代理错误

    使用`iframe`提示错误:```MixedContent:Thepageat'https://www.acgist.com'wasloadedoverHTTPS,butrequestedaninsecureformaction'http://www.acgist.com'.Thisrequesthasbeenblocked;thecontentmustbeservedoverHTTPS.````Tomcat`配置:```````SpringBoot`配置:```tomcat:remoteip:host-header:X-Forwarded-Hostprotocol-header:X-Forwarded-Protoremote-ip-header:X-Forwarded-Forprotocol-header-https-value:https```

    2022年05月08日 iframe nginx tomcat SpringBoot
  • feign oauth2

    ```hystrix:command:default:execution:isolation:strategy:SEMAPHORE@Bean@ConditionalOnMissingBeanpublicRequestInterceptorfeignRequestInterceptor(){returnnewRequestInterceptor(){//privatefinalStringBEARER_TOKEN_TYPE="Bearer";privatefinalStringAUTHORIZATION_HEADER="Authorization";@Overridepublicvoidapply(RequestTemplaterequestTemplate){finalRequestAttributesrequestAttributes=RequestContextHolder.currentRequestAttributes();if(requestAttributes!=null){finalHttpServletRequestrequest=((ServletRequestAttributes)requ...

    2022年05月07日 feign oauth2
  • Chrome不自动跳转HTTPS

    ```chrome://net-internals/#hsts```删除自动跳转域名

    2022年05月06日 Chrome
  • CentOS7安装Redis

    ```yuminstallepel-releaseyuminstallredissystemctlenableredissystemctlstartredis```

    2022年05月06日 CentOS redis
  • idea yml maven filter @@配置不能替换

    eclipse正常替换,idea需要添加依赖:```org.yamlsnakeyaml```

    2022年04月29日 idea yml maven filter
  • 复杂SQL

    ##分组组内统计```selectname,count(*),count(score=60ornull),count(score=90ornull),count(score=100ornull)fromt_usergroupbyname;```注意:这里`ornull`必须填写##分区函数```partitionby```##条件```(casewhen...then...when...then...end)```

    2022年04月29日 SQL
  • minio okhttp错误

    找了好久错误结果是配置了jvm参数xss的问题:```java.lang.StackOverflowErroratorg.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)atjava.base/java.lang.ClassLoader.loadClass(UnknownSource)atokhttp3.internal.Util.(Util.kt:595)atokhttp3.HttpUrl$Builder.parse$okhttp(HttpUrl.kt:1239)atokhttp3.HttpUrl$Companion.get(HttpUrl.kt:1633)atokhttp3.HttpUrl$Companion.parse(HttpUrl.kt:1642)atokhttp3.HttpUrl.parse(HttpUrl.kt)atio.minio.MinioClient$Builder.getBaseUrl(MinioClient.java:2791)atio.minio....

    2022年04月28日 minio okhttp
  • Chrome允许自动播放

    Chrome浏览器自动播放:```#旧版本chrome://flags/#autoplay-policy#新版本--autoplay-policy=no-user-gesture-required```

    2022年04月27日 Chrome
  • SQLServer异常

    ```org.springframework.jdbc.UncategorizedSQLException:###Errorqueryingdatabase.Cause:com.microsoft.sqlserver.jdbc.SQLServerException:Incorrectsyntaxnear'@P0'.###Theerrormayexistinfile[****Mapper.xml]###TheerrormayinvolvedefaultParameterMap###Theerroroccurredwhilesettingparameters###SQL:SELECTTOP?site.ConfSiteIdasSiteId,conf.Name,conf.ConfGuid,conf.ConfType,state.StartTime,state.EndFactTimeasEndTime,state.ConfTimeSpanasTimeSpan,conf.CreatUserasCreateUser,site.NameasDeviceName,device.GuidasDeviceGuid,joinTime...

    2022年04月22日 SQLServer MyBatis
  • URI URL 域名

    URI:scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]URL:URI子集域名:主机名.二级域名.顶级域名>顶级域名=一级域名根域名是最后面的一点:www.acgist.com.注意区分根域名、顶级域名服务器、根域名服务器

    2022年04月19日 URI URL 域名
  • AXIOS请求参数问题

    使用`axios`发送`POST`请求的时候,如果使用`params`发送请求参数,默认会拼接到地址栏后面,这样HTTPS就会失效。可以指定请求头部`Content-Type:application/x-www-form-urlencoded`,然后请求类型设置`data:name=name&password=password`使用`data`传递参数。如果不设置请求头,`data`类型需要使用`@RequestBody`接收。

    2022年04月14日 AXIOS POST PARAMS DATA
  • Maven打包错误

    ```Causedby:org.apache.maven.plugin.MojoExecutionException:Youhavetouseaclassifiertoattachsupplementalartifactstotheprojectinsteadofreplacingthem.atorg.apache.maven.plugins.jar.AbstractJarMojo.execute(AbstractJarMojo.java:317)```项目里面没有代码,添加一个`package-info.java`即可。```from/tomaven-default-http-blocker(http://0.0.0.0/):Blockedmirror```修改地址`http`改为`https`

    2022年04月13日 Maven
  • MyBatisPlus缓存问题

    今天发现一个特别奇怪的问题,就是使用MyBatisPlus查询结果里面的list数据一直递增,后来发现原来添加事务注解`@Transactional`后,MyBatisPlus会自动启动缓存,每次修改对象里面的list后,下次在添加数据就会导致递增问题。

    2022年03月31日 MyBatisPlus
  • 修改sonatype密码

    我们在`https://my.sonatype.com/`这个网站修改密码,能同步到`https://issues.sonatype.org/`,但是`https://oss.sonatype.org/`却还是旧的密码。这时候我们需要到`https://issues.sonatype.org/secure/ViewProfile.jspa`页面点击`清除全部`按钮即可。

    2022年03月30日 sonatype
  • WebSocket Spring注入空指针问题

    下面注入空指针:```@Component@ServerEndpoint("/rt/alarm/websocket/{ruleId}")publicclassAlarmWebSocket{@AutowiredprivateAlarmServicealarmService;}```可以通过自己写一个`SpringUtils`来获取,也可以通过下面代码:```@Component@ServerEndpoint("/rt/alarm/websocket/{ruleId}")publicclassAlarmWebSocket{//注意staticprivatestaticAlarmServicealarmService;//注意不要static@AutowiredpublicvoidsetAlarmService(AlarmServicealarmService){AlarmWebSocket.alarmService=alarmService;}}```

    2022年03月28日 WebSocket
  • ORM空值处理

    ##JPA更新判断JPA字段需要保存,但是不要更新,例如创建人、创建时间,可以修改注解属性`update=false`处理:```@Column(name="created_by",updatable=false)```##MyBatis-Plus更新判断修改注解属性`updateStrategy=FieldStrategy.NEVER`处理忽略更新:```@TableField(value="created_by",updateStrategy=FieldStrategy.NEVER)```**需要注意这里的`fill`如果是`update`时,那么会忽略`updateStrategy`属性,表示字段必定更新。**##MyBatis-Plus空值更新```@TableField(updateStrategy=FieldStrategy.IGNORED)```

    2022年03月23日 ORM
  • MyBatisPlus批量操作

    处理默认的saveBatch和updateBatch意外可以自己实现一些批量操作,继承ServiceImpl:```@Overridepublicvoidbatch(Listlist){this.executeBatch(list,(sqlSession,entity)->sqlSession.insert("insertBatch",entity));}insertintot_entity(id)values(#{id})```如果提示`SqlSessionTransactionnotenabled`,有可能是我们内部方法没有代理,需要添加`@Transactional(rollbackFor=Exception.class)`,或者使用代理执行方法`AopContext.currentProxy()`。推荐使用代理调用,因为有时候使用事务事务量太大容易导致系统崩溃。

    2022年03月10日 MyBatisPlus 批量操作
  • MyBatisPlus批量插入MySQL很慢

    开始以为是事务配置的问题,后来发现5.7没问题,是8.0数据库的问题,需要JDBC连接里面添加参数:`rewriteBatchedStatements`

    2022年03月09日 MyBatisPlus MySQL
1...3456789...31

关于 ACGIST

Copyright © 2013-2025 ACGIST.COM. All Rights Reserved.