Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » WTP JSF with MyFaces
WTP JSF with MyFaces [message #470903] Wed, 08 February 2006 16:10 Go to next message
Chris Gage is currently offline Chris GageFriend
Messages: 27
Registered: July 2009
Junior Member
I have been using JSF with WSAD and RAD6 for 18 months so I know my way
around reasonably well, but I have clearly become accustomed to the comfy
chair that RAD puts you in. I am now having a rather basic problem getting
it to work on WTP.

I installed all the WTP pieces from scratch and WTP itself appears to be
working as designed. I then added the JSF support but chose to use MyFaces
instead of Sun RI, seeing as everyone says it is a better implementation.

I have a simple app that has one page with an input "name" field and a
button, and the navigation passes to another page which says "hello name" -
it is a tutorial out there on the Web I found. The backing bean is
correctly defined in faces-config.xml as far as I can see. I run the
initial page, and it displays, but when I type in a name and press the
button, expecting it to invoke the backing bean called PersonBean, instead I
get the following which I think means it cannot find my backing bean.

HTTP Status 500 -
type Exception report
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception javax.servlet.ServletException: Base is null: PersonBean
javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)

root cause
javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455) org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169) com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111) javax.faces.component.UIInput.getConvertedValue(UIInput.java :713) javax.faces.component.UIInput.validate(UIInput.java:638) javax.faces.component.UIInput.executeValidate(UIInput.java:8 49) javax.faces.component.UIInput.processValidators(UIInput.java :412) javax.faces.component.UIForm.processValidators(UIForm.java:1 70) javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912) javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342) org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240) org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76) javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The full stack trace of the root cause is available in the ApacheTomcat/5.0.30 logs.Apache Tomcat/5.0.30
Re: WTP JSF with MyFaces [message #471467 is a reply to message #470903] Wed, 08 February 2006 18:47 Go to previous messageGo to next message
Gerry Kessler is currently offline Gerry KesslerFriend
Messages: 125
Registered: July 2009
Senior Member
Hi Chris,

A problem at runtime is nearly always a classpath problem of some kind.
With that said, you may want to post this question on a MyFaces newsgroup.

What jars have you included in your JSF Implementation Libary? Does
someone else montitoring this list have any suggestions?

Regards,
Gerry Kessler
WTP JSF Tools team

"Chris Gage" <a@b.com> wrote in message
news:dsd563$9kt$1@utils.eclipse.org...
>I have been using JSF with WSAD and RAD6 for 18 months so I know my way
>around reasonably well, but I have clearly become accustomed to the comfy
>chair that RAD puts you in. I am now having a rather basic problem getting
>it to work on WTP.
>
> I installed all the WTP pieces from scratch and WTP itself appears to be
> working as designed. I then added the JSF support but chose to use
> MyFaces instead of Sun RI, seeing as everyone says it is a better
> implementation.
>
> I have a simple app that has one page with an input "name" field and a
> button, and the navigation passes to another page which says "hello
> name" - it is a tutorial out there on the Web I found. The backing bean
> is correctly defined in faces-config.xml as far as I can see. I run the
> initial page, and it displays, but when I type in a name and press the
> button, expecting it to invoke the backing bean called PersonBean, instead
> I get the following which I think means it cannot find my backing bean.
>
> HTTP Status 500 -
> type Exception report
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
> exception javax.servlet.ServletException: Base is null: PersonBean
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)
>
> root cause
> javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455)
> org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169)
> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111)
> javax.faces.component.UIInput.getConvertedValue(UIInput.java :713)
> javax.faces.component.UIInput.validate(UIInput.java:638)
> javax.faces.component.UIInput.executeValidate(UIInput.java:8 49)
> javax.faces.component.UIInput.processValidators(UIInput.java :412)
> javax.faces.component.UIForm.processValidators(UIForm.java:1 70)
> javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912)
> javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342)
> org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240)
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The
> full stack trace of the root cause is available in the ApacheTomcat/5.0.30
> logs.Apache Tomcat/5.0.30
>
Re: WTP JSF with MyFaces [message #471468 is a reply to message #471467] Wed, 08 February 2006 19:01 Go to previous messageGo to next message
Yury Kats is currently offline Yury KatsFriend
Messages: 104
Registered: July 2009
Senior Member
Yes, this sounds like a generic JSF issue, unrelated to WTP/JSF project.

Something like that should be asked on MyFaces user list (since MyFaces
is used) or on a generic JSF forum (like SUN's or RAD's).

Having said that, one would need to see the JSP and faces-config.xml
to be able to tell anything about what might've gone wrong. The exception
suggests that the managed bean wasn't created.

On 2/8/2006 1:47 PM, Gerry Kessler wrote:
> Hi Chris,
>
> A problem at runtime is nearly always a classpath problem of some kind.
> With that said, you may want to post this question on a MyFaces newsgroup.
>
> What jars have you included in your JSF Implementation Libary? Does
> someone else montitoring this list have any suggestions?
>
> Regards,
> Gerry Kessler
> WTP JSF Tools team
>
> "Chris Gage" <a@b.com> wrote in message
> news:dsd563$9kt$1@utils.eclipse.org...
>> I have been using JSF with WSAD and RAD6 for 18 months so I know my way
>> around reasonably well, but I have clearly become accustomed to the comfy
>> chair that RAD puts you in. I am now having a rather basic problem getting
>> it to work on WTP.
>>
>> I installed all the WTP pieces from scratch and WTP itself appears to be
>> working as designed. I then added the JSF support but chose to use
>> MyFaces instead of Sun RI, seeing as everyone says it is a better
>> implementation.
>>
>> I have a simple app that has one page with an input "name" field and a
>> button, and the navigation passes to another page which says "hello
>> name" - it is a tutorial out there on the Web I found. The backing bean
>> is correctly defined in faces-config.xml as far as I can see. I run the
>> initial page, and it displays, but when I type in a name and press the
>> button, expecting it to invoke the backing bean called PersonBean, instead
>> I get the following which I think means it cannot find my backing bean.
>>
>> HTTP Status 500 -
>> type Exception report
>> description The server encountered an internal error () that prevented it
>> from fulfilling this request.
>> exception javax.servlet.ServletException: Base is null: PersonBean
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)
>>
>> root cause
>> javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
>> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455)
>> org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169)
>> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111)
>> javax.faces.component.UIInput.getConvertedValue(UIInput.java :713)
>> javax.faces.component.UIInput.validate(UIInput.java:638)
>> javax.faces.component.UIInput.executeValidate(UIInput.java:8 49)
>> javax.faces.component.UIInput.processValidators(UIInput.java :412)
>> javax.faces.component.UIForm.processValidators(UIForm.java:1 70)
>> javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912)
>> javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342)
>> org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240)
>> org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76)
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The
>> full stack trace of the root cause is available in the ApacheTomcat/5.0.30
>> logs.Apache Tomcat/5.0.30
>>
>
>
Re: WTP JSF with MyFaces [message #471469 is a reply to message #471468] Wed, 08 February 2006 20:57 Go to previous messageGo to next message
Chris Gage is currently offline Chris GageFriend
Messages: 27
Registered: July 2009
Junior Member
Well Hello again, Yury...

OK, Tomorrow I will remove MyFaces and replace it with the Sun jars and see
what I get. I looked at the source for FacesServlet in the MyFaces package
and saw that it doesn't even have as many as 202 lines, so I'm a little
confused. But for the moment, this is what I have. First the jsp I run:

InputName.jsp
==========

<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:loadBundle basename="Messages" var="Message" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Input Name Page</title>
</head>
<body>
<f:view>
<h1><h:outputText value="#{Message.inputname_header}" /></h1>
<h:messages style="color: blue" />
<h:form id="helloForm">
<h:outputText value="#{Message.prompt}" />
<h:inputText id="userName" value="#{PersonBean.userName}" required="true">
<f:validateLength minimum="2" maximum="10" />
</h:inputText>
<h:commandButton id="submit" action="sayhello" value="Say Hello" />
</h:form>
</f:view>
</body>
</html>

My backing bean PersonBean is in a package called first, and the .class file
does get copied to WEB-INF/classes/first. The properties file
Messages.properties is also in WEB-INF/classes and is found correctly, and
messages from it are displayed, although I'm not sure it is reliably copied
over from the src folder. Another RAD comfort zone -- I am obviously
suffering from withdrawal here.

PersonBean.java
===========

package first;
public class PersonBean {
String userName;
public String getUserName() {
return userName;
}
public void setUserName(String name) {
userName = name;
}
}

faces-config.xml
===========

<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<navigation-rule>
<from-view-id>InputName.jsp</from-view-id>
<navigation-case>
<to-view-id>Greeting.jsp</to-view-id>
</navigation-case>
</navigation-rule>

<managed-bean>
<description>Input Value Holder</description>
<managed-bean-name>PersonBean</managed-bean-name>
<managed-bean-class>first.PersonBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userName</property-name>
<property-class>java.lang.String</property-class>
<value></value>
</managed-property>
</managed-bean>
</faces-config>
Re: WTP JSF with MyFaces [message #471488 is a reply to message #470903] Fri, 17 February 2006 10:47 Go to previous message
Werner Punz is currently offline Werner PunzFriend
Messages: 52
Registered: July 2009
Member
Chris Gage schrieb:
> I have been using JSF with WSAD and RAD6 for 18 months so I know my way
> around reasonably well, but I have clearly become accustomed to the comfy
> chair that RAD puts you in. I am now having a rather basic problem getting
> it to work on WTP.
>
> I installed all the WTP pieces from scratch and WTP itself appears to be
> working as designed. I then added the JSF support but chose to use MyFaces
> instead of Sun RI, seeing as everyone says it is a better implementation.
>
> I have a simple app that has one page with an input "name" field and a
> button, and the navigation passes to another page which says "hello name" -
> it is a tutorial out there on the Web I found. The backing bean is
> correctly defined in faces-config.xml as far as I can see. I run the
> initial page, and it displays, but when I type in a name and press the
> button, expecting it to invoke the backing bean called PersonBean, instead I
> get the following which I think means it cannot find my backing bean.
>
> HTTP Status 500 -
> type Exception report
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
> exception javax.servlet.ServletException: Base is null: PersonBean
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)
>
> root cause
> javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455) org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169) com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111) javax.faces.component.UIInput.getConvertedValue(UIInput.java :713) javax.faces.component.UIInput.validate(UIInput.java:638) javax.faces.component.UIInput.executeValidate(UIInput.java:8 49) javax.faces.component.UIInput.processValidators(UIInput.java :412) javax.faces.component.UIForm.processValidators(UIForm.java:1 70) javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912) javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342) org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240) org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76) javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The full stack
trace of the root cause is available in the ApacheTomcat/5.0.30 logs.Apache Tomcat/5.0.30
>
Just a wild guess here, first of all which jsf version are you using?
Secondly di you have any tangeling classpath references into the RI?
or any sun related or third party jsf lib (which has explicit hooks into
the sun class hierarchy instead of javax.jsf...

the line:
com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111)

does definitely not look like myfaces, myfaces cannot have and does not
have to my knowledge any referenes into com.sun.xx..
(It is not allowed to)
Re: WTP JSF with MyFaces [message #589314 is a reply to message #470903] Wed, 08 February 2006 18:47 Go to previous message
Gerry Kessler is currently offline Gerry KesslerFriend
Messages: 125
Registered: July 2009
Senior Member
Hi Chris,

A problem at runtime is nearly always a classpath problem of some kind.
With that said, you may want to post this question on a MyFaces newsgroup.

What jars have you included in your JSF Implementation Libary? Does
someone else montitoring this list have any suggestions?

Regards,
Gerry Kessler
WTP JSF Tools team

"Chris Gage" <a@b.com> wrote in message
news:dsd563$9kt$1@utils.eclipse.org...
>I have been using JSF with WSAD and RAD6 for 18 months so I know my way
>around reasonably well, but I have clearly become accustomed to the comfy
>chair that RAD puts you in. I am now having a rather basic problem getting
>it to work on WTP.
>
> I installed all the WTP pieces from scratch and WTP itself appears to be
> working as designed. I then added the JSF support but chose to use
> MyFaces instead of Sun RI, seeing as everyone says it is a better
> implementation.
>
> I have a simple app that has one page with an input "name" field and a
> button, and the navigation passes to another page which says "hello
> name" - it is a tutorial out there on the Web I found. The backing bean
> is correctly defined in faces-config.xml as far as I can see. I run the
> initial page, and it displays, but when I type in a name and press the
> button, expecting it to invoke the backing bean called PersonBean, instead
> I get the following which I think means it cannot find my backing bean.
>
> HTTP Status 500 -
> type Exception report
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
> exception javax.servlet.ServletException: Base is null: PersonBean
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)
>
> root cause
> javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455)
> org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169)
> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111)
> javax.faces.component.UIInput.getConvertedValue(UIInput.java :713)
> javax.faces.component.UIInput.validate(UIInput.java:638)
> javax.faces.component.UIInput.executeValidate(UIInput.java:8 49)
> javax.faces.component.UIInput.processValidators(UIInput.java :412)
> javax.faces.component.UIForm.processValidators(UIForm.java:1 70)
> javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912)
> javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342)
> org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240)
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The
> full stack trace of the root cause is available in the ApacheTomcat/5.0.30
> logs.Apache Tomcat/5.0.30
>
Re: WTP JSF with MyFaces [message #589325 is a reply to message #471467] Wed, 08 February 2006 19:01 Go to previous message
Yury Kats is currently offline Yury KatsFriend
Messages: 104
Registered: July 2009
Senior Member
Yes, this sounds like a generic JSF issue, unrelated to WTP/JSF project.

Something like that should be asked on MyFaces user list (since MyFaces
is used) or on a generic JSF forum (like SUN's or RAD's).

Having said that, one would need to see the JSP and faces-config.xml
to be able to tell anything about what might've gone wrong. The exception
suggests that the managed bean wasn't created.

On 2/8/2006 1:47 PM, Gerry Kessler wrote:
> Hi Chris,
>
> A problem at runtime is nearly always a classpath problem of some kind.
> With that said, you may want to post this question on a MyFaces newsgroup.
>
> What jars have you included in your JSF Implementation Libary? Does
> someone else montitoring this list have any suggestions?
>
> Regards,
> Gerry Kessler
> WTP JSF Tools team
>
> "Chris Gage" <a@b.com> wrote in message
> news:dsd563$9kt$1@utils.eclipse.org...
>> I have been using JSF with WSAD and RAD6 for 18 months so I know my way
>> around reasonably well, but I have clearly become accustomed to the comfy
>> chair that RAD puts you in. I am now having a rather basic problem getting
>> it to work on WTP.
>>
>> I installed all the WTP pieces from scratch and WTP itself appears to be
>> working as designed. I then added the JSF support but chose to use
>> MyFaces instead of Sun RI, seeing as everyone says it is a better
>> implementation.
>>
>> I have a simple app that has one page with an input "name" field and a
>> button, and the navigation passes to another page which says "hello
>> name" - it is a tutorial out there on the Web I found. The backing bean
>> is correctly defined in faces-config.xml as far as I can see. I run the
>> initial page, and it displays, but when I type in a name and press the
>> button, expecting it to invoke the backing bean called PersonBean, instead
>> I get the following which I think means it cannot find my backing bean.
>>
>> HTTP Status 500 -
>> type Exception report
>> description The server encountered an internal error () that prevented it
>> from fulfilling this request.
>> exception javax.servlet.ServletException: Base is null: PersonBean
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)
>>
>> root cause
>> javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
>> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455)
>> org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169)
>> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111)
>> javax.faces.component.UIInput.getConvertedValue(UIInput.java :713)
>> javax.faces.component.UIInput.validate(UIInput.java:638)
>> javax.faces.component.UIInput.executeValidate(UIInput.java:8 49)
>> javax.faces.component.UIInput.processValidators(UIInput.java :412)
>> javax.faces.component.UIForm.processValidators(UIForm.java:1 70)
>> javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912)
>> javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342)
>> org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240)
>> org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76)
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The
>> full stack trace of the root cause is available in the ApacheTomcat/5.0.30
>> logs.Apache Tomcat/5.0.30
>>
>
>
Re: WTP JSF with MyFaces [message #589339 is a reply to message #471468] Wed, 08 February 2006 20:57 Go to previous message
Chris Gage is currently offline Chris GageFriend
Messages: 27
Registered: July 2009
Junior Member
Well Hello again, Yury...

OK, Tomorrow I will remove MyFaces and replace it with the Sun jars and see
what I get. I looked at the source for FacesServlet in the MyFaces package
and saw that it doesn't even have as many as 202 lines, so I'm a little
confused. But for the moment, this is what I have. First the jsp I run:

InputName.jsp
==========

<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:loadBundle basename="Messages" var="Message" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Input Name Page</title>
</head>
<body>
<f:view>
<h1><h:outputText value="#{Message.inputname_header}" /></h1>
<h:messages style="color: blue" />
<h:form id="helloForm">
<h:outputText value="#{Message.prompt}" />
<h:inputText id="userName" value="#{PersonBean.userName}" required="true">
<f:validateLength minimum="2" maximum="10" />
</h:inputText>
<h:commandButton id="submit" action="sayhello" value="Say Hello" />
</h:form>
</f:view>
</body>
</html>

My backing bean PersonBean is in a package called first, and the .class file
does get copied to WEB-INF/classes/first. The properties file
Messages.properties is also in WEB-INF/classes and is found correctly, and
messages from it are displayed, although I'm not sure it is reliably copied
over from the src folder. Another RAD comfort zone -- I am obviously
suffering from withdrawal here.

PersonBean.java
===========

package first;
public class PersonBean {
String userName;
public String getUserName() {
return userName;
}
public void setUserName(String name) {
userName = name;
}
}

faces-config.xml
===========

<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<navigation-rule>
<from-view-id>InputName.jsp</from-view-id>
<navigation-case>
<to-view-id>Greeting.jsp</to-view-id>
</navigation-case>
</navigation-rule>

<managed-bean>
<description>Input Value Holder</description>
<managed-bean-name>PersonBean</managed-bean-name>
<managed-bean-class>first.PersonBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userName</property-name>
<property-class>java.lang.String</property-class>
<value></value>
</managed-property>
</managed-bean>
</faces-config>
Re: WTP JSF with MyFaces [message #596531 is a reply to message #470903] Fri, 17 February 2006 10:47 Go to previous message
Werner Punz is currently offline Werner PunzFriend
Messages: 52
Registered: July 2009
Member
Chris Gage schrieb:
> I have been using JSF with WSAD and RAD6 for 18 months so I know my way
> around reasonably well, but I have clearly become accustomed to the comfy
> chair that RAD puts you in. I am now having a rather basic problem getting
> it to work on WTP.
>
> I installed all the WTP pieces from scratch and WTP itself appears to be
> working as designed. I then added the JSF support but chose to use MyFaces
> instead of Sun RI, seeing as everyone says it is a better implementation.
>
> I have a simple app that has one page with an input "name" field and a
> button, and the navigation passes to another page which says "hello name" -
> it is a tutorial out there on the Web I found. The backing bean is
> correctly defined in faces-config.xml as far as I can see. I run the
> initial page, and it displays, but when I type in a name and press the
> button, expecting it to invoke the backing bean called PersonBean, instead I
> get the following which I think means it cannot find my backing bean.
>
> HTTP Status 500 -
> type Exception report
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
> exception javax.servlet.ServletException: Base is null: PersonBean
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:20 2)
>
> root cause
> javax.faces.el.PropertyNotFoundException: Base is null: PersonBean
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndPrope rty(ValueBindingImpl.java:455) org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingI mpl.java:169) com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111) javax.faces.component.UIInput.getConvertedValue(UIInput.java :713) javax.faces.component.UIInput.validate(UIInput.java:638) javax.faces.component.UIInput.executeValidate(UIInput.java:8 49) javax.faces.component.UIInput.processValidators(UIInput.java :412) javax.faces.component.UIForm.processValidators(UIForm.java:1 70) javax.faces.component.UIComponentBase.processValidators(UICo mponentBase.java:912) javax.faces.component.UIViewRoot.processValidators(UIViewRoo t.java:342) org.apache.myfaces.lifecycle.LifecycleImpl.processValidation s(LifecycleImpl.java:240) org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:76) javax.faces.webapp.FacesServlet.service(FacesServlet.java:19 7)note The full stack
trace of the root cause is available in the ApacheTomcat/5.0.30 logs.Apache Tomcat/5.0.30
>
Just a wild guess here, first of all which jsf version are you using?
Secondly di you have any tangeling classpath references into the RI?
or any sun related or third party jsf lib (which has explicit hooks into
the sun class hierarchy instead of javax.jsf...

the line:
com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.ge tConvertedValue(HtmlBasicInputRenderer.java:111)

does definitely not look like myfaces, myfaces cannot have and does not
have to my knowledge any referenes into com.sun.xx..
(It is not allowed to)
Previous Topic:WTP JSF now with Sun RI
Next Topic:lkj
Goto Forum:
  


Current Time: Thu Apr 25 16:01:26 GMT 2024

Powered by FUDForum. Page generated in 0.04651 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top