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.
There is missing some file encoding query implementation for some data objects, which represent files like web.xml, persistence.xml, struts.xml, faces-config.xml, ear-jar.xml, application.xml. ...
Should straightforward to fix by using the same FEQ as for regular xml data objects, name XmlFileEncodingQuery from xml/ core. TM => beta2.
Fixed for faces-config.xml (it was blocking another issue), rest will follow. Checking in JSFConfigDataObject.java; /cvs/web/jsf/src/org/netbeans/modules/web/jsf/JSFConfigDataObject.java,v <-- JSFConfigDataObject.java new revision: 1.10; previous revision: 1.9 done
I reverted the previous change. Although the problem with it causing the save action to disabled was solved (thanks Andrei), there is another issue with using XmlFileEncodingQueryImpl: there is an IOException when saving the file since the XmlFEQImpl tries to get the input stream from the file, which results in an exception since the file was already opened for writing by DataEditorSupport. Was a bit difficult to spot this at first since the exception just logged using the global logger at info level (in XmlFEQImpl). Checking in JSFConfigDataObject.java; /cvs/web/jsf/src/org/netbeans/modules/web/jsf/JSFConfigDataObject.java,v <-- JSFConfigDataObject.java new revision: 1.11; previous revision: 1.10 done IDE: [
Adding dependency to issue 117778, currently it is not possible to use XmlFileEncodingQueryImpl.
Fixed for faces-config.xml, struts-config.xml and for all data objects that extend XmlMultiviewDataObject (persistence.xml, ejb-jar.xml, web.xml, application-client.xml, sun-web.xml, sun-ejb-jar.xml). Except for application.xml (there's no encoding option in EAR project) I think all other configuration files in web and j2ee are now covered. In JBoss or Tomcat plugin there are no data object implementations, for Websphere there is but it extends XmlMultiviewDataObject. I will file a separate issue on websvc conf files. Peter W, are there any other XML based data objects in the appserver plugin (that don't extend XmlMultiviewDataObject)? faces-config: http://deadlock.netbeans.org/fisheye/changelog/netbeans/?cs=MAIN:emononen:20071009090720 struts-config: http://deadlock.netbeans.org/fisheye/changelog/~author=emononen/netbeans/?cs=MAIN:emononen:20071009124910 XmlMultiviewDataObject: http://deadlock.netbeans.org/fisheye/changelog/netbeans/?cs=MAIN:emononen:20071009100550
I don't think so, but I'll double check.
I fixed this for websvcs as well since there was just one data object needing this. Peter, I'm reassigning this to you, could you please close the issue once you have confirmed that there are no more data objects needing this? In case there are, fixing them is just a matter of adding an instance of XmlFileEncodingQueryImpl to the cookie set of the data object and then overriding the getLookup method, i.e: getCookieSet().assign(FileEncodingQueryImplementation.class, XmlFileEncodingQueryImpl.singleton()); and then public Lookup getLookup() { return getCookieSet().getLookup(); } Thanks. http://deadlock.netbeans.org/fisheye/changelog/~author=emononen/netbeans/?cs=MAIN:emononen:20071010115600
I will assume this is now fixed completely. If we find any other cases where this needs to be fixed, let's file a separate issue.
Verified Product Version: NetBeans IDE Dev (Build 200811181401) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)