• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to access a JSP Page-Urgent

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to access the JSP page from the browser which is under
CATALINA_HOME\webapps\IS_Project\jsp\welcome.jsp
through the
http://localhost:8080/IS_Project/jsp/welcome.jsp url , I am getting the following 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: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Compiling 1 source file
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:313)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Do I need to configure anything before I access a JSP page?
My Tomcat version is 4.1.12.
Archana
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Archana
The "Unable to compile class for JSP" included in your error output surely suggests that there is something out of place in your JSP file?
Can you post your code?
 
Archana Annamaneni
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark Thank you for the reply.
The file is just basic html code
<html>
<body>
Welcome Home
</body>
</html>
I really appreciate any help.
Archana
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, strange. Works ok for me with Tomcat 4.0.4.
Have you looked at the generated servlet code? You are likely to find it under:
"CATALINA_HOME\work\Standalone\localhost\IS_Project\jsp\welcome$jsp.java"
Might provide some more clues...
 
Archana Annamaneni
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark this is the code I have in the work directory.
I am just not undertsanding where it is going wrong.
Does anybody had this problem before with 4.1.12.

package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class welcome_jsp extends HttpJspBase {

private static java.util.Vector _jspx_includes;
public java.util.List getIncludes() {
return _jspx_includes;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
javax.servlet.jsp.PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;

try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("<html>\r\n");
out.write("<body>\r\nWelcome Home\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you configured the Tomcat environment variables correctly?
CATALINA_HOME = <tomcat installation directory>
CLASSPATH = <tomcat installation directory>\common\lib\servlet.jar
JAVA_HOME = <java sdk installation directory>
[ March 09, 2003: Message edited by: mark howard ]
 
Archana Annamaneni
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Mark I configured all the variables correctly.
May be I think I need to dig into this.
Right now I am really clue less.
Archana
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what version of the jdk are you using? It should be 1.3.1 or above.
 
Archana Annamaneni
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using SDk 1.4.1.
Archana
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if it is good to post in the same thread as the problem is similar...
I am trying to get my hello world program in JSP. I have started my tomcat and cannot get my JSP to show up. I have checked the path to be right.
The error that is displayed on the command window is
"
x.html + null) Connection aborted by peer: socket write error
2003-03-10 15:13:44 - Ctx( ): 404 R( + /myapps/welcome.jsp + null) JSP file no
t found
2003-03-10 15:37:53 - Ctx( ): 404 R( + /myapps/welcome.jsp + null) JSP file no
t found
2003-03-10 15:42:21 - Ctx( ): 404 R( + /myapps/welcome.jsp + null) JSP file no
t found
2003-03-10 15:42:30 - Ctx( ): 404 R( + /myapps/welcome.html + null) null
2003-03-10 15:42:56 - Ctx( ): 404 R( + /myapps/welcome.html + null) null"
Help??
[ March 10, 2003: Message edited by: Sanka Bhatraju ]
 
Archana Annamaneni
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Mark , Mike I got it.
I need to have WEB-INF folder under my jsp files with an web.xml , I did create WEB-INF and web.mxl for servlets but not for JSP.After a long google search I found a good article which explained everything step by step and everything started working.
Thanks for all help.
Archana
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Archana,
Could you give me the link of that article you found on google...I would be grateful to you.
Thanks.
Meena
 
Archana Annamaneni
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is the link for that article
http://www.sitepoint.com/article/305/1
Archana
 
Meena J
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Archana,
Thanks, I got the link, it's really a good link. Thank you once again.
Bye
Meena
 
I am displeased. You are no longer allowed to read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic