Painful CLASSPATH

Being troubled by a jersey's UnrecognizedPropertyException, the pain is that the custom restful API is called without problems in other applications, but in my application it throws an exception. I read all the articles on the Internet related to exceptions, and it seems that they are all right; then I print the debug information in the custom restful API, and I can't find any clues. http access, from the debug information can also accept all the json text, but when the WebResource get function reflects the business data type, it prompts that a certain field is unknown. . . . . . , but all fields exist and annotations are added, speechless. . . . . .
I called it through JNI, I decided to write a small unit test of java code, avoid JNI, and the result unit test reported the same exception. . . . . . Speechless, there is no way, I execute it on the command line, I decided to use eclipse to debug the java unit test, built an eclipse project, referenced all the jar packages, run it, and something abnormal happened----- - The exception is not thrown, the result of the call is correct. The same code, what is the difference between the command line and the eclipse project? Now I suspect that it may be a CLASSPATH problem, because my CLASSPATH content is huge, I cut the CLASSPATH a bit and then export it, and found that the java unit test also passed the command line. The tail of the worm is exposed. Finally, it is found that the CLASSPATH contains multiple versions of jersey. After removing the jar packages of jersey and jackson of the lower version, the problem is solved!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326765383&siteId=291194637