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.
Summary: | NPE in EncodingUtil | ||
---|---|---|---|
Product: | xml | Reporter: | sreimers <sreimers> |
Component: | API | Assignee: | Sonali Kochar <sonali> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | mikhailmatveev, tonybeckham |
Priority: | P1 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Stacktrace of NPE
Project to reproduce with |
Description
sreimers
2007-10-24 09:04:11 UTC
Created attachment 51551 [details]
Stacktrace of NPE
What do you mean under freeform project? Is it JavaApplication project? Also, please specify your platform and IDE version (just copy/paste from Help|About window). As now I can't reproduce it. When you say free form java project, do you mean Java project with existing Ant script? How did you create the XML document? was it DTD constrained or xsd constrained? I created a Java project with existing Ant script, and was able to create a new XML document based on a xsd. If your java project isnt to big, can you attach it to the bug? Also, is there any steps we missed? I try to be a bit more specific. The build in use is NetBeans 6.0 Beta 2 running on JDK 1.6.0_03. The project is a freeform project based on an existing build.xml. I have admit that we are generating the NetBeans project files, so that we can keep them in sync with the changes in our build infrastructure. This worked up to now without any problems, but today I tried to create a XML file (just wellformed), but got the exception. It may be a problem, that our generated nbproject infrastructure is missing the required encoding property, but I think that NetBeans should be able to detect this, not just throwing a NPE if the encoding can not be resolved (as indicated via the NPE I think). I hope this sheds some more light on the problem. If really necessary I think I can come up with an example project to trigger the exception. I agree and I can fix the code to have a default encoding whenever the project encoding cannot be resolved. However, I cannot test my fix unless I have a reproducible case nor can the QA verify the fix. It would really be great if you could attach an example project. If the project is too big, you can email me directly. I tested on latest trunk build with JDK150_12 on Win XP I was able to reproduce it by creating a free form java project and setting the encoding to <No Encoding> *** Issue 120105 has been marked as a duplicate of this issue. *** Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710212201) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) Following these steps I can hit the NPE. Steps: 1) Unzip the attached file 2) In the IDE, select File -> New Project -> Java -> Java project with Existing Ant Script 3) In the Name and Location Panel, for Location , Browse and select <ur_unzipped_file>/lucene-2.2.0 4) The Build script text field should be automatically populated with:<ur_unzipped_file>/lucene-2.2.0/build.xml 5) In the Build and Run Actions panel, go with default values 6) In the Source Package Folders panel, click on Add Folder button of Source Package Folders. Select "src" 7) Make sure you have the right JDK 1.6 in the Source Level: text filed 8) For Encoding, Select <no Encoding> 9) Press finish A project called "core" will be created. Select core and create a new XML document. Create a well formed document. When you click Finsh, you should see the NPE Created attachment 51735 [details]
Project to reproduce with
I'm unable to perform step 7. Only JDK 1.3, JDK 1.4 and JDK 1.5 exist in Source Level combobox. With JDK 1.5 setting, the bug is nor reproducible for me using this scenario. WinXP, Beta2. Sorry, I have been mistaken. I really can't select JDK 1.6 setting, but the bug is _reproducible_ for me with JDK 1.5 setting. WinXP< Beta2, JDK1.6. Fixed Checking in Bundle.properties; /cvs/xml/core/src/org/netbeans/modules/xml/api/Bundle.properties,v <-- Bundle.properties new revision: 1.2; previous revision: 1.1 done Checking in EncodingUtil.java; /cvs/xml/core/src/org/netbeans/modules/xml/api/EncodingUtil.java,v <-- EncodingUtil.java new revision: 1.7; previous revision: 1.6 done Fix verified. Product Version: NetBeans IDE Dev (Build 200710290000) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) |