hadoop在网页客户端的maven配置

时间:2024-06-25 14:36:50

hadoop网页客户端maven配置,只能在tomcat7上运行,tomcat6和tomcat8运行会出错,我用的是tomcat-7.0.67

完整的pom.xml内容为:

<!-- 这个配置只能在tomcat7上运行,tomcat6和tomcat8会报错 -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tansun</groupId>
<artifactId>hadoopClientWeb</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>hadoopClientWeb Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<junit.version>3.8.1</junit.version>
<cdh.hadoop.version>2.6.0</cdh.hadoop.version>
<cdh.hbase.version>1.0.0</cdh.hbase.version>
<elasticsearch.version>1.5.0</elasticsearch.version>
<springmvc.version>4.0.5.RELEASE</springmvc.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- hadoop相关的jar包 -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${cdh.hadoop.version}</version>
<!-- 不加入下面的exclusions会导致这两个依赖包跟tomcat自带的冲突 -->
<exclusions>
<exclusion>
<artifactId>jasper-compiler</artifactId>
<groupId>tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>jasper-runtime</artifactId>
<groupId>tomcat</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>${cdh.hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-api</artifactId>
<version>${cdh.hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-client</artifactId>
<version>${cdh.hadoop.version}</version>
</dependency> <dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<version>${cdh.hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>${cdh.hbase.version}</version>
</dependency> <dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-common</artifactId>
<version>${cdh.hbase.version}</version>
</dependency>
<!-- springMVC的jar包 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springmvc.version}</version>
</dependency> <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springmvc.version}</version>
</dependency> <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springmvc.version}</version>
</dependency>
<!-- jsp编译的jar包 -->
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
<build>
<finalName>hadoopClientWeb</finalName>
</build>
</project>

以上配置在tomcat6上报错:HTTP Status 500 - java.lang.AbstractMethodError:javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationCo

暂时没有解决在tomcat6上运行的问题

以上配置在tomcat8上会报错:HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.main_jsp或者HTTP Status 500 - Unable to compile class for JSP:

暂时也没有解决.

hadoop的依赖包jasper-runtime和jasper-compiler会和tomcat自带的冲突,所以不能不能发布到WEB-INF/lib下面

stand.jar貌似不是必要的

报错:HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

原因:没有导入jstl.jar

报错:HTTP Status 500 - java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;

原因:不明,在tomcat6上出现过,tomcat7,8好像没出现,可能是tomcat6上缺少什么吧