This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 33678 - Building JSP files takes forever
Summary: Building JSP files takes forever
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Petr Jiricka
URL:
Keywords: PERFORMANCE
Depends on: 34090
Blocks:
  Show dependency tree
 
Reported: 2003-05-16 10:22 UTC by navneet
Modified: 2004-03-16 10:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description navneet 2003-05-16 10:22:51 UTC
We have a web project using struts and tiles with
about 140 jsp pages. When I try to build the
classes(about 285), it builds quickly. But when I
try to run build all on the folder containing the
JSPs ( web folder), it takes forever to find the
objects that it needs to compile. This is on a
P41.7 GHz with 1GB RAM.
Comment 1 Petr Jiricka 2003-05-19 09:27:29 UTC
This is caused by the fact that when the build is run, all 
JSPs are parsed (this is the "finding the objects to 
compile" part). This is done to discover the JavaBeans 
that need to be compiled before the JSPs, and also to 
track information about included pages, which is later 
used by the debugger.

A short-term solution could be not to parse the JSPs, but 
this would cause the problem that when JSPs are compiled, 
not all Java classes will be up to date, thus compilation 
of JSPs could fail even if the application is correct. 
What we could do is to make this configurable and release 
this as a patch after the 3.5 release. Looking at the 
source code, this looks like a straightforward change 
(needs to be tested thoroughly, though).

A long-term solution is to take advantage of the build 
target concept in the new Projects infrastructure. JSP 
compilation could depend on the build target that builds 
all Java sources, thus no parsing would be needed.

I suggest waiving this bug for NB 3.5/Nevada, and fixing 
it in a subsequent patch release (using the short term 
fix), and in NB 4.0 (using the long term fix).

Comment 2 Petr Jiricka 2003-05-19 09:55:56 UTC
Oops, incorrect target milestone.
Comment 3 navneet 2003-05-20 07:41:20 UTC
I would suggest that the fact that teh classes may not be current can
be notified to the user by a console message and/or assume that the
developer will rebuild the sources if he finds errors, etc. 

It is really not right to penalize those developers who build their
classes before building the JSPs. 

Additionally, the build all on JSPs will eb run only to test the
compilation status of the pages since tomcat will compile these pages
anyways when running th application. So parsing it for sources is not
a good idea.

I would suggest that this be fixed for 3.5 with teh workaround
mentioned. The developers can learn that they need to build their java
sources before building the JSPs. 

For me this is a major problem and I amy even go to the extent of
calling it a show stopper coz it forces me to go on coffee breaks
every time i want to verify if all my JSPs compile.
Comment 4 Petr Jiricka 2003-05-20 08:57:40 UTC
Navneet, how long is the time exactly for you ? What 
hardware are you running this on ?

Thanks.
Comment 5 psuk 2003-05-21 08:07:21 UTC
Raw data (while waiting for the answer from the Navneet):

Building an app containing 87 JSPs on a Pentium 4 / 2.2GHz - it
completed in 3:30 minutes. 
Recompilation when all pages are up to date (which should complete
instantly) took 1:30 minutes. 

Using the jspc command line tool, supplied with Tomcat, compilation
takes 50s. 
Comment 6 psuk 2003-05-21 10:46:31 UTC
Waiver approved.

Navneet, Petr will try to figure out the temporary workaround (switch)
and add the patch to this issue. Would you like to test it when available?

It will be the hack with possible side effects, so I'm hesitant to add
it to the release.

Comment 7 navneet 2003-05-22 09:26:31 UTC
Sure i will be interested in testing the patches. 

Let me know.

Maybe yuo can add a setting somewhere saying the JSPs can be compiled
without checking for the class update status. Also mark a warning
there saying this is a test version. And set it off by default for
people who don't want to wade into that teritory.
Comment 8 Petr Jiricka 2003-05-22 12:25:20 UTC
Partial fix implemented in the trunk. Added command line option:

-J-Dnetbeans.jspcompile.shouldparse=false

When this line is specified in the $NB_INST_DIR/bin/ide.cfg file, the
compiled will not parse JSP files before compiling them. This will
speed up the compilation, although it may cause some Java classes
(beans) used by the pages to be out of date when compiling, and thus
cause compilation errors.

The fix will be available in the next daily build of the NetBeans
trunk: 200305230100 (not version 3.5).
Comment 9 _ rkubacki 2003-05-22 12:27:17 UTC
This switch should be documented in arch document I think.
Comment 11 Petr Jiricka 2003-12-18 16:04:45 UTC
The JSP compilation hs been replaced by validation, which fixes this
problem.