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.
[ 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!
Created attachment 83879 [details] printuser.jsp after saving, closing and reopening.
Created attachment 83880 [details] prinuser.jsp reduced to 0 bytes after inserting/deleting a blank and saving
Created attachment 83881 [details] What it should look like (after pasting it into the editor window and saving)
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.
Created attachment 83883 [details] sample application
Marek, can you please investigate? Thanks.
sure, I will.
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.
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
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.
Yes, it is simple fix which should not cause any regression. Let me know if you want me to put it into release67.
See also http://www.netbeans.org/issues/show_bug.cgi?id=161524, which has been resolved as invalid.
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.
*** Issue 161524 has been marked as a duplicate of this issue. ***
The fix is not risky and solves this problem.
verified in trunk 200906240201
We are going to address this issue in NB 6.7
Fix merged to release67. http://hg.netbeans.org/release67/rev/62da6e5b7962
verified. NetBeans IDE 6.7 (Build 200906241340)