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.
Product Version: NetBeans IDE Dev (Build 200710150000) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb) Running converters and validators tutorial: http://bookshelf.sfbay.sun.com/jets/Rave/Tutorials/NB-Web/kb/60/web/convert-validate.html Steps: 1. Do section: Doing More: Using the Number and Date Time Converters during testing, when you enter $100.00 and press converter. You get error: Dollar Amount:: '$100.00' could not be understood as a currency value. The glassfish log had this excetion (though I'm not sure its relevant): setTcpNoDelay exception java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption at sun.nio.ch.Net.setIntOption0(Native Method) at sun.nio.ch.Net.setIntOption(Net.java:154) at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406) at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38) at sun.nio.ch.SocketOptsImpl$IP$TCP.noDelay(SocketOptsImpl.java:284) at sun.nio.ch.OptionAdaptor.setTcpNoDelay(OptionAdaptor.java:48) at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:268) at com.sun.enterprise.web.connector.grizzly.SelectorThread.setSocketOptions(SelectorThread.java:1880) at com.sun.enterprise.web.connector.grizzly.SelectorThread.handleAccept(SelectorThread.java:1453) at com.sun.enterprise.web.connector.grizzly.SelectorThread.handleConnection(SelectorThread.java:1417) at com.sun.enterprise.web.connector.grizzly.SelectorThread.doSelect(SelectorThread.java:1329) at com.sun.enterprise.web.connector.grizzly.SelectorThread.startListener(SelectorThread.java:1263) at com.sun.enterprise.web.connector.grizzly.SelectorThread.startEndpoint(SelectorThread.java:1226) at com.sun.enterprise.web.connector.grizzly.SelectorThread.run(SelectorThread.java:1202)
One thing I noticed, is that the maxFractionDigits keep resetting to 3, when the tutorial has you change them to 2. My private init looks like: private void _init() throws Exception { numberConverter1.setMinIntegerDigits(1); numberConverter1.setMaxIntegerDigits(40); numberConverter1.setMaxFractionDigits(3); numberConverter1.setType("currency"); numberConverter1.setCurrencyCode("USD"); numberConverter2.setMinIntegerDigits(1); numberConverter2.setMaxIntegerDigits(40); numberConverter2.setMaxFractionDigits(2); numberConverter2.setType("currency"); numberConverter2.setLocale(new java.util.Locale("de", "DE", "")); numberConverter2.setCurrencyCode("EUR"); dateTimeConverter1.setTimeZone(null); dateTimeConverter1.setPattern("EEE, d MMM yyyy HH:mm:ss zzzz"); }
Using the latest trunk bits I am able to reproduce the same. But there is a workaround to this problem. When the numberconverter is dropper, in the customizer dialog, select the currency symbol instead of currency code. After I changed the selection from currency code to currency symbol, the tutorial started working for me. Since there is a workaround I am downgrading the priority to 3. I will look into this more closely and see whats causing the problem in setting the currency code.
I have added a note and workaround to the tutorial.
reopening. This still needs a dev fix, not just a workaround in a tutorial. Also, this should be fixed for fcs, even if it has a workaround.
Yes, this still needs to be fixed. Thanks for reopening Lark.
please fix for fcs (updgraded priority).
The number converter is setting the currency code and symbol correctly in the backing bean. Hence there is no problem during the design-time. The problem exists only during runtime. Investigating more to see if its the component's runtime renderer issue or JSF issue.
This is caused due to a bug fix (http://www.netbeans.org/issues/show_bug.cgi?id=103085) that went in Beta2. I have a fix ready and talking with Po-Ting and Ken about it.
I have fixed this issue and integrated the code and here is the code diff: Directory: /visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/framework/ =========================================================================================== File [changed]: JSFFrameworkProvider.java Url: http://visualweb.netbeans.org/source/browse/visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/framework/JSFFrameworkProvider.java?r1=1.58&r2=1.59 Delta lines: +3 -2 ------------------- --- JSFFrameworkProvider.java 8 Oct 2007 18:50:10 -0000 1.58 +++ JSFFrameworkProvider.java 26 Oct 2007 19:16:09 -0000 1.59 @@ -84,6 +84,7 @@ import org.openide.util.NbBundle; import org.openide.loaders.DataObject; import org.openide.cookies.OpenCookie; +import java.util.Locale; /** * @@ -99,9 +100,9 @@ private static final String FACES_VALIDATE_XML = "com.sun.faces.validateXml"; // NOI18N private static final String FACES_VERIFY_OBJECTS = "com.sun.faces.verifyObjects"; // NOI18N - private static final String DEFAULT_LOCALE = "en"; // NOI18N + private static final String DEFAULT_LOCALE = Locale.getDefault().toString(); // NOI18N private static final String[] SUPPORTED_LOCALES = { - "en", // NOI18N + "de", // NOI18N "ja", // NOI18N "zh_CN", // NOI18N "pt_BR", // NOI18N
Reopening and raising priority. This issue is still reproducible in build: Product Version: NetBeans IDE Dev (Build 200711060000) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Maybe, related: User: potingwu Date: 2007/11/02 13:56:07 Modified: visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/framework/JSFFrameworkProvider.java Log: Should be 'en' instead of 'de' here for supported locale. File Changes: Directory: /visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/framework/ =========================================================================================== File [changed]: JSFFrameworkProvider.java Url: http://visualweb.netbeans.org/source/browse/visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/framework/JSFFrameworkProvider.java?r1=1.59&r2=1.60 Delta lines: +1 -1 ------------------- --- JSFFrameworkProvider.java 26 Oct 2007 19:16:09 -0000 1.59 +++ JSFFrameworkProvider.java 2 Nov 2007 20:56:04 -0000 1.60 @@ -102,7 +102,7 @@ private static final String DEFAULT_LOCALE = Locale.getDefault().toString(); // NOI18N private static final String[] SUPPORTED_LOCALES = { - "de", // NOI18N + "en", // NOI18N "ja", // NOI18N "zh_CN", // NOI18N "pt_BR", // NOI18N
Po-Ting, please remove the code we inject in to the faces-config file. As I mentioned earlier it is asking for trouble. We are doing more harm than helping out people. Let us release note or FAQ on how to add the information about default locale and supported locale.
Winston, please code-review the following diff that disable the locale settings: Index: JSFFrameworkProvider.java =================================================================== RCS file: /cvs/visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/framework/JSFFrameworkProvider.java,v retrieving revision 1.60 diff -u -r1.60 JSFFrameworkProvider.java --- JSFFrameworkProvider.java 2 Nov 2007 20:56:04 -0000 1.60 +++ JSFFrameworkProvider.java 6 Nov 2007 17:54:20 -0000 @@ -541,6 +541,7 @@ } // set locale in faces-config.xml + /* Not ready yet, comment out for issue#118937, Tutorial: Currency converter fails final FileObject facesConfig = FileUtil.toFileObject(fileConfig); if (facesConfig != null) { ProjectManager.mutex().postReadRequest(new Runnable() { @@ -575,6 +576,7 @@ } }); } + */ } }
> Fixes must be integrated into trunk first, the issue in IZ should be marked as fixed, with target milestone set to Dev The fix (committed at around 10:00AM, 11/06/2007) is in the trunk, please verify.
Created attachment 52615 [details] Patch that removes the locale setting in faces-config.xml
Po-ting thanks. You fix looks good to me. I've added gowri to this bug. From development side, she will verify this bug when the next build is available.
Thanks Po-Ting & Winston. I will verify the bug with the next build and let you know.
As a result of fixing this bug, the whole application locale-config section is gone instead of being commented out. This would make things more difficult for the users to know how to set the locale for the application. Ken filed a related bug, issue 103085, to have the locale-config section added but commented out in the faces-config.xml along with other FAQ, RELNOTEs, etc, just like how it was done in the older Creator/VWP. Since we don't have a more desirable solution with a new UI to assist the users to choose the locale for their app, it would be helpful at least to maintain the section as comments in the faces-config.xml. What do you think?
Oh, after talking to Winston, I now recall that Po-TIng also made similar remarks about this as well that it's not possible because we're using NB API to make changes to this faces-config.xml file and the API won't let us add comments. We don't have control over this file anymore as we did in previous releases. :-(.
Yes, currently there is no API for adding comments into faces-config.xml. Release note should be the right place instead. BTW, the following build contains my fix. Could Gowri and QA test and verify it? Thanks! http://deadlock.netbeans.org/hudson/job/trunk/4331/
I have updated the sources and built it locally and the bug is fixed. Thanks po-ting.
I am still seeing this with today's 200711070000 installer build. Pulling a CB now.
Lark, trunk or branch?. The fix is integrated in to trunk but not yet in to NB 6.0 branch
Fix Verified using zizala trunk cb, javaee.zip http://zizala-z1.czech.sun.com:8080/hudson/job/NB6.0CB/6391/artifact/Repo/dist/zip/ Will not mark verified until the fix is in NB6.
Po-Ting, can put back the fix in the branch so that Lark can verify -- Thanks
I still need to wait for one more hour for committing! (there is 24 hours waiting requirement after sending request to reviewers@netbeans.org).
Next build (6393) will be ready soon for testing: (build not finished yet) http://zizala-z1.czech.sun.com:8080/hudson/job/NB6.0CB/6393/artifact/Repo/dist/zip/
Build 6393 is just finished. Please use it for testing. It started exactly the same time I did the commit (??:52). If you don't find the fix there, then please retry build 6394. Thanks!