Created 02-11-2016 07:45 AM
Hi,
I'm just trying to connect my JSP program to retrieve data from hive database.
So my jsp code for that is as follows,
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="java.io.*,java.util.*,java.sql.*"%> <%@ HTTP Status 500 - The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application page import="javax.servlet.http.*,javax.servlet.*" %> <%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="sql" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>SELECT OPERATION</title> </head> <body> <sql:setDataSource var="snapshot" driver="org.apache.hive.jdbc.HiveDriver" url="jdbc:hive2://localhost:10000/default" user="root" password="hadoop"/> <sql:query dataSource="${snapshot}" var="result">SELECT * from test;</sql:query> <table border="1" width="100%"> <tr> <th>S.No</th> <th>Name</th> </tr> <c:forEach var="row" items="${result.rows}"> <tr> <td> <c:out value="${row.sno}"/> </td> <td> <c:out value="${row.name}"/> </td> </tr> </c:forEach> </table> </body></html>
web.xml:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> </web-app>
POM.xml :
<?xml version="1.0" encoding="UTF-8"?> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency>
I have created a test table in hive database with the following schema (sno int,name String);
Server -Tomcat v7
The error which am getting is given below. Please provide me a solution to connect with hive server 2 using JSP
The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
Created 02-11-2016 09:57 AM
That does not sound like an Hive error at all but some library dependencies you have missing.
Created 02-11-2016 09:57 AM
That does not sound like an Hive error at all but some library dependencies you have missing.
Created 02-15-2016 05:45 AM
Yes, i have added libraries in both WEB-INF/lib and in WEB-INF/classes and now I can able to access my hive tables in JSP pages.
Created 02-15-2016 12:04 PM
@priya dharshini if Benjamin's answer help, please accept it.