Hi everyone,
Ive been trying to override Mojarra with Myfaces on a Glassfish server. I
managed to do it by:

   - adding a maven dependency:

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>2.1.3</version>
        </dependency>

   - modifying glassfish-web.xml:

<glassfish-web-app error-url="">
  <context-root>/TestApp-1.0-SNAPSHOT</context-root>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java
code.</description>
    </property>
  </jsp-config>
  <class-loader delegate="false"/>
  <property name="useBundledJsf" value="true"/>
</glassfish-web-app>

After these steps the application deployed fine and from server logs i can
tell that MyFaces are indeed used instead of Mojarra. However, the backing
beans are not injected into views. I get the following error on form submit:

org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException:
javax.el.PropertyNotFoundException: Target Unreachable, identifier
'calculatorBean' resolved to null


If I do the backing bean configuration in faces-config.xml instead of just
tossing @Named @RequestScoped on the bean class then the following error
does not occur. So I assume my problem is CDI related. Have I missed
something in the initial setup of my web application to enable CDI?

By the way, here is a full stack trace of the error:

org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException:
javax.el.PropertyNotFoundException: Target Unreachable, identifier
'calculatorBean' resolved to null
        at 
org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getType(ContextAwareTagValueExpression.java:77)
        at 
org.apache.myfaces.shared.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:77)
        at 
org.apache.myfaces.shared.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:411)
        at 
org.apache.myfaces.shared.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:804)
        at 
org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase.getConvertedValue(HtmlTextRendererBase.java:311)
        at javax.faces.component.UIInput.getConvertedValue(UIInput.java:623)
        at javax.faces.component.UIInput.validate(UIInput.java:555)
        at javax.faces.component.UIInput.processValidators(UIInput.java:246)
        at javax.faces.component.UIForm.processValidators(UIForm.java:168)
        at 
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1238)
        at 
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1238)
        at 
javax.faces.component.UIViewRoot._processValidatorsDefault(UIViewRoot.java:1330)
        at javax.faces.component.UIViewRoot.access$500(UIViewRoot.java:75)
        at 
javax.faces.component.UIViewRoot$ProcessValidatorPhaseProcessor.process(UIViewRoot.java:1405)
        at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1286)
        at 
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:763)
        at 
org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:38)
        at 
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
        at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
        at 
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
        at 
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
        at 
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
        at 
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
        at 
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
        at 
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
        at 
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at 
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at 
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at 
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at 
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at 
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at 
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at 
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:680)
Caused by: javax.el.PropertyNotFoundException: Target Unreachable,
identifier 'calculatorBean' resolved to null
        at com.sun.el.parser.AstValue.getTarget(AstValue.java:131)
        at com.sun.el.parser.AstValue.getType(AstValue.java:76)
        at com.sun.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:195)
        at 
org.jboss.weld.el.WeldValueExpression.getType(WeldValueExpression.java:113)
        at 
org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getType(ContextAwareTagValueExpression.java:73)
        ... 44 more


Any help would be appretiated.

Best regards,
Vytautas

Reply via email to