2 Replies Latest reply on Jan 28, 2007 3:41 PM by Gavin King

    Can't make my themes work

    Paul Pantages Novice

      Hello forum,

      seam 1.1.0.GA
      jboss-4.0.5.GA
      ajax4jsf-1.0.5
      Facelets

      I am trying to add themes to my seam-app & have been
      getting the "Cannot get value for expression
      '#{org.jboss.seam.theme.theme}'" exception, caused by an NPE at
      ThemeSelector:63

      I copied the setup from the 1.1.0.GA blog example.

      I.e., In components.xml I have

       <component name="themeSelector">
       <property name="availableThemes">
       <value>default</value>
       <value>ie_default</value>
       </property>
       <property name="cookieEnabled">true</property>
       </component>
      


      I put the property files in WEB-INF/classes
      In the .war file, the theme files packaged WEB-INF/classes

      eg: WEB-INF/classes/default.properties
      etc...

      These locations match what I see in the blog's war file.

      I am not setting the default theme anywhere; I am assuming that the
      first one in the component list will become default? I reference the
      theme like so on my page:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xml:lang="en"
       lang="en">
      
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
       <title>Login</title>
       <link href="#{theme.css}" rel="stylesheet" type="text/css" />
       </head>
      



      Exception:

      I have javax.el.ELException: /view/home.xhtml: Cannot get value for expression '#{org.jboss.seam.theme.theme}'
       at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53)
       at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:222)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.faces.el.EvaluationException: Exception getting value of property theme of base of type : org.jboss.seam.Namespace
       at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:96)
       at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
       at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
       at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
       at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:51)
       at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1666)
       at org.jboss.seam.Component.getInstance(Component.java:1615)
       at org.jboss.seam.Component.getInstance(Component.java:1592)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:46)
       at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:106)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
       at com.sun.facelets.el.ELText$ELTextVariable.toString(ELText.java:174)
       at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:49)
       ... 41 more
      Caused by: java.lang.NullPointerException
       at org.jboss.seam.theme.ThemeSelector.initDefaultTheme(ThemeSelector.java:63)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1791)
       at org.jboss.seam.Component.callCreateMethod(Component.java:1739)
       at org.jboss.seam.Component.newInstance(Component.java:1728)
       at org.jboss.seam.Component.getInstance(Component.java:1625)
       at org.jboss.seam.Component.getInstance(Component.java:1604)
       at org.jboss.seam.Component.getInstance(Component.java:1581)
       at org.jboss.seam.Component.getInstance(Component.java:1576)
       at org.jboss.seam.theme.ThemeSelector.instance(ThemeSelector.java:142)
       at org.jboss.seam.theme.Theme.init(Theme.java:38)
       at org.jboss.seam.theme.Theme.getTheme(Theme.java:104)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1791)
       at org.jboss.seam.Component.unwrap(Component.java:1817)
       at org.jboss.seam.Component.getInstance(Component.java:1639)
       at org.jboss.seam.Component.getInstance(Component.java:1592)
       at org.jboss.seam.Namespace.get(Namespace.java:42)
       at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:78)
       ... 56 more
      
      


      Am I missing something obvious?

      PdP