• 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

Crash when linking EJB to a JSF backing bean

 
Ranch Hand
Posts: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The EJB is exposing a local interface of type UserFacadeLocal. Try changing your @EJB injection member to:

 
reply
    Bookmark Topic Watch Topic
  • New Topic