You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mike La Budde <mi...@irista.com> on 2000/11/29 20:29:58 UTC

JspC HOW-TO? (Was precompilations)

OK, I'm stumped! How do I use JspC to precompile a specific (or all of the) 
.jsp file(s)?

I've tried the following:

jspc -uriroot c:\sfwr\tomcat\webapps\examples 
-webapp  c:\sfwr\tomcat\webapps\examples 
c:\sfwr\tomcat\webapps\examples\jsp\num\numguess.jsp

and various other tries w/out success....

TIA,

Mike


At 11/28/2000 06:50 PM -0800, you wrote:
>On Thu, Nov 23, 2000 at 06:34:01AM -0600, Michael H. La Budde wrote:
> > At 11/23/2000 09:29 AM +0100, you wrote:
> > >Is Possible the tomcat precompile the pages?
> > >there is any precompilation mode?
> > >there is anything to precompile?
> >
> > Here are two possibilities for precompiling all your jsp pages so that
> > users won't have to incur that overhead:
> >
> > 1) Take a look at conf/test-tomcat.xml in your tomcat distribution. 
> This is
> > an ant build file which is used to exercize the test context. You 
> should be
> > able to easily clone this to execute your own...
> >
> > 2) Download Apache JMeter and put together the necessary test scenarios to
> > run your app (thus, once again, precompiling your pages).
>
>Hi,
>
>         I have observed the following under Tomcat 3.2b8/Sun JDK 
> 1.2.2_06, with
>our application under simulated load of 50 users registering:
>
>         Unless the registration .jsp's are already compiled into classes (by
>manually going through a registration first), Tomcat starts giving 500
>errors about a minute or two into the run.
>
>         If we go through a registration manually first, and then start the
>load test, it runs just fine.
>
>         I've figured out how to use "tomcat.sh jspc" to populate the
>context's work directory with .java files, but I can't just turn on
>Tomcat and let ant or JMeter PLUS the user load kill the server; and
>I don't understand the naming scheme algorithm used to generate the
>*.class files in the work directory.
>
>         Any suggestions?
>
>Thanks,
>Aleksey
>
>P.S. BTW, Tomcat 3.2b8 FAR FAR outperforms Tomcat 3.1, in terms
>of stability under load.  Fantastic!  Kudos to the developers.

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - */
  Michael H. La Budde                    email:  mike.labudde@irista.com
  Prosoft, Inc.                                  phone:  414-860-6509
  mike@prosoft-inc.com           fax:    414-860-7014
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - */


Re: JspC HOW-TO? (Was precompilations)

Posted by "Ramesh Kumar . T" <ra...@india.adventnet.com>.
Aleksey Tsalolikhin wrote:

> On Wed, Nov 29, 2000 at 01:29:58PM -0600, Mike La Budde wrote:
> > OK, I'm stumped! How do I use JspC to precompile a specific (or all of the)
> > .jsp file(s)?
> >
> > I've tried the following:
> >
> > jspc -uriroot c:\sfwr\tomcat\webapps\examples
> > -webapp  c:\sfwr\tomcat\webapps\examples
> > c:\sfwr\tomcat\webapps\examples\jsp\num\numguess.jsp
> >
> > and various other tries w/out success....
> >
> > TIA,
> >
> > Mike
>
> Dear Mike,
>
>         It might help if you post what kind of error you are getting,
> or what happens when you try.
>
> For me,
>
> tomcat.sh jspc -v -d /usr/local/tomcat/work/localhost_8080%2Fcontextname -webapp /usr/local/tomcat/webapps/myapp
>
> works, it converts my *.jsp files to *.java files (which I
> understand now contain the servlet source code).
>
>         What I'm looking for is a tool to convert the servlet
> source code to servlet classes, using the unique-class-name generation
> algorithm described in
> http://archives2.real-time.com/pipermail/tomcat-users/2000-August/008481.html
> so Tomcat doesn't have to do this work itself when it starts.
>

You do not have to search for any tool.
you can compile the java files using "javac"
and give a mapping in the web.xml for each contexts
ex:
say the file name is test.jsp then an entry like this in web.xml
<web-app>
   <servlet>
                <servlet-name>jsp.test</servlet-name>
                <servlet-class>jsp.test</servlet-class>
        </servlet>
         <servlet-mapping>
                <url-pattern>/jsp/test</url-pattern>
                <servlet-name>jsp.test</servlet-name>
        </servlet-mapping>
</web-app>

This is automatically done if you use -webinf -webxml options in Jspc.sh/bat files

so all you hae to do is just  run jspc.sh/bat with the -webinf -webxml options



>
>         Is there such a tool?  Or has anybody else run into Tomcat going into
> 500 server errors while trying to compile JSP pages under heavy load,

>
> and if so, how did you deal with it, please?
>
> Yours Sincerely,
> Aleksey Tsalolikhin



Re: JspC HOW-TO? (Was precompilations)

Posted by Aleksey Tsalolikhin <at...@earthlink.net>.
On Wed, Nov 29, 2000 at 01:29:58PM -0600, Mike La Budde wrote:
> OK, I'm stumped! How do I use JspC to precompile a specific (or all of the) 
> .jsp file(s)?
> 
> I've tried the following:
> 
> jspc -uriroot c:\sfwr\tomcat\webapps\examples 
> -webapp  c:\sfwr\tomcat\webapps\examples 
> c:\sfwr\tomcat\webapps\examples\jsp\num\numguess.jsp
> 
> and various other tries w/out success....
> 
> TIA,
> 
> Mike


Dear Mike,

	It might help if you post what kind of error you are getting,
or what happens when you try.

For me,

tomcat.sh jspc -v -d /usr/local/tomcat/work/localhost_8080%2Fcontextname -webapp /usr/local/tomcat/webapps/myapp

works, it converts my *.jsp files to *.java files (which I
understand now contain the servlet source code).

	What I'm looking for is a tool to convert the servlet
source code to servlet classes, using the unique-class-name generation
algorithm described in
http://archives2.real-time.com/pipermail/tomcat-users/2000-August/008481.html
so Tomcat doesn't have to do this work itself when it starts.

	Is there such a tool?  Or has anybody else run into Tomcat going into
500 server errors while trying to compile JSP pages under heavy load,
and if so, how did you deal with it, please?

Yours Sincerely,
Aleksey Tsalolikhin