Hmm, PMs don't seem to be activated. Anyway, please take a look at the placing of the Events.instance().raiseEvent("org.jboss.seam.postInitialization"); line. I'm guessing that this should come at the end of the method, or at least after the Lifecycle.endInitialization(); since endInitialization resets all the contexts.
After the "done initializing seam" logging seems appropriate since once the event is raised Seam will synchronously execute any observers which may have logging of their own. All of this should happen after seam has finish initializing.
Sry for the forum post. Didn't know of a better way to send this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039981#4039981
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039981
I solved my problem, kind of obvious now I know Seam a bit better:
1) created an application scope component that does the DB initialization in an @Create component (do not use @Startup for this component)
2) Inject this into the first component (using @In(create=true) that gets called in the application - the application scope ensures that the component only is created once... right?
Looks like its working anyway. Thanks all!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039976#4039976
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039976
"jpviragine" wrote : Hi, I'm unable to catch exceptions in remove method (SLSB):
|
| public void remove(T entity) {
| | try {
| | entityManager.remove(entity);
| | } catch (Exception e) {
| | log.error("Error!");
| | }
| | }
|
|
| The class/method that invoke the above code never appears in stack trace.
|
| Any idea?
|
| Thanks,
|
| Joao Paulo
Hi Joao, Im brazilian too.
The problem is that you're not flushing the entity manager. This is discussed in another topic. There's no way you can catch that exception without flushing the entity manager.
Take a look at this topic, maybe it should help you:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=100188&postdays=...
See posts starting from April, 12.
And search the forum for "entiyManager.flush" or something. You should find what you need.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039966#4039966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039966