You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jo...@gmail.com> on 2011/03/08 00:58:59 UTC

JSF support

Hi All,

I've got a couple of (probably silly) questions about our JSF support, I
wonder if someone can help me out?

- I notice we include myfaces-1.2 api and impl jars in our Tomcat
distribution - are we correct to do this? Shouldn't the application
developer be able to provide their own jars in WEB-INF/lib, say for example
if they wanted to use the com.sun version instead of MyFaces for example? I
can get an application to deploy with this jar config (i.e. putting the ones
I want in WEB-INF/lib), but I have to delete myfaces-* from
webapps/openejb/lib first.

- Anyone tried using JSF2 with OpenEJB/Tomcat? I think I've got everything
setup right, and the app deploys, but I'm running into an error when I
access a page that uses a ManagedBean:

javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException:
/contact/List.xhtml @72,113 action="#{contactController.prepareCreate}":
Target Unreachable, identifier 'contactController' resolved to null
at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:95)
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at
org.apache.openejb.tomcat.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1684)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: javax.el.PropertyNotFoundException: /contact/List.xhtml @72,113
action="#{contactController.prepareCreate}": Target Unreachable, identifier
'contactController' resolved to null
at
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 24 more

I thought maybe my ManagedBean wasn't being deployed correctly. I have an
empty beans.xml in WEB-INF. Is there anyway to check what managed beans have
been deployed?

Any ideas will be greatly appreciated!

Cheers

Jon

Re: JSF support

Posted by Karan Malhi <ka...@gmail.com>.
I think we should ship it with MyFaces 2.0 which is JSF 2.0 compliant..

On Tue, Mar 8, 2011 at 8:14 AM, Jonathan Gallimore <
jonathan.gallimore@gmail.com> wrote:

> Thanks for the info David. Sounds like my app is setup correctly, or is
> pretty close - I'll see if I can dig around further to try and figure out
> what's going on. In terms of being able to swap the bundled JSF
> implementation, maybe we could do some kind of selection on a page under
> http://localhost:8080/openejb perhaps with the choice of MyFaces 1.2,
> MyFaces 2.0 or none? What do you think?
>
> Jon
>
> On Tue, Mar 8, 2011 at 12:37 AM, David Blevins <david.blevins@gmail.com
> >wrote:
>
> >
> > On Mar 7, 2011, at 3:58 PM, Jonathan Gallimore wrote:
> >
> > > Hi All,
> > >
> > > I've got a couple of (probably silly) questions about our JSF support,
> I
> > > wonder if someone can help me out?
> > >
> > > - I notice we include myfaces-1.2 api and impl jars in our Tomcat
> > > distribution - are we correct to do this? Shouldn't the application
> > > developer be able to provide their own jars in WEB-INF/lib, say for
> > example
> > > if they wanted to use the com.sun version instead of MyFaces for
> example?
> > I
> > > can get an application to deploy with this jar config (i.e. putting the
> > ones
> > > I want in WEB-INF/lib), but I have to delete myfaces-* from
> > > webapps/openejb/lib first.
> >
> > If we want TomEE to be certified we need to include an impl that passes
> the
> > TCK.
> >
> > We can certainly be clever with that though, perhaps make it easy to
> > remove.
> >
> > > - Anyone tried using JSF2 with OpenEJB/Tomcat? I think I've got
> > everything
> > > setup right, and the app deploys, but I'm running into an error when I
> > > access a page that uses a ManagedBean:
> > >
> > > javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException:
> > > /contact/List.xhtml @72,113
> action="#{contactController.prepareCreate}":
> > > Target Unreachable, identifier 'contactController' resolved to null
> > > at
> > >
> >
> javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:95)
> > > at
> > [...]
> > >
> > > I thought maybe my ManagedBean wasn't being deployed correctly. I have
> an
> > > empty beans.xml in WEB-INF. Is there anyway to check what managed beans
> > have
> > > been deployed?
> >
> > JSF managed bean support should work without a beans.xml shouldn't it?  I
> > seem to recall they released their spec even before it was decided if CDI
> > would officially be part of the Java EE 6 set of specs.
> >
> > Anyway, I seem to recall Karan has done the most work with JSF (pre 2.0).
> >  I set it up so that the MyFaces binary is physically in the OpenEJB
> webapp,
> > but didn't do anything code wise.
> >
> >
> > -David
> >
> >
>



-- 
Karan Singh Malhi

Re: JSF support

Posted by Jonathan Gallimore <jo...@gmail.com>.
Thanks for the info David. Sounds like my app is setup correctly, or is
pretty close - I'll see if I can dig around further to try and figure out
what's going on. In terms of being able to swap the bundled JSF
implementation, maybe we could do some kind of selection on a page under
http://localhost:8080/openejb perhaps with the choice of MyFaces 1.2,
MyFaces 2.0 or none? What do you think?

Jon

On Tue, Mar 8, 2011 at 12:37 AM, David Blevins <da...@gmail.com>wrote:

>
> On Mar 7, 2011, at 3:58 PM, Jonathan Gallimore wrote:
>
> > Hi All,
> >
> > I've got a couple of (probably silly) questions about our JSF support, I
> > wonder if someone can help me out?
> >
> > - I notice we include myfaces-1.2 api and impl jars in our Tomcat
> > distribution - are we correct to do this? Shouldn't the application
> > developer be able to provide their own jars in WEB-INF/lib, say for
> example
> > if they wanted to use the com.sun version instead of MyFaces for example?
> I
> > can get an application to deploy with this jar config (i.e. putting the
> ones
> > I want in WEB-INF/lib), but I have to delete myfaces-* from
> > webapps/openejb/lib first.
>
> If we want TomEE to be certified we need to include an impl that passes the
> TCK.
>
> We can certainly be clever with that though, perhaps make it easy to
> remove.
>
> > - Anyone tried using JSF2 with OpenEJB/Tomcat? I think I've got
> everything
> > setup right, and the app deploys, but I'm running into an error when I
> > access a page that uses a ManagedBean:
> >
> > javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException:
> > /contact/List.xhtml @72,113 action="#{contactController.prepareCreate}":
> > Target Unreachable, identifier 'contactController' resolved to null
> > at
> >
> javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:95)
> > at
> [...]
> >
> > I thought maybe my ManagedBean wasn't being deployed correctly. I have an
> > empty beans.xml in WEB-INF. Is there anyway to check what managed beans
> have
> > been deployed?
>
> JSF managed bean support should work without a beans.xml shouldn't it?  I
> seem to recall they released their spec even before it was decided if CDI
> would officially be part of the Java EE 6 set of specs.
>
> Anyway, I seem to recall Karan has done the most work with JSF (pre 2.0).
>  I set it up so that the MyFaces binary is physically in the OpenEJB webapp,
> but didn't do anything code wise.
>
>
> -David
>
>

Re: JSF support

Posted by David Blevins <da...@gmail.com>.
On Mar 7, 2011, at 3:58 PM, Jonathan Gallimore wrote:

> Hi All,
> 
> I've got a couple of (probably silly) questions about our JSF support, I
> wonder if someone can help me out?
> 
> - I notice we include myfaces-1.2 api and impl jars in our Tomcat
> distribution - are we correct to do this? Shouldn't the application
> developer be able to provide their own jars in WEB-INF/lib, say for example
> if they wanted to use the com.sun version instead of MyFaces for example? I
> can get an application to deploy with this jar config (i.e. putting the ones
> I want in WEB-INF/lib), but I have to delete myfaces-* from
> webapps/openejb/lib first.

If we want TomEE to be certified we need to include an impl that passes the TCK.

We can certainly be clever with that though, perhaps make it easy to remove.

> - Anyone tried using JSF2 with OpenEJB/Tomcat? I think I've got everything
> setup right, and the app deploys, but I'm running into an error when I
> access a page that uses a ManagedBean:
> 
> javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException:
> /contact/List.xhtml @72,113 action="#{contactController.prepareCreate}":
> Target Unreachable, identifier 'contactController' resolved to null
> at
> javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:95)
> at
[...]
> 
> I thought maybe my ManagedBean wasn't being deployed correctly. I have an
> empty beans.xml in WEB-INF. Is there anyway to check what managed beans have
> been deployed?

JSF managed bean support should work without a beans.xml shouldn't it?  I seem to recall they released their spec even before it was decided if CDI would officially be part of the Java EE 6 set of specs.

Anyway, I seem to recall Karan has done the most work with JSF (pre 2.0).  I set it up so that the MyFaces binary is physically in the OpenEJB webapp, but didn't do anything code wise.


-David