You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Elijah Roberts <er...@alexandriasc.com> on 2000/04/13 17:05:29 UTC

JSP problem with Tomcat Solaris

I apologize if this is an inappropriate place to post this message. I 
posted it to the user list yesterday, but there were no responses. I'm 
concerned that it might be a bug in Tomcat RC1,as I don't think that 
there's anything I should be able to do that would cause Tomcat to behave 
this way. Also I forgot to mention that it happens also just using Tomcat 
without Apache, on port 8080. If anyone has any suggestions as to how I 
might go about finding the problem, please let me know.
--------------
I'm having a strange problem on Solaris using jdk1.2.2_05 and Apache 1.3.12 
since I upgraded to Tomcat RC1. JSP pages never return to the browser. It 
seems that when Tomcat parses a JSP file it gets stuck in a continuous loop 
while writing the .java file to be compiled. These files grow very large 
very quickly. For example here is a JSP page I created:

<%
         for (int i=0; i<10; i++)
         {
                 out.println("test1");
         }
%>
<html>
<head>
<p>test</p>
</body>
</html>
<%
         for (int i=0; i<10; i++)
         {
                 out.println("test2");
         }
%>

and here is the output in the .java file, until I stopped Tomcat:

<snip import statements>
public class _0002ftest_0002ejsptest_jsp_0 extends HttpJspBase {


     static {
     }
     public _0002ftest_0002ejsptest_jsp_0( ) {
     }

     private static boolean _jspx_inited = false;

     public final void _jspx_init() throws JasperException {
     }

     public void _jspService(HttpServletRequest request, 
HttpServletResponse  response)
         throws IOException, ServletException {

         JspFactory _jspxFactory = null;
         PageContext pageContext = null;
         HttpSession session = null;
         ServletContext application = null;
         ServletConfig config = null;
         JspWriter out = null;
         Object page = this;
         String  _value = null;
         try {

             if (_jspx_inited == false) {
                 _jspx_init();
                 _jspx_inited = true;
             }
             _jspxFactory = JspFactory.getDefaultFactory();
             response.setContentType("text/html;charset=8859_1");
             pageContext = _jspxFactory.getPageContext(this, request, response,
                         "", true, 8192, true);

             application = pageContext.getServletContext();
             config = pageContext.getServletConfig();
             session = pageContext.getSession();
             out = pageContext.getOut();

             // begin [file="/test.jsp";from=(0,2);to=(5,0)]

                         for (int i=0; i<10; i++)
                         {
                                 out.println("test1");
                         }
             // end
             // HTML // begin [file="/test.jsp";from=(5,2);to=(11,0)]
                 out.write("\r\n<html>\r\n<head>\r\n<p>test</p>\r\n</body>\r\n</html>\r\n");
out.write("\r\n<html>\r\n<head>\r\n<p>test</p>\r\n</body>\r\n</html>\r\n");
out.write("\r\n<html>\r\n<head>\r\n<p>test</p>\r\n</body>\r\n</html>\r\n");
out.write("\r\n<html>\r\n<head>\r\n<p>test</p>\r\n</body>\r\n</html>\r\n");
out.write("\r\n<html>\r\n<head>\r\n<p>test</p>\r\n</body>\r\n</html>\r\n");
<snip infinite repetition of last line.>

It never ends and the second scriptlet never gets written out. I am also 
using Tomcat RC1 on a windows box with JDK1.3RC1 with no problems. 
Yesterday my Solaris worked with Tomcat Beta1. To upgrade from beta to rc1 
I just copied the new /lib/*.jar file from the binary archive. Were there 
changes to the conf files that would cause this that I need to update? Any 
ideas?


Elijah Roberts
Java Consultant
eroberts@alexandriasc.com
606-816-1186