Spring Boot Integrated HBase

Source: Internet
Author: User
Tags log4j

Spring Boot integrated hbase will start an error

The main reason is that the Web container is embedded in spring boot to facilitate microservices development and deployment of applications. So it is intended to develop and publish HBase's business applications as a single service, and other related subsystems are accessed through restful APIs.

Things to note when building a project environment:

Because spring boot embeds the Web container, the framework imports dependencies by default: Tomcat-embed-core-8.5.5.jar, Tomcat-embed-el-8.5.5.jar, and so on. The jar of HBase contains: Servlet-api-2.5.jar, Servlet-api-2.5-6.1.14.jar. When you add a dependent dependency on HBase, the application starts to report an exception and the boot does not start. When setting up the project environment, record not to import the two jar packages of Servlet-api-2.5.jar, Servlet-api-2.5-6.1.14.jar.

You may also encounter: HBase java.io.IOException:No FileSystem for Scheme:hdfs errors

To resolve this error, add hadoo-client to Pom.xml, and also remove Servlet-api, refer to Pom.xml

<dependency> <groupId>org.apache.hbase</groupId> <artifactid>hbase-client&lt ;/artifactid> <version> corresponding version number </version> <exclusions> <exclusio N> <groupId>org.slf4j</groupId> <artifactid>slf4j-log4j12</a rtifactid> </exclusion> <exclusion> &LT;GROUPID&GT;LOG4J&L                T;/groupid> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>javax.servlet</groupId> <artifactid&gt ;servlet-api</artifactid> </exclusion> </exclusions> </dependency&gt        ; <dependency> <groupId>org.apache.hadoop</groupId> <artifactid>hadoop-client& lt;/artifactid&Gt <version> corresponding version number </version> <exclusions> <exclusion> &lt                ;groupid>org.slf4j</groupid> <artifactId>slf4j-log4j12</artifactId>                    </exclusion> <exclusion> <groupId>log4j</groupId>                    <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>javax.servlet</groupId> <artifactid>servlet-api</artifactid&                Gt </exclusion> </exclusions> </dependency>

Original link: http://blog.csdn.net/veechange/article/details/52955599

Spring Boot Integrated HBase

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.