[jboss-user] [JBoss Seam] - invoke a Seam component outside the context of a web applica
nicolas.bielza
do-not-reply at jboss.com
Thu Oct 12 14:52:09 EDT 2006
Hello,
I' trying to build a standalone Java SE application that would use Seam with the embedded EJB3 container and also embed Jetty as a servlet container.
I also need to be able to retrieve some configuration information from the SQL database before I can start the servlet container (actually, I want to retrieve a Certificate to start the servlet container with SSL).
Since managing authentication certificates is at the core of my application, they are defined as EJB / Seam components. So I thought it would be nice if I could retrieve the SSL certificate through the container-managed EntityManager (actually, through an EJB that receives the EntityManager through dependency injection).
I managed to boot the EJB3 container, and lookup the bean, but when I try to access it I get this exception:
java.lang.IllegalStateException: Attempted to invoke a Seam component outside the context of a web application
Obviously, the SeamInterceptor won't let me access the bean before I deploy my web application.
If I remove ejb-jar.xml from the jar that contains my EJBs, I can access the bean, but once the web application is started, Seam doesn't "see it".
So my question is: is there a way to get around the SeamInterceptor ? Can I change its policy ? Is there a way to deploy my beans in the EJB3 container, access them and install the SeamInterceptor afterwards ? Am I just doing something plain stupid ?
Thanks for your advice,
Nicolas.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977971#3977971
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977971
More information about the jboss-user
mailing list