problem in tomcat

Reply

Join Date: Jul 2007
Posts: 11
Reputation: muskan is an unknown quantity at this point 
Solved Threads: 0
muskan muskan is offline Offline
Newbie Poster

problem in tomcat

 
0
  #1
Jul 30th, 2007
i am using Apache Tomcat Version 5.0.28 but it is not working well i have just typed a simple code and it is giving error .i am providing error and also code please giude me where is the problem , i am new to jsp please help me thanx.
.jsp file contains following code:
/code

<%@ page language="java" %>
<% String s1="",s2="";

s1=request.getParameter("T1");

s2=request.getParameter("T2");

%>

<%= s1 %>
<%= s2 %>
/code

and .html file contains
/code
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%">
<form method="POST" action="ja.jsp">
<!--webbot bot="SaveResults" U-File="file:///D:/Documents and Settings/WAQAR/My Documents/My Webs/_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><p>&nbsp;</p>
<p>username</p>

<p>&nbsp;</td>
<td width="50%"><input type="text" name="T1" size="20"></td>
</tr>
<tr>
<td width="50%">password</td>
<td width="50%"><input type="password" name="T2" size="20"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>

</body>
</form>

</html>

/code

and the following error is displayed by tomcat when i used to run it plz help me.

org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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


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

Apache Tomcat/5.0.28
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 686
Reputation: sillyboy is on a distinguished road 
Solved Threads: 62
sillyboy's Avatar
sillyboy sillyboy is offline Offline
Practically a Master Poster

Re: problem in tomcat

 
0
  #2
Jul 30th, 2007
Do you have java installed? If so check your path variables.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 11
Reputation: muskan is an unknown quantity at this point 
Solved Threads: 0
muskan muskan is offline Offline
Newbie Poster

Re: problem in tomcat

 
0
  #3
Jul 31st, 2007
yes i have installed javabut and it is working properly .now wat can b done. please help me to solve this problem
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 686
Reputation: sillyboy is on a distinguished road 
Solved Threads: 62
sillyboy's Avatar
sillyboy sillyboy is offline Offline
Practically a Master Poster

Re: problem in tomcat

 
0
  #4
Jul 31st, 2007
  1. Unable to find a javac compiler;
  2. Perhaps JAVA_HOME does not point to the JDK

Do you have JDK installed too? Make sure you let tomcat know where your java compiler is located.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,772
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 493
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: problem in tomcat

 
0
  #5
Jul 31st, 2007
This problem occurs when at the time of installation of Tomcat you make it point to JRE instead of JDK. Reinstall Tomcat and when it asks for Java path, provide it the path to your JDK instead of the default JRE which appears there.
I don't accept change; I don't deserve to live.

Sacrifice is a painful, pure and beautiful thing.

Dammit, Jones, What the Hell Are Knoll Pointers?!
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: Piuskutty is an unknown quantity at this point 
Solved Threads: 0
Piuskutty Piuskutty is offline Offline
Newbie Poster

Re: problem in tomcat

 
0
  #6
Sep 6th, 2007
remove this and check again


<!--webbot bot="SaveResults" U-File="file:///D:/Documents and Settings/WAQAR/My Documents/My Webs/_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2
Reputation: SapnaG is an unknown quantity at this point 
Solved Threads: 0
SapnaG SapnaG is offline Offline
Newbie Poster

Re: problem in tomcat

 
0
  #7
Sep 8th, 2007
Hi, You first make sure that all the paths are set correctly. most important all the jar files for Jsp and servlet should be at right place that will make you JSP compiler to work.


Originally Posted by muskan View Post
i am using Apache Tomcat Version 5.0.28 but it is not working well i have just typed a simple code and it is giving error .i am providing error and also code please giude me where is the problem , i am new to jsp please help me thanx.
.jsp file contains following code:
/code

<%@ page language="java" %>
<% String s1="",s2="";

s1=request.getParameter("T1");

s2=request.getParameter("T2");

%>

<%= s1 %>
<%= s2 %>
/code

and .html file contains
/code
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%">
<form method="POST" action="ja.jsp">
<!--webbot bot="SaveResults" U-File="file:///D:/Documents and Settings/WAQAR/My Documents/My Webs/_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><p>&nbsp;</p>
<p>username</p>

<p>&nbsp;</td>
<td width="50%"><input type="text" name="T1" size="20"></td>
</tr>
<tr>
<td width="50%">password</td>
<td width="50%"><input type="password" name="T2" size="20"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>

</body>
</form>

</html>

/code

and the following error is displayed by tomcat when i used to run it plz help me.

org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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


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

Apache Tomcat/5.0.28
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,539
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 524
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: problem in tomcat

 
0
  #8
Sep 8th, 2007
Originally Posted by SapnaG View Post
Hi, You first make sure that all the paths are set correctly. most important all the jar files for Jsp and servlet should be at right place that will make you JSP compiler to work.

I think that answer was already given, don't you???


Originally Posted by ~s.o.s~ View Post
This problem occurs when at the time of installation of Tomcat you make it point to JRE instead of JDK. Reinstall Tomcat and when it asks for Java path, provide it the path to your JDK instead of the default JRE which appears there.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JSP Forum


Views: 2660 | Replies: 7
Thread Tools Search this Thread



Tag cloud for JSP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC