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 117333 - FEQ is not working for some configuration files
Summary: FEQ is not working for some configuration files
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on: 117778
Blocks: 115278
  Show dependency tree
 
Reported: 2007-10-01 15:29 UTC by Petr Pisl
Modified: 2008-11-19 14:14 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 Petr Pisl 2007-10-01 15:29:28 UTC
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. ...
Comment 1 Erno Mononen 2007-10-02 09:34:46 UTC
Should straightforward to fix by using the same FEQ as for regular xml data objects, name XmlFileEncodingQuery from xml/
core. TM => beta2.
Comment 2 Erno Mononen 2007-10-02 15:30:50 UTC
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
Comment 3 Erno Mononen 2007-10-03 13:07:29 UTC
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: [
Comment 4 Erno Mononen 2007-10-04 14:07:30 UTC
Adding dependency to issue 117778, currently it is not possible to use XmlFileEncodingQueryImpl.
Comment 5 Erno Mononen 2007-10-09 14:59:24 UTC
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
Comment 6 _ pcw 2007-10-09 20:33:55 UTC
I don't think so, but I'll double check.
Comment 7 Erno Mononen 2007-10-10 13:21:09 UTC
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
Comment 8 Petr Jiricka 2007-10-12 08:23:59 UTC
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. 
Comment 9 martin_zmrhal 2008-11-19 14:14:04 UTC
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)