aspose file tools*
The moose likes JSF and the fly likes Getting simple JBoss Seam sample to work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Getting simple JBoss Seam sample to work" Watch "Getting simple JBoss Seam sample to work" New topic
Author

Getting simple JBoss Seam sample to work

Peter Irmstadt
Greenhorn

Joined: Mar 01, 2009
Posts: 24
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!
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Change the method public String register() into public String getRegister()


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Oct 08, 2006
Posts: 2458
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.
sunil k tiwari
Greenhorn

Joined: Mar 01, 2009
Posts: 5
did you check your project has seam.properties file or not , it is required even though it is an empty file
Peter Irmstadt
Greenhorn

Joined: Mar 01, 2009
Posts: 24
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?
 
Consider Paul's rocket mass heater.
 
subject: Getting simple JBoss Seam sample to work
 
Similar Threads
DropDown that triggers a postback
Not able to access Session Bean in Seam Framework
a JSF configure question
javax.el.PropertyNotFoundException
JBOSS Seam registration problem. Please help....