Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can I fix this error in my java code? This is the error output: org.apache.jasper.JasperException: An exception occurred processing [listCustomers.jsp] at line [17]14: 15:

How can I fix this error in my java code?

This is the error output:

org.apache.jasper.JasperException: An exception occurred processing [listCustomers.jsp] at line [17]14:     <%@ include file="header.html"%>15:     

List of Participating Companies

16: 17: 18: select * from customer19: order by cus_lname20: Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:607) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Root Cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection"        org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:667)        org.apache.jsp.listCustomers_jsp._jspService(listCustomers_jsp.java:190)        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)        javax.servlet.http.HttpServlet.service(HttpServlet.java:741)        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:458)        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)        javax.servlet.http.HttpServlet.service(HttpServlet.java:741)        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Root Cause

javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection"        org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:285)        org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:168)        org.apache.jsp.listCustomers_jsp._jspx_meth_sql_005fquery_005f0(listCustomers_jsp.java:214)        org.apache.jsp.listCustomers_jsp._jspService(listCustomers_jsp.java:158)        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)        javax.servlet.http.HttpServlet.service(HttpServlet.java:741)        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:458)        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)        javax.servlet.http.HttpServlet.service(HttpServlet.java:741)        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

------------------------------------------------------------------------------------------------------

Here is my Code:

listCustomers.jsp

<%@ page language="java" contentType="text/html;charset=ISO-8859-1"

pageEncoding="ISO-8859-1"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

List of Participating Companies

<%@ include file="header.html"%>

List of Participating Companies

select * from customer

order by cus_lname

First NameLast NameEmailPhone Number
${customer.cus_fname}${customer.cus_lname}${customer.cus_email}${customer.cus_phone}

----------------------------------------------------------------------------------------------------------------------

DataBaseListener.java

<%@ page language="java" contentType="text/html;charset=ISO-8859-1"

pageEncoding="ISO-8859-1"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

List of Participating Companies

<%@ include file="header.html"%>

List of Participating Companies

select * from customer

order by cus_lname

First NameLast NameEmailPhone Number
${customer.cus_fname}${customer.cus_lname}${customer.cus_email}${customer.cus_phone}

Step by Step Solution

3.40 Rating (153 Votes )

There are 3 Steps involved in it

Step: 1

ANSWER The error message you provided indicates that there is a problem with establishing a database connection in your Java code Specifically the err... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

How can I get my wife pregnant if I am impotent?

Answered: 1 week ago

Question

In the network shown find Io using PSPICE 12V Io

Answered: 1 week ago

Question

4. Review periodically.

Answered: 1 week ago

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago