SOLR's WebService service compatibility upgrade

Source: Internet
Author: User
Tags solr

Summary:I this upgrade is a larger upgrade. Upgrade from the underlying search engine solr4.8 to solr6.4, since the SOLR bottom from 6.x since the JDK must be specified as 1.8, and many of the internal implementation classes have been discarded or simply cut off, resulting in many implementation classes need to make compatibility changes, the third party since the library also need to follow the upgrade transformation. For example, IK thesaurus loading, you need to manually compile and modify the source code, specifically, you can refer to my other blog:http://www.cnblogs.com/liang1101/articles/6395016.html。 This article is mainly from the application to achieve compatibility changes and project release encountered problems and solutions to explain in detail. Application Projects:Within the company's own set of WebService services, provide the appropriate interface for each project group calls to use. The WebService service base uses the Spring container management, Hibernate database connection management approach, in conjunction with SOLR, Lucene dependent packages implemented by the system. Starting background:Use eclipse4.3 + JDK1.7 + solr-solrj-4.8.0 + lucene-core-4.8.0 + spring-core2.5.6 and other key dependent packages. Of course, there are corresponding Lucene-queryparser, Lucene-highlighter, Lucene-memory, hibernate-core-4.3.0, and many related packages of spring, and so on.To start the upgrade: 1. eclipse4.6.2, which is the latest version of Eclipse in January 2017, since eclipse4.6 can support jdk1.8 compilation. Specific to my Baidu cloud disk download: 2. jdk1.8.0_112, because SOLR and Lucene upgrade to the current 6.4.0 the highest version of its underlying dependence must be designated as jdk1.8, it is necessary to download the latest jdk1.8 stable version of January 2017, specific to my Baidu cloud disk downloaded: 3. With solr-solrj-6.4.0, lucene-core-6.4.0, lucene-highlighter-6.4.0, lucene-memory-6.4.0, lucene-queryparser-6.4.0, if called to the SOLR core class, you also need to introduce: solr-core-6.4.0 These packages replace the original 4.8.0 package 4. Modify the method used by the underlying old and new incompatible code (note: This is only the method and class I used, there will be no I have encountered, but the method is the same, see the corresponding API can be easily solved out)is being summed up and will be mended soon ... <1. The above steps will be considered to be all right, because at this time the whole project did not report any errors, including their own local may run and test is OK. Then, at this time we follow the normal logic packaging released to the online environment to start, we will find that the error content may be roughly as follows:Unsupported Major.minor version 52.0The above error is very easy for some experienced programmers, that is, the JDK on the server and the JDK version used by our packager is inconsistent, it is clear that the local use of jdk1.8 and the server is jdk1.7, specifically through the command: Java- Version to view the JDK versions. Then it is good to do, direct download or copy can, the current environment of the JDK upgrade to 18, this is very easy I am not here to wordy. <2.After doing the restart service, found how not good, probably the error is as follows: specific errors I will not paste, save some students to the seat. The general meaning after translation is:The container initialization is not able to initialize the object we need, the keyword is: org.springframework.init ...See this error, it is obviously spring loading problem, naturally think of our quoted spring is a version of the problem, my first reaction may be jdk1.8 and spring2.5.6 incompatible, and then through Google, Stakoverflow and other related sites to see the discovery is really this problem, Spring after the jdk1.8 recommended that the best use of spring-core-3.x package, it is recommended not to use the 4.x package, because the 4.x package also needs to jdk1.8 different versions of the requirements (need to have targeted requirements), start I do not believe, tried the 4.x package, finally found it seems to have a problem (add , it may be related to my operation order, then 3.x no problem I did not try again, on the safe side of the proposal or 3.x, I introduced the spring package is as follows: Spring-aop-3.2.13-release.jar, Spring-beans-3.2.13-release.jar, Spring-context-3.2.13-release.jar, Spring-context-support-3.2.13-release.jar, Spring-core-3.2.13-release.jar, Spring-jdbc-3.2.13-release.jar, Spring-orm-3.2.13-release.jar, Spring-tx-3.2.13-release.jar, Spring-web-3.2.13-release.jar, etc. <3. After two small steps to finish, and then restart the Tomcat service, I have a day ah, how there are problems, I have to rush to collapse, and then bite the bullet to continue Google, found that the server's Tomcat version is too low caused. Oh my God!!!, how could a jdk1.8 upgrade introduce so many questions? But there is no way, to continue to solve, the above may throw some such a general error:Unable to process jar entry [...] from jar[...] for annotations.First of all, how to view the current version of Tomcat, to the corresponding Tomcat installation directory, the execution sh./bin/version.sh command, will print out the current tomcat corresponding version is how much. The reason for this error is because the Tomcat version of the server is lower than apache-tomcat-7.0.59, it is recommended that users upgrade to 7.0 with upgrade Tomcat. 61 or more ( Because there is no tomcat7.0.60 this version, of course 7.0.59 start is so, if you have to use 7.0.59 is also possible). Summary: last upgrade to Tomcat after restarting the service, my goodness, the service finally started normally. At this point, the search engine bottom WebService service compatibility upgrade completed, although the process is a bit difficult, but finally to achieve perfection. I hope this share will be helpful to our friends.

SOLR's WebService service compatibility upgrade

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.