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 167473 - [67cat] [j2ee] NetBeans destroys contents of "*ntuser*" files
Summary: [67cat] [j2ee] NetBeans destroys contents of "*ntuser*" files
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Jiri Skrivanek
URL:
Keywords: REGRESSION
: 161524 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-22 15:54 UTC by giorgio42
Modified: 2009-06-25 08:25 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
printuser.jsp after saving, closing and reopening. (15.62 KB, image/png)
2009-06-22 15:55 UTC, giorgio42
Details
prinuser.jsp reduced to 0 bytes after inserting/deleting a blank and saving (9.90 KB, image/png)
2009-06-22 15:55 UTC, giorgio42
Details
What it should look like (after pasting it into the editor window and saving) (22.14 KB, image/png)
2009-06-22 15:59 UTC, giorgio42
Details
sample application (15.89 KB, application/x-compressed)
2009-06-22 18:47 UTC, Jindrich Sedek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description giorgio42 2009-06-22 15:54:00 UTC
[ BUILD # : RC3 ]
[ JDK VERSION : 1.6.* ]


I can reproducible make NetBeans reduce the size of JSP file to 0
bytes.

In a J2EE 1.4 web application being deployed to Tomcat 6.0.18 there
is a jsp file named printusers.jsp. It is very simple:



<%@page contentType="text/html"%>
<%@ page language="java" %>

<%@ page import="java.util.Hashtable" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="com.ti.ffw.Libs.MiscLib.DataList" %>

<%
  DataList dataList = (DataList)request.getAttribute( "selectedUser"
);
  // Skip the column header row.
  Map map = new HashMap( dataList.getRow() );
  out.println
          ( "new Array("
          + "'"  +  map.get( "user_id" ) + "'"
          + ",'" +  map.get( "name" ) + "'"
          + ",'" +  map.get( "role" ) + "'"
          + ",'" +  map.get( "app_name" ) + "'"
          + ",'" +  map.get( "modified_dttm" ) + "'"
          + ")"
          ); 
  
%>


I have checked out this file from CVS with no problems.

When I open this file in NB67RC3 it displays an empty file. And
actually the file suddenly has size 0 on disk.

To restore the file I copied the contents of the file (before
destruction, of course), from simple text editor into the NetBeans
editor window and saved. The jsp parser parses the file correctly
(all syntax errors shown at first go away).

I saved the jsp file and closed it. The IDE log these entries now:
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@1664d9b, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@186a8aa, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@1664d9b, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@186a8aa, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@1664d9b, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@186a8aa, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@1664d9b, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@186a8aa, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@1664d9b, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@186a8aa, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@1664d9b, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c
classLoader =
org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$ParserClassL
oader@186a8aa, parent :
org.netbeans.modules.web.jspparser.JspParserImpl$ExtClassLoader@8e8e43

SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@13a8b1c


When I now open the file, NB shows it as empty (see first
attachment).

Now I entered a blank to make the file show up in the CVS view, and
it does, then I pressed backspace and saved the file. Now it is
exactly 0 bytes in size!
Comment 1 giorgio42 2009-06-22 15:55:08 UTC
Created attachment 83879 [details]
printuser.jsp after saving, closing and reopening.
Comment 2 giorgio42 2009-06-22 15:55:59 UTC
Created attachment 83880 [details]
prinuser.jsp reduced to 0 bytes after inserting/deleting a blank and saving
Comment 3 giorgio42 2009-06-22 15:59:29 UTC
Created attachment 83881 [details]
What it should look like (after pasting it into the editor window and saving)
Comment 4 Jindrich Sedek 2009-06-22 18:47:12 UTC
I'm not able to reproduce the problem on Linux, but it's reproducible on Windows. It seems the problem is not in JSP
content but in file name. I'll attach simple WebApp - it contains few JSP files all of them contains the same code but
opening printusers.jsp shows empty file and all the others are opened correctly. 

While I did no editing and no save of the document - the original file was not overwriten as described in the report,
but while saving the incorrectly opened file in the IDE causes loss of the original one.
Comment 5 Jindrich Sedek 2009-06-22 18:47:40 UTC
Created attachment 83883 [details]
sample application
Comment 6 Petr Jiricka 2009-06-22 23:26:02 UTC
Marek, can you please investigate? Thanks.
Comment 7 Marek Fukala 2009-06-23 08:27:24 UTC
sure, I will.
Comment 8 Marek Fukala 2009-06-23 09:17:51 UTC
reproducible on windows platform, the filename needs to be names printuser.* or contain the name as a substring.
Reproducible on all filetypes (tested html, java) => passing to core.
Comment 9 Jiri Skrivanek 2009-06-23 11:22:07 UTC
This problem affects file containing 'ntuser' in their name. There was a wrong condition while checking for ntuser.dat
files on Windows. It is fixed that it checks ntuser.dat at the beginning of the file name.
core-main #ecd4e5850ff6

Comment 10 Marian Mirilovic 2009-06-23 11:53:16 UTC
jirka, 
this is low risk fix, isn't it ? 

So in case we'll build another FCS build I would like to add this into 6.7 if not, we'll leave that for Patch 1.
Comment 11 Jiri Skrivanek 2009-06-23 12:25:50 UTC
Yes, it is simple fix which should not cause any regression. Let me know if you want me to put it into release67.
Comment 12 giorgio42 2009-06-23 20:49:34 UTC
See also http://www.netbeans.org/issues/show_bug.cgi?id=161524, which has been resolved as invalid.

Comment 13 Quality Engineering 2009-06-24 07:31:34 UTC
Integrated into 'main-golden', will be available in build *200906240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ecd4e5850ff6
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #167473 - More precise check for ntuser.dat files.
Comment 14 Marian Mirilovic 2009-06-24 08:29:57 UTC
*** Issue 161524 has been marked as a duplicate of this issue. ***
Comment 15 Jiri Rechtacek 2009-06-24 09:56:04 UTC
The fix is not risky and solves this problem.
Comment 16 Jindrich Sedek 2009-06-24 10:31:29 UTC
verified in trunk 200906240201
Comment 17 Marian Mirilovic 2009-06-24 11:39:14 UTC
We are going to address this issue in NB 6.7 
Comment 18 Jiri Skrivanek 2009-06-24 11:55:21 UTC
Fix merged to release67.
http://hg.netbeans.org/release67/rev/62da6e5b7962
Comment 19 Jindrich Sedek 2009-06-25 08:25:03 UTC
verified.
NetBeans IDE 6.7 (Build 200906241340)