HI tere,

I have completed a servlet project in Eclipse (3.4).
I also made a war.file by seleting the project name (DBTest in this case) 
and the export command from the Eclipse menu, and export it to the Tomcat 
5.5.26 server in linux using manager.

However when I click on the project name (/DBTest) in the manager webpage, 
it shown the following error:
=================================
HTTP Status 404 - /DBTest/
type Status report
message /DBTest/

description The requested resource (/DBTest/) is not available.
Apache Tomcat/5.5.26
=================================

Here is the jsp file in the tomcat server:
linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls
.  ..  META-INF  WEB-INF  customers.jsp
its content is shown as below:
----------------------------------------
linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # vi customers.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Customers list</title>
</head>
<body>

<jsp:useBean id="customers" type="java.util.ArrayList<domain.Customer>" 
scope="request"/>

<b>Registered Customers:</b><br>
<table border="1">
<tr>
        <th>ID</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Address</th>
<th>Orders</th>
</tr>
<% for(domain.Customer c : customers) { %>
<tr>
        <td><%= c.getId() %></td>
        <td><%= c.getFirstName() %></td>
        <td><%= c.getLastName() %></td>
        <td><%= c.getAddress() %></td>
        <td><a href="/DBTest/ListCustomerOrders?cust_id=<%= 
c.getId() %>">Orders</a></td>
<% } %>

</body>
</html>
--------------------------------------------

If I execute a more specific url 
(http://10.1.9.1:8080/DBTest/customers.jsp) from the web browser (firefox),
it shows different errors:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it 
from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /customers.jsp:11

8: </head>
9: <body>
10: 
11: <jsp:useBean id="customers" type="java.util.ArrayList<domain.Customer>" 
scope="request"/>
12: 
13: <b>Registered Customers:</b><br>
14: <table border="1">


Stacktrace:
    
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
    
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
    
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

javax.servlet.ServletException: bean customers not found within scope
    
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
    
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
    org.apache.jsp.customers_jsp._jspService(customers_jsp.java:97)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.InstantiationException: bean customers not found within scope
    org.apache.jsp.customers_jsp._jspService(customers_jsp.java:55)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache 
Tomcat/5.5.26 logs.


I haven't create any *bean*, but servlet only.
How to get fix problem?

Your help is much appreciated.

Thanks
Sam

Reply via email to