• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting simple JBoss Seam sample to work

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I am new to Java EE (I do know Java SE, Annotations and Generics ). I am currently trying to learn the basics of Seam by "learning by doing".

What I want for my first lesson is to store data in a MySQL table. So I created a new Seam project using JBoss Tools for Eclipse using JBoss AS and my local MySQL 5 Server.

Then I created a new class below the MyProject-ejb/ejbModule/ folder:



then I created a second class:



and the related Interface



finally I created a new page and inserted



But when I try to enter some value and click the button, the following error message appears:


ERROR [application] javax.el.PropertyNotFoundException: /test.xhtml @22,83 action="#{register.register}": Target Unreachable, identifier 'register' resolved to null



Do I have to register that component somewhere? What causes that error?

Thank you in advance!
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change the method public String register() into public String getRegister()
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Irmstadt wrote:
ERROR [application] javax.el.PropertyNotFoundException: /test.xhtml @22,83 action="#{register.register}": Target Unreachable, identifier 'register' resolved to null


Is it declared as a managed bean? Do you know the JSF basics?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Remko Strating wrote:Change the method public String register() into public String getRegister()


You're wrong.
1) The error points to the first part of #{register.register}, not the second.
2) Action methods are usually not prefixed with "get".
3) Action methods are to be written with their full method name in EL.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you check your project has seam.properties file or not , it is required even though it is an empty file
 
Peter Irmstadt
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sunil k tiwari wrote:did you check your project has seam.properties file or not , it is required even though it is an empty file


I created my project using the JBoss Tools Seam Project Creation Wizard - so yes, I do have that (empty) file.

Bauke Scholtz wrote:

Peter Irmstadt wrote:
ERROR [application] javax.el.PropertyNotFoundException: /test.xhtml @22,83 action="#{register.register}": Target Unreachable, identifier 'register' resolved to null


Is it declared as a managed bean? Do you know the JSF basics?



Well, I am working on the basics

I read on my books that Seam doesn't use the XML files to register managed beans anymore but just annotations instead. That is right, isn't it? (I looked at the registration example inside the seam download archive and didn't find any XML reference there as well)

Any other ideas what might be wrong?
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic