Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with <h:selectOneMenu component --- identifier 'motorcycleCat' resolved to null

 
Giannis nasdades
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have made a simple application with seam but i am facing problems with selectOneMenu and s:selectItems make them work together.

The functionality is as follows:
I have an xhtml page from where i want to use selectOneMenu and s:selectItems (which gives me a list of values from the database) in order to select one value.
After this when i click the button i want to search in another table and render the results in the page. Right now, when i click the link the page renders fine and i can successfully select one falue from the selectOneMenu list. After that, when i click the submit button I get the exception javax.el.PropertyNotFoundException: /motorcycleSearchAction.xhtml @23,44 value="#{motorcycleCat.category}": Target Unreachable, identifier 'motorcycleCat' resolved to null. The property that becomes null is the property that should be set
from the selectOneMenu.

I would be more than greatfull if you could asist me on this as i am stuck two days now.

The contents of my files are:

MotorcycleSearchAction.xhtml



My action jave file MotorcycleActionImpl is:


The interface is:



And below is the stack trace:




Any help would be appreciated.

Thanks in advance,
giannis

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Giannis nasdades wrote:I get the exception

javax.el.PropertyNotFoundException: /motorcycleSearchAction.xhtml @23,44 value="#{motorcycleCat.category}":
Target Unreachable, identifier 'motorcycleCat' resolved to null.

The property that becomes null is the property that should be set from the selectOneMenu.
You read it wrong. It is 'motorcycleCat' which is null, not 'category'.
So, this managed bean is nowhere available in the JSF scope?
I am not that familiar with Seam, but shouldn't you declare the bean as managed bean in faces-config.xml?
 
Giannis nasdades
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke Scholtz wrote:
Giannis nasdades wrote:I get the exception

javax.el.PropertyNotFoundException: /motorcycleSearchAction.xhtml @23,44 value="#{motorcycleCat.category}":
Target Unreachable, identifier 'motorcycleCat' resolved to null.

The property that becomes null is the property that should be set from the selectOneMenu.
You read it wrong. It is 'motorcycleCat' which is null, not 'category'.
So, this managed bean is nowhere available in the JSF scope?
I am not that familiar with Seam, but shouldn't you declare the bean as managed bean in faces-config.xml?



Hi,

The bean was generated automatically by jboss tools as was geenrated the whole project. So i do not think this is the issue. For your reference i give yuo the whole bean code:



furntermore, this is the content of faces-config.xml "it was also generated by jboss tools".



if you have any more ideas please let me know.

Thanks in advance,
giannis
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Giannis nasdades wrote:
The bean was generated automatically by jboss tools as was geenrated the whole project. So i do not think this is the issue.

Trust me, the exception tells otherwise. I was just translating it. The bean is nowhere in the scope!

So there is either a bug in Seam or you misconfigured it. Try posting the issue at the Seam forums.
I haven't seen high experienced Seam boys walking around here before.
 
Giannis nasdades
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke Scholtz wrote:
Giannis nasdades wrote:
The bean was generated automatically by jboss tools as was geenrated the whole project. So i do not think this is the issue.

Trust me, the exception tells otherwise. I was just translating it. The bean is nowhere in the scope!

So there is either a bug in Seam or you misconfigured it. Try posting the issue at the Seam forums.
I haven't seen high experienced Seam boys walking around here before.


ok now you are the man.. you gave me the idea of what the error. The error was that inside the page i was not refering to bean with the name that i have put in @Name annotation. Now this part is working fine .. but my problem is that as soon i click the button the queryMotorcycles is not executed.

Thanks a lot for your help.

Regards,
giannis
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic