Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on eclipse kepler, JSF 2.2 with PrimeFaces 4.0 / Mojarra 2.2 library.

actually there are 2 Problems:

-

I still get this server message no matter what I do.

(( javax.el.PropertyNotFoundException: /Order.xhtml @28,76 value="#{kk.refugee.id}": Target Unreachable, 'refugee' returned null))

and if I delete the input text puls the hidden, the message keeps pop up for 'material' selectOneMenu.

-

I have no chance to examin : ((is this javascript code correct, to copy the value of one component to the other.))

these are my xhtml file and java calsses.
thank you in advanced.

**kk.java**
-----------

RefugeeMan.java
---------------

Order.xhtml
-----------
 
Saloon Keeper
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see 2 problems.

1. The JavaBean standard requires that Class names start with an upper-case character, but member (property) and instance names (JSF backing bean names, for instance) start with a lower-case letter.

You named your backing bean class "kk", when "Kk" would have been more appropriate. Since you didn't explictly provide an annotation to name the instance created, the standard mechanism would have attempted to convert the class name (Kk) into an instance name (kk). What it would do in a case where the class name didn't start with a lower-case letter may not be what you think.

2. Your error message says it all: Target Unreachable, 'refugee' returned null)

In other words, you never initialized the property named "refugee" in your "kk" object. Since the EL expression:



effectively gets read as



and the getRefugee property method call is returning null (since refugee wasn't initialized). Which throws a NullPointerException that JSF intercepts and converts to an error message.
reply
    Bookmark Topic Watch Topic
  • New Topic