zqr95518

zqr95518

Member Since 5 years ago

Nanjing, China

Experience Points
2
follower
Lessons Completed
9
follow
Lessons Completed
44
stars
Best Reply Awards
5
repos

12 contributions in the last year

Pinned
⚡ 一个RGB的调色器
⚡ 带本地数据库的调色板
⚡ A lot of utility class for android fast development
⚡ nacos-template include PPT template and knote
⚡ API governance tool for Spring Boot application
Activity
Jan
18
1 day ago
Activity icon
issue

zqr95518 issue comment alibaba/fastjson

zqr95518
zqr95518

关于一个反序列化泛型类遇到的问题?

有一个远程服务,其接口返回形式大致如下

public class CardServiceResult<T> {
    private boolean success;
    private int code;
    private String message;
    private T result;
}

其中result不同的接口返回的实体不同,我想定义一个通用的反序列化方法,我是这么写的:

  private <T> CardServiceResult<T> post(String url, JSONObject body) {
      String result = HttpUtil.post(url, body == null ? null : body.toJSONString(), HTTP_TIME_OUT);
      CardServiceResult<T> cardServiceResult = JSONObject.parseObject(result, new TypeReference<CardServiceResult<T>>(){});
      return cardServiceResult;
  }

然后我这样调用这个方法:

 CardServiceResult<GetVirtualCardInfoResult> post = post(LOCAL_CARD_SERVICE_ENDPOINT + "/ecard/ecard-pipe", body);
  GetVirtualCardInfoResult result = post.getResult();  // 这里会报ClassCastException!

但是这么写的话cardServiceResult中的result字段会被转换为JSONObejct类型,而不是T类型,请问这个应该怎么处理?

zqr95518
zqr95518

翻了下issue泛型这块这是个大坑啊 ··· public abstract class BaseTask implements Response.Listener{

@Override
public void onResponse(String response) {
    if (onResponseListener != null) {
        // todo a JSON bug
        JsonResult<T> jsonResult = JSONObject.parseObject(response, new TypeReference<JsonResult<T>>() {
        });
        onResponseListener.onResponse((JsonResult<T>)jsonResult);
    }
}
我这是在类上的泛型,这里的T只是个普通的bean也转换不出来
Activity icon
issue

zqr95518 issue comment alibaba/fastjson

zqr95518
zqr95518

关于一个反序列化泛型类遇到的问题?

有一个远程服务,其接口返回形式大致如下

public class CardServiceResult<T> {
    private boolean success;
    private int code;
    private String message;
    private T result;
}

其中result不同的接口返回的实体不同,我想定义一个通用的反序列化方法,我是这么写的:

  private <T> CardServiceResult<T> post(String url, JSONObject body) {
      String result = HttpUtil.post(url, body == null ? null : body.toJSONString(), HTTP_TIME_OUT);
      CardServiceResult<T> cardServiceResult = JSONObject.parseObject(result, new TypeReference<CardServiceResult<T>>(){});
      return cardServiceResult;
  }

然后我这样调用这个方法:

 CardServiceResult<GetVirtualCardInfoResult> post = post(LOCAL_CARD_SERVICE_ENDPOINT + "/ecard/ecard-pipe", body);
  GetVirtualCardInfoResult result = post.getResult();  // 这里会报ClassCastException!

但是这么写的话cardServiceResult中的result字段会被转换为JSONObejct类型,而不是T类型,请问这个应该怎么处理?

zqr95518
zqr95518

@wenshao 遇到了同样的问题,编译不会报错,但是返回的是个JSONObject,继续执行会报ClassCastException JSON.parseObject(response).toJavaObject(new TypeReference<JsonResult>() { })

Jan
15
4 days ago
Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效?

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-starter-alibaba-nacos-discovery

Describe what problem you have encountered 在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效? Will the @LoadBalanced service in the container running in the docker environment on the Alibaba Cloud server occasionally fail to take effect?

使用的是完全相同的镜像,有的能生效,有的不能。 nacos-discovery 2021.1 使用更低版本的nacos-discovery没有发现这个问题。 推测和替换了ribbon有关?因为是偶发的所以没法重现,不知道有没有人遇到和我一样的问题。

zqr95518
zqr95518

docker standalone 20.10.12 镜像: CentOS 基础镜像版本不明 jdk1.8.0_181 spring boot 2.4.13 spring-cloud 2020.0.4 spring.cloud.alibaba 2021.1 最近在不同服务器上发现了相同现象,@LoadBalanced不走nacos获取ip,而是走的本地host。 @steverao 其他环境的正常代码,放到了有问题的环境里都会报错,镜像代码都是相同的,还需要提供什么信息么

Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效?

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-starter-alibaba-nacos-discovery

Describe what problem you have encountered 在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效? Will the @LoadBalanced service in the container running in the docker environment on the Alibaba Cloud server occasionally fail to take effect?

使用的是完全相同的镜像,有的能生效,有的不能。 nacos-discovery 2021.1 使用更低版本的nacos-discovery没有发现这个问题。 推测和替换了ribbon有关?因为是偶发的所以没法重现,不知道有没有人遇到和我一样的问题。

Jan
10
1 week ago
Dec
10
1 month ago
started
started time in 1 month ago
Dec
2
1 month ago
Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效?

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-starter-alibaba-nacos-discovery

Describe what problem you have encountered 在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效? Will the @LoadBalanced service in the container running in the docker environment on the Alibaba Cloud server occasionally fail to take effect?

使用的是完全相同的镜像,有的能生效,有的不能。 nacos-discovery 2021.1 使用更低版本的nacos-discovery没有发现这个问题。 推测和替换了ribbon有关?因为是偶发的所以没法重现,不知道有没有人遇到和我一样的问题。

zqr95518
zqr95518

有Loadbalance用服务名访问如果不存在是报找不到服务,而有问题的时候是提示找不到host

Activity icon
issue

zqr95518 issue alibaba/spring-cloud-alibaba

zqr95518
zqr95518

在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效?

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-starter-alibaba-nacos-discovery

Describe what problem you have encountered 在阿里云服务器上的docker环境中运行的容器中服务的@LoadBalanced会偶尔不生效? Will the @LoadBalanced service in the container running in the docker environment on the Alibaba Cloud server occasionally fail to take effect?

使用的是完全相同的镜像,有的能生效,有的不能。 nacos-discovery 2021.1 使用更低版本的nacos-discovery没有发现这个问题。 推测和替换了ribbon有关?因为是偶发的所以没法重现,不知道有没有人遇到和我一样的问题。

Dec
1
1 month ago
Activity icon
fork

zqr95518 forked Ludeon/RimWorld-ChineseSimplified

fork time in 1 month ago
Nov
30
1 month ago
Activity icon
issue

zqr95518 issue comment lensapp/lens

zqr95518
zqr95518

Add some enhancements to the pod log?

What would you like to be added: Such as manual refresh, auto swap, line num limit, refresh rate etc.

Why is this needed: In order to better view the pod log.

Environment you are Lens application on:

  • Kubernetes distribution: [EKS, AKS, GKE, Rancher, ...]
  • Desktop OS: win10 21H2
zqr95518
zqr95518

Oops its a typo. Add an option of soft wrap. I can use a button to refresh instead of waiting for it to refresh itself. Sometimes it may take several seconds, although I only need one line of log

Nov
29
1 month ago
Activity icon
issue

zqr95518 issue lensapp/lens

zqr95518
zqr95518

Add some enhancements to the pod log?

What would you like to be added: Such as manual refresh, auto swap, line num limit, refresh rate etc.

Why is this needed: In order to better view the pod log.

Environment you are Lens application on:

  • Kubernetes distribution: [EKS, AKS, GKE, Rancher, ...]
  • Desktop OS:
Nov
25
1 month ago
started
started time in 1 month ago
Nov
19
2 months ago
Activity icon
issue

zqr95518 issue comment querydsl/querydsl

zqr95518
zqr95518

Error on genarate sql using Projections.bean

When there are two entity Schedule and Program. The Schedule manytomany with Program using JoinTable. Then use Projections.bean like this.

@Data
public class ScheduleSelectDTO {
    public static QBean<ScheduleSelectDTO> dto = Projections.bean(
            ScheduleSelectDTO.class,
            schedule.id,
            schedule.name,
            schedule.type,
            schedule.programList
    );
    private String id;
    private String name;
    private String type;
    private List<Program> programList;
}

The sql generated like this.

SELECT
	schedule0_.id AS col_0_0_,
	schedule0_.NAME AS col_1_0_,
	schedule0_.type AS col_2_0_,
	.AS col_7_0_,
	program2_.id AS id1_2_,
	program2_.create_by AS create_b2_2_,
	program2_.create_date AS create_d3_2_,
	program2_.del_flag AS del_flag4_2_,
	program2_.update_by AS update_b5_2_,
	program2_.update_date AS update_d6_2_,
	program2_.active AS active7_2_,
	program2_.content AS content8_2_,
	program2_.NAME AS name9_2_,
	program2_.screen_mode AS screen_10_2_,
	program2_.show_mode AS show_mo11_2_,
	program2_.show_time AS show_ti12_2_,
	program2_.speed AS speed13_2_,
	program2_.type AS type14_2_ 
FROM
	tis_schedule schedule0_
	INNER JOIN tis_schedule_program programlis1_ ON schedule0_.id = programlis1_.schedule_id
	INNER JOIN tis_program program2_ ON programlis1_.program_id = program2_.id

The sql error with useless " .AS col_7_0_,".


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

zqr95518
zqr95518

Please provide the domain as well so that this can be reproduced.

Can still reproduce in 5.0.0

Nov
17
2 months ago
Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-alibaba-nacos-config

Describe the bug nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台 After nacos-config is upgraded to version 2021.1, the configuration obtained at startup will not be printed to the console.

To Reproduce Steps to reproduce the behavior:

  1. 配置好nacos

  2. 正常启动服务

  3. Configure nacos

  4. Start the service normally

Expected behavior 启动时打印获取到的配置到控制台 Print the acquired configuration to the console at startup

Additional context spring-boot 2.4.12 spring-cloud-alibaba-nacos-discovery 2021.1 spring-cloud-alibaba-nacos-config 2021.1 nacos server 2.0.3

zqr95518
zqr95518

懂了,level开到debug就看到了,虽然并不是用配置开关的,至少能看到了。

logging:
  level:
    com.alibaba.cloud.nacos.client: debug
Nov
16
2 months ago
Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-alibaba-nacos-config

Describe the bug nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台 After nacos-config is upgraded to version 2021.1, the configuration obtained at startup will not be printed to the console.

To Reproduce Steps to reproduce the behavior:

  1. 配置好nacos

  2. 正常启动服务

  3. Configure nacos

  4. Start the service normally

Expected behavior 启动时打印获取到的配置到控制台 Print the acquired configuration to the console at startup

Additional context spring-boot 2.4.12 spring-cloud-alibaba-nacos-discovery 2021.1 spring-cloud-alibaba-nacos-config 2021.1 nacos server 2.0.3

zqr95518
zqr95518

貌似从某个版本中开始就是默认关闭的,有个配置可以开启的,可以翻下源码,在nacos-client中

对nacos的源码不熟,能不能指点一下_(:з」∠)_

Nov
15
2 months ago
Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-alibaba-nacos-config

Describe the bug nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台 After nacos-config is upgraded to version 2021.1, the configuration obtained at startup will not be printed to the console.

To Reproduce Steps to reproduce the behavior:

  1. 配置好nacos

  2. 正常启动服务

  3. Configure nacos

  4. Start the service normally

Expected behavior 启动时打印获取到的配置到控制台 Print the acquired configuration to the console at startup

Additional context spring-boot 2.4.12 spring-cloud-alibaba-nacos-discovery 2021.1 spring-cloud-alibaba-nacos-config 2021.1 nacos server 2.0.3

zqr95518
zqr95518

主要是以前有过这个功能,升级框架了以后没有了现场部署的时候不能直接检查配置有没有问题了

Nov
12
2 months ago
started
started time in 2 months ago
Activity icon
issue

zqr95518 issue jaxxa/ED-Shields

zqr95518
zqr95518

System.NullReferenceException: Object reference not set to an instance of an object

Exception ticking Spark1206255 (at (225, 0, 189)): System.NullReferenceException: Object reference not set to an instance of an object at Jaxxa.EnhancedDevelopment.Shields.Shields.Comp_ShieldGenerator.WillProjectileBeBlocked (Verse.Projectile projectile) [0x000c1] in <3d63d1ea63e14fbeb349128b120f21fb>:0 at Jaxxa.EnhancedDevelopment.Shields.Shields.Building_Shield.WillProjectileBeBlocked (Verse.Projectile projectileToCheck) [0x00006] in <3d63d1ea63e14fbeb349128b120f21fb>:0 at Jaxxa.EnhancedDevelopment.Shields.Shields.ShieldManagerMapComp+<>c__DisplayClass5_0.b__0 (Jaxxa.EnhancedDevelopment.Shields.Shields.Building_Shield x) [0x00000] in <3d63d1ea63e14fbeb349128b120f21fb>:0 at System.Linq.Enumerable+WhereEnumerableIterator1[TSource].MoveNext () [0x00037] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 at Verse.GenCollection.FirstOrFallback[T] (System.Collections.Generic.IEnumerable1[T] source, T fallback) [0x00012] in <65f126dfb1e4464fa378d4b237f11a99>:0 at Verse.GenCollection.FirstOrFallback[T] (System.Collections.Generic.IEnumerable1[T] source, System.Func2[T,TResult] predicate, T fallback) [0x00007] in <65f126dfb1e4464fa378d4b237f11a99>:0 at Jaxxa.EnhancedDevelopment.Shields.Shields.ShieldManagerMapComp.WillProjectileBeBlocked (Verse.Projectile projectile) [0x0001d] in <3d63d1ea63e14fbeb349128b120f21fb>:0 at Jaxxa.EnhancedDevelopment.Shields.Patch.Patches.PatchProjectile.ProjectileTickPrefix (Verse.Projectile& __instance) [0x0000c] in <3d63d1ea63e14fbeb349128b120f21fb>:0 at (wrapper dynamic-method) Verse.Projectile.DMD<DMD<Tick_Patch1>?663732608::Tick_Patch1>(Verse.Projectile) at Verse.TickList.Tick () [0x0015c] in <65f126dfb1e4464fa378d4b237f11a99>:0 Verse.Log:Error(String, Boolean) Verse.TickList:Tick() Verse.TickManager:DoSingleTick() Verse.TickManager:TickManagerUpdate() Verse.Game:UpdatePlay() Verse.Root_Play:Update()

Activity icon
issue

zqr95518 issue lensapp/lens

zqr95518
zqr95518

Update Lens but he uninstall himself

Describe the bug Update Lens but he uninstall himself.

To Reproduce Steps to reproduce the behavior:

  1. When I see a new version notice, I click yes and he uninstall himself.

Expected behavior Success update

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Lens Version: 5.2.5 5.2.6
  • OS: win10 19043.1320
  • exe

Additional context It seems lens download new file failed, and didn't check the broken file and can't install by himself.

Activity icon
issue

zqr95518 issue comment alibaba/spring-cloud-alibaba

zqr95518
zqr95518

nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-alibaba-nacos-config

Describe the bug nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台 After nacos-config is upgraded to version 2021.1, the configuration obtained at startup will not be printed to the console.

To Reproduce Steps to reproduce the behavior:

  1. 配置好nacos

  2. 正常启动服务

  3. Configure nacos

  4. Start the service normally

Expected behavior 启动时打印获取到的配置到控制台 Print the acquired configuration to the console at startup

Additional context spring-boot 2.4.12 spring-cloud-alibaba-nacos-discovery 2021.1 spring-cloud-alibaba-nacos-config 2021.1 nacos server 2.0.3

zqr95518
zqr95518

配置信息吗?之前的版本好像也是不行的吧?另外问一下你为什么要打印在控制台呀?

2.1.1.RELEASE的时候还是有的,启动的时候打印配置比较方便观察配置有没有生效。

Nov
8
2 months ago
Activity icon
issue

zqr95518 issue alibaba/spring-cloud-alibaba

zqr95518
zqr95518

nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.

Which Component spring-cloud-alibaba-nacos-config

Describe the bug nacos-config升级到2021.1版本以后,启动时获取的配置不会打印到控制台 After nacos-config is upgraded to version 2021.1, the configuration obtained at startup will not be printed to the console.

To Reproduce Steps to reproduce the behavior:

  1. 配置好nacos

  2. 正常启动服务

  3. Configure nacos

  4. Start the service normally

Expected behavior 启动时打印获取到的配置到控制台 Print the acquired configuration to the console at startup

Additional context spring-boot 2.4.12 spring-cloud-alibaba-nacos-discovery 2021.1 spring-cloud-alibaba-nacos-config 2021.1 nacos server 2.0.3