At the risk of revealing my ignorance of JSF... (has anyone else tried to convert appfuse JSF project to use JSF 1.2?)

I'm trying to convert a clean appfuse 2.0-M5 basic-jsf project to use the new myfaces 1.2 JSF implementation (I need to integrate with a JSF 1.2 taglib and converting appfuse to 1.2 seems easier (and more useful in the long run to the rest of the appfuse community) than trying to backport the taglib to JSF 1.1).

I've decided to try to use the myfaces 1.2.0-SNAPSHOT (from source - see http://wiki.apache.org/myfaces/MyFaces_1.2) since Appfuse has some dependencies on the myfaces api that I'd just as soon not have to change.

I get mysterious errors in unit tests that may have to do with configuring the mock servlet support, so I'm trying to debug by bypassing them and directly testing interactively with jetty:run-war -Dmaven.test.skip. I get a good login page, and then after logging in, get the following facelets error:

   com.sun.facelets.tag.TagAttributeException: /mainMenu.xhtml @6,61
     <f:loadBundle basename="#{basePage.bundleName}"> Can't find bundle
     for base name , locale en

(full stack trace below).

I don't understand why the bundle is not loaded - the basePage is declared in the (unchanged) faces-config.xml. Note the bundle base name appears to be "" - despite

public static final String jstlBundleParam = "javax.servlet.jsp.jstl.fmt.localizationContext";
...
    public String getBundleName() {
// get name of resource bundle from JSTL settings, JSF makes this too hard
        return getServletContext().getInitParameter(jstlBundleParam);
    }

and this value is initialized in the servlet context:


<context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>ApplicationResources</param-value>
    </context-param>


I'm not sure where to start. As far as I can tell, the BasePage code for loading the resources is never called. Can anyone advise what config files most likely need to be changed from 1.1 to 1.2.

Thanks,
Steve

--------------------------------------
Diffs of my changes so far(mvn appfuse:full-source of jsf-basic 2.0-m5 project):

diff -ru myproject-clean-fullsource/pom.xml myproject/pom.xml
--- myproject-clean-fullsource/pom.xml  2007-05-27 12:04:32.702750000 -0400
+++ myproject/pom.xml   2007-05-27 12:35:24.187125000 -0400
@@ -181,7 +181,7 @@
                     <dependency>
                         <groupId>org.apache.myfaces.core</groupId>
                         <artifactId>myfaces-impl</artifactId>
-                        <version>1.1.5</version>
+                        <version>${myfaces.version}</version>
                     </dependency>
                     <dependency>
                         <groupId>log4j</groupId>
@@ -338,18 +338,18 @@
             <artifactId>commons-dbcp</artifactId>
             <version>${commons.dbcp.version}</version>
         </dependency>
-        <dependency>
+        <!--dependency>
             <groupId>javax.el</groupId>
             <artifactId>el-api</artifactId>
             <version>${el.version}</version>
-        </dependency>
+        </dependency-->
         <dependency>
             <groupId>javax.mail</groupId>
             <artifactId>mail</artifactId>
             <version>${javamail.version}</version>
         </dependency>
         <dependency>
-            <groupId>javax.servlet</groupId>
+            <groupId>javax.servlet.jsp</groupId>
             <artifactId>jsp-api</artifactId>
             <version>${jsp.version}</version>
             <scope>provided</scope>
@@ -807,7 +807,7 @@
         <commons.dbcp.version>1.2.2</commons.dbcp.version>
         <jstl.version>1.1.2</jstl.version>
         <ehcache.version>1.3.0-beta2</ehcache.version>
-        <myfaces.version>1.1.5</myfaces.version>
+        <myfaces.version>1.2.0-SNAPSHOT</myfaces.version>
         <aspectj.version>1.5.3</aspectj.version>
         <facelets.version>1.1.11</facelets.version>
         <sitemesh.version>2.2.1</sitemesh.version>
@@ -815,7 +815,7 @@

         <!-- Testing dependency versions -->
         <jmock.version>1.1.0</jmock.version>
-        <jsp.version>2.0</jsp.version>
+        <jsp.version>2.1</jsp.version>
         <junit.version>3.8.2</junit.version>
         <servlet.version>2.4</servlet.version>
         <wiser.version>1.0.3</wiser.version>
diff -ru myproject-clean-fullsource/src/main/java/org/appfuse/webapp/util/FacesUtils.java myproject/src/main/java/org/appfuse/webapp/util/FacesUtils.java --- myproject-clean-fullsource/src/main/java/org/appfuse/webapp/util/FacesUtils.java 2007-05-27 12:04:17.062125000 -0400 +++ myproject/src/main/java/org/appfuse/webapp/util/FacesUtils.java 2007-05-
27 12:12:48.093375000 -0400
@@ -118,31 +118,32 @@

msg, msg)
);
     }

-    /**
-     * Evaluate the integer value of a JSF expression.
-     *
-     * @param el the JSF expression
-     * @return the integer value associated with the JSF expression
-     */
-    public static Integer evalInt(String el) {
-        if (el == null) {
-            return null;
-        }
-
-        if (UIComponentTag.isValueReference(el)) {
-            Object value = getElValue(el);
-
-            if (value == null) {
-                return null;
-            } else if (value instanceof Integer) {
-                return (Integer) value;
-            } else {
-                return new Integer(value.toString());
-            }
-        } else {
-            return new Integer(el);
-        }
-    }
+// NOT USED(?) and fails to compile with JSF1.2
+//    /**
+//     * Evaluate the integer value of a JSF expression.
+//     *
+//     * @param el the JSF expression
+//     * @return the integer value associated with the JSF expression
+//     */
+//    public static Integer evalInt(String el) {
+//        if (el == null) {
+//            return null;
+//        }
+//
+//        if (UIComponentTag.isValueReference(el)) {
+//            Object value = getElValue(el);
+//
+//            if (value == null) {
+//                return null;
+//            } else if (value instanceof Integer) {
+//                return (Integer) value;
+//            } else {
+//                return new Integer(value.toString());
+//            }
+//        } else {
+//            return new Integer(el);
+//        }
+//    }

     private static Application getApplication() {
         ApplicationFactory appFactory =
--------------------------------------
the full stack trace:

com.sun.facelets.tag.TagAttributeException: /mainMenu.xhtml @6,61 <f:loadBundle basename="#{basePage.bundleName}"> Can't find bundle for base name , locale en at com.sun.facelets.tag.jsf.core.LoadBundleHandler.apply(LoadBundleHandler.java:197) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109) at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95) at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553) at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101) at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:447) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050) at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75) at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.MessageFilter.doFilter(MessageFilter.java:45) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75) at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:179) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:621) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
        at org.mortbay.jetty.Server.handle(Server.java:269)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:678)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) Caused by: java.util.MissingResourceException: Can't find bundle for base name , locale en at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
at com.sun.facelets.tag.jsf.core.LoadBundleHandler.apply(LoadBundleHandler.java:191)
        ... 72 more

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to