Remember once using pit dubbo version conflicts resulting from the process

Introduction : September 23, 2019 Temporary work, a changing demand for products near the end of the stage. Local test OK, spirits rushing thinking about publishing to the test environment, verify there is no problem, five minutes to end the fighting, tomorrow begins the next needs. With on CE (devOps company system) is switched to the hotfix / xxx branch line deployment. No deployment issue, run through a single measure, uh uh uh uh uh. A bunch of inexplicable mistake. How is it possible, then deploy, then restart, or error, is it a problem with the company's CE (formerly inexplicable problems), freed reapply for server deployment. Busy for a pass or not. Despair, regret. What's rotten to force environment. Local obviously no problem, how to deploy it on the case (a common problem programmer, hee hee). Too, sandbox environment is broken, can not be resolved even think to go tomorrow but also with the ISV.

 

Look into the problem: to identify problems inlet affirmative chant according to the log, a single measurement error log as follows:


2019-09-24 19:19:57.899 ERROR --- [io-12345-exec-1] c.y.p.g.facade.ParkingBizOpenApiImpl     : (ParkingBizOpenApiImpl.java:90) : 参数校验或转换出错javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank' validating type 'java.lang.String'. Check configuration for 'auth_code',输入参数为:PrePayPTO(pay_type=ALIPAY, mch_id=2099190827010164, sub_mchid=20190827151134481925, auth_code=11111, total_amount=1, out_trade_no=ISV1569323953935, subject=测试订单, goods_detail=[{"goods_id":"goods_id123","goods_name":"停车缴费","quantity":1,"price":1}], goods_tag=, attach=, extend_params={"industry_reflux_info":{"parking_id":"PI1509464128728884840","car_number":"京XX1234","einlass":"2019-08-15 17:30:26","parking_hours":"1.5","parking_name":"测试停车场"}}, service_name=PKTEST01)

Look logs probably meant to say @NotBlank annotations can not be used on the property auth_code, first: I did not turn over a piece of code, obviously before you can run, second: my auth_code is of type String, and @NotBlank is used in a String the type , then the internet to find a bunch of blog, found a blog with said springboot2.0, Hibernate Validator-version conflicts  may report this error, delete all local third-party packages introduced, and then re-import, view the local project dependencies ,really:

image.png

hibernate-validator two version numbers, 6.0.16.Final is my own, 5.2.4.Final where they come from, with access to its own Show depencies  , find hibernate-validator introduced as shown:

image.png

According to the two versions into points, and finally found 5.2.4.Final is introduced dubbo dependent on others brought in, they did not have before, after adding the (so no previous exposure to the problem, the image above dense dependency graph also introduced them after one of its dependencies become so could not bear to look into the way), and then from their dependence excluded-Validator Hibernate , the problem is solved.

 

postscript:

1: By lying off the pit, although I think this is a problem caused by coders, it can be considered a drawback dubbo use it.

2: Now when coding is basically a project, more moduel architecture, so often exposed service interface dubbo just a moudel project, while the parent pom in general will look at introducing common dependence. Such services are virtually forced to rely on consumers. It is recommended that dubbo Foreign api, try not to follow in his father pom, and the least dependent publishing interface.

3: a normal state of mind, calmly analyze the problem, do not shirk any issue to the environment.

 

Highlights: The above said settlement process, although very simple, but in actual operation due to various reasons, toss three or four hours.

First of all: always convinced that environmental problems, I wrote the code will have no problem; I simply did not turn over the code here, and has been stable operation for a long time.

Second: online environment server does not give permission to open, can not download jar package, local beginning did not remove all local third-party dependency, because dependency graph above that is too large, the computer crashes, can not confirm which depend on the introduction of third party reliance, and local packaging is no problem, local multiplex can not now, jar package line can not see.

Finally: because others depend fucked me, then quickly look at my pom dubbo interfaces provide both:

image.png 

Fortunately, it really wise, not inherited from the parent pom, separates out. Then take a look dependence:

image.png

 

Ah, Editor's Note. . . . Hey, no way, the product to be personalized tips parity information, or that dozens of lines of if / else, well, so be it, mutual interaction pit pit bar. . Go home to sleep. . . . . . . Programmers do not like this, then someone else deceptive pit others thing. . . .

 

Guess you like

Origin www.cnblogs.com/wenq001/p/11580668.html