adam bien's blog

Netbeans 6.5: Porting Woodstock To IceFaces. Small Bug, Big Impact, Easy Solution 📎

After smooth installation and setup, I'm in the process of porting an application from Woodstock to Icefaces. During dragging a SelectOneMenu from pallette to the designer a Component Error (red bar) occurred and the designer was closed. Unfortunately the stack trace wasn't really helpful - actually misleading:

java.util.MissingResourceException: Can't find bundle for base name javax.faces.Messages, locale de_DE
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:962)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:163)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:122)
    at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:277)
    at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:357)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
    at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1350)
    at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:1107)
    at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.renderHtml(FacesPageUnit.java:1675)
    at org.netbeans.modules.visualweb.designer.jsf.JsfForm.renderMarkupDesignBean(JsfForm.java:2919)
    at org.netbeans.modules.visualweb.designer.jsf.JsfForm.renderMarkupDesignBean(JsfForm.java:2915)
    at org.netbeans.modules.visualweb.designer.jsf.DomSynchronizer.processInsert(DomSynchronizer.java:1287)
    at org.netbeans.modules.visualweb.designer.jsf.DomSynchronizer.processUpdates(DomSynchronizer.java:798)
    at org.netbeans.modules.visualweb.designer.jsf.DomSynchronizer.run(DomSynchronizer.java:696)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


The problem are wrong expressions (component and value binding), which were generated by the designer. You can easily fix the error changing to the "JSP" view, and replace "/" with "$" in the expressions. Sample:

Wrong:  #{usermgmt/CreateAccount.selectOneMenu1DefaultItems}

Correct #{usermgmt$CreateAccount.selectOneMenu1DefaultItems}

This is a general problem in visual components with nested beans. It seems only to happen, if you change the default package for the generated pages (e.g. in the WAR-project wizard). If you don't change it - everything works perfectly.