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 41375 - Upgraded web module is in an anomalous state
Summary: Upgraded web module is in an anomalous state
Status: RESOLVED WORKSFORME
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Sherold Dev
URL:
Keywords: RELNOTE
Depends on:
Blocks:
 
Reported: 2004-03-25 17:41 UTC by Ana.von Klopp
Modified: 2004-08-20 14:10 UTC (History)
3 users (show)

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 Ana.von Klopp 2004-03-25 17:41:44 UTC
To reproduce: 

1) Mount a web module that was developed in NB 3.5 
in 3.6

2) Execute the web module in the IDE. 

3) Modify the deployment descriptor to Servlet 2.4 
by changing the document declaration, ensuring 
that the resulting deployment descriptor is valid 
(i.e. rewrite any taglib element). 

4) Add a tag file consisting of template text and 
tags from e.g. JSTL core. Use the tag in one of 
the JSPs. 

5) Execute the JSP. You may not see any/all of the 
template texts, though the tags work. 

This appears to be a problem with the Tomcat 
server not cleaing out the work directories 
properly. You can fix it by exiting the IDE, and 
deleting the "work" directory (which is under 
"jakarta..." in the .nbuser/nb3.6 directory). 

I tried to delete the work directory while I had 
the IDE running - it didn't work for me, but then 
I had unhidden the file system and tried to delete 
it from the UI. 

This should be filed with Tomcat.
Comment 1 Chris Kutler 2004-03-26 15:22:24 UTC
I will include this information in a Migration Guide and submit an
entry for the release notes.
Comment 2 Jan Chalupa 2004-03-31 20:14:53 UTC
Waiver approved.
Comment 3 Patrick Keegan 2004-04-01 17:34:49 UTC
Chris, I'm assuming this is one of the ones you'd said you'd write a
relnote for?
Comment 4 Chris Kutler 2004-04-02 15:47:01 UTC
Suggested relnote text:

Tomcat Bug Requires Workaround When Upgrading Deployment Descriptor
(web.xml) to 2.4

Before you replace the 2.3 DTD declaration with the 2.4 DTD
declaration in the web.xml file, you must perform the following steps.
These steps are necessary because the Tomcat server is not clearing
out old work files adequately, and gets into a state where it will not
output template text.

To upgrade a 2.3 web module to 2.4:

1. Locate the base directory. This directory is typically in your
NetBeans user directory. You can find the path to this directory by
opening the Runtime window, expanding Server Registry, expanding
Tomcat 5 Servers, right-clicking the server instance and choosing
Properties from the contextual menu. The Base Directory property shows
the path to the base directory.

2. Exit the IDE.

3. Find and delete the web module's work directory under
<base-directory>\work\Catalina\localhost.

4. Restart the IDE and upgrade the web.xml file by replacing the 2.3
DTD declaration with the 2.4 declaration. Do not deploy or execute the
web module until after you save the change.
Comment 5 Patrick Keegan 2004-04-05 15:28:57 UTC
Chris, what will happen if the user doesn't perform the workaround? 
Comment 6 Ana.von Klopp 2004-04-05 17:07:40 UTC
It's hard to be specific about this, because we haven't had time to 
test it extensively. One of the things I noticed was that template 
text in tag files was ignored, but I wouldn't want to say it in so 
many words. Perhaps you can say that "some resources, especially tag 
files, may not execute properly". 

Ana
Comment 7 Ana.von Klopp 2004-04-05 17:09:47 UTC
It's not necessary to exit the IDE and remove the work directory 
*unless* you have executed the application with the 2.3 deployment 
descriptor. 

But it's possible that the code completion does not work properly (?), 
so you may need to exit the IDE for that reason. This is just 
speculation that this was the reason I saw why custom tags weren't 
completely when I first upgraded the module. 
Comment 8 Chris Kutler 2004-04-05 17:18:08 UTC
Updated text

Suggested relnote text:

Tomcat Bug Requires Workaround When Upgrading Deployment Descriptor
(web.xml) to 2.4

Before you replace the 2.3 DTD declaration with the 2.4 DTD
declaration in the web.xml file, you must perform the following steps.
These steps are necessary because the Tomcat server is not clearing
out old work files adequately, and some resources, especially tag 
files, may not execute properly. Note that you do not need to do this
workaround if you have never executed the 2.3 version.

To upgrade a 2.3 web module to 2.4:

1. Locate the base directory. This directory is typically in your
NetBeans user directory. You can find the path to this directory by
opening the Runtime window, expanding Server Registry, expanding
Tomcat 5 Servers, right-clicking the server instance and choosing
Properties from the contextual menu. The Base Directory property shows
the path to the base directory.

2. Exit the IDE.

3. Find and delete the web module's work directory under
<base-directory>\work\Catalina\localhost.

4. Restart the IDE and upgrade the web.xml file by replacing the 2.3
DTD declaration with the 2.4 declaration. Do not deploy or execute the
web module until after you save the change.
Comment 9 Ana.von Klopp 2004-04-05 17:28:10 UTC
They should do step 4 *before* they exit the IDE to be absolutely 
sure. It's safer that way, in case the parser remembers anything from 
the DD. 
Comment 10 Chris Kutler 2004-04-06 23:11:08 UTC
Another Attempt Based on Email Feedback:

Description: When you upgrade your applications deployment descriptor
(web.xml) from version 2.3 to 2.4, the Tomcat server might not clear
out old work files adequately, and some resources, especially tag
files, might not execute properly.

Workaround: After you replace the 2.3 DTD declaration with the 2.4 DTD
declaration in the web.xml file, you must perform the steps below
before you deploy or execute the application.

1. Locate the base directory. This directory is typically in your
NetBeans user directory. You can find the path to this directory by
opening the Runtime window, expanding Server Registry, expanding
Tomcat 5 Servers, right-clicking the server instance and choosing
Properties from the contextual menu. The Base Directory property shows
the path to the base directory.

2. Exit the IDE.

3. Find and delete the web module's work directory under
<base-directory>\work\Catalina\localhost.

4. Restart the IDE.
Comment 11 Pavel Buzek 2004-07-02 13:31:18 UTC
Ana, can you summarize what exactly you expect to see fixed in
netbeans? How could netbeans best (or at least adequately) help to
solve this tomcat issue?
Have you filed the issue against tomcat?
Comment 12 Sherold Dev 2004-08-20 14:10:24 UTC
I have tested the described scenario and it seems to work.