Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Crash when linking EJB to a JSF backing bean  RSS feed

 
Vasilis Souvatzis
Ranch Hand
Posts: 81
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings everyone, this may be a noob problem but I don't understand what's wrong so I can't fix it right now. I've busted my head over the previous couple of days but to no avail. I've found many examples with how to combine a JSF backing bean and an EJB (so that the EJB performs persistence to a DB) but something's obviously wrong in my case and it doesn't work.

So, I have my index page with a link to the registration page.


When I click the link, the app crashes with the following long Glassfish log.

The exception that caught my eye is the following


Now what I think the methodology is, is to create the backing bean and inside that have an EJB that will persist the data to the DB.



My UserFacade EJB is created automatically from Netbeans, I just added the persistUser method


After taking a look at the java.lang.IllegalStateException it says:
Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.

Where have I screwed up?
 
Vasilis Souvatzis
Ranch Hand
Posts: 81
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that the EJB injection is failing, since the app crashes right when I enter the register.xhtml page. It's funny because in all the books I'm reading, there's nothing more than injection happening, everyone's just injecting the EJB and it works.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB is exposing a local interface of type UserFacadeLocal. Try changing your @EJB injection member to:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!