JSP return Jasper Exceptions on my friend's pc's when it works on mine

53 Views Asked by At

At beginning, here is our's jsp code:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*" %>
<%@ page import="test.*" %>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>menu główne</title>

    <meta name="viewport" content="initial-scale=1, maximum-scale=1">


    <meta name="android-mobile-web-app-capable" content="yes">
    <meta name="android-mobile-web-app-status-bar-style" content="black">

   <link href="css/ratchet.css" rel="stylesheet">
    <link href="css/ratchet-theme-android.css" rel="stylesheet">


    <script src="js/ratchet.js"></script>

  </head>
  <body>
  <!-- <header class="bar bar-nav">
  <a class="icon icon-left-nav pull-left" href="wyszukaj.html"></a>
  <h1 class="title">Wybierz obiekt</h1>
</header> -->

<div id="content">
   <%
List<Obiekt> list = new ListaObiektow().getObiekty();
%>
<select name="obiekt">
        <option selected value="default">Wybierz Obiekt</option>
        <%
            for (Obiekt obiekt : list) {
        %>
        <option value="<%=obiekt.idObiekt %>"><%=obiekt.nazwa %> <%=obiekt.adres %></option>
        <%
            }
        %>
</select>     
<br>
<br>
<% List<Termin> lista = new ListaTerminow().getTerminy(); %>
<table>
    <%for (Termin termin : lista) {%>
    <tr>
    <td><%=termin.nazwaObiektu %> <%=termin.adresObiektu %> </td>
    <td><%=termin.dzien %> </td>
    <td><%=termin.odKtorej %> </td>
    <td><%=termin.doKtorej %> </td>
    </tr>
    <% } %>
</table>
</div>
<button class="btn btn-block">Dalej<span class="icon icon-right"></span></button>

  </body>
</html>

When my friend's are trying to run project on Apache Tomcat 8 server, it returns Http Status 500, Jesper Exception.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 48 in the jsp file: /pilkaNozna.jsp

Termin cannot be resolved to a type

I've been trying to fix their problems for about 6 hours. Any solution doesnt work for them. I need to say that we have the same configurated Eclipse/Tomcat databases etc.

1

There are 1 best solutions below

0
On

As per the logs it cant file the .class file Termin.java and your line number also says its this line of code 48.

 <% List<Termin> lista = new ListaTerminow().getTerminy(); %> 

Can you see if the war file has complied classes? Also would suggest you to import the file explicitly in import tags.

How are you building war file and deploying it? I am sure your tomcat does not have compiled class.