4 Replies Latest reply on Jul 4, 2007 1:37 PM by Bill Durrell

    Using Seam components remotely...

    Ben Kyrlach Newbie

      I was recently tasked with separating the service layer of my seam application with the presentation layer. My first thought was to use the ability of EJB's to have a remote interface, and implement my own Variable Resolver which would allow me to look up Seam components from the Java Naming Directory and return them to the presentation layer.

      This, however, results in the following exception...

      Caused by: java.lang.IllegalStateException: Attempted to invoke a Seam component outside the context of a web application
       at org.jboss.seam.contexts.Lifecycle.getServletContext(Lifecycle.java:404)
       at org.jboss.seam.contexts.Lifecycle.beginApplication(Lifecycle.java:89)
       at org.jboss.seam.Seam.componentForName(Seam.java:211)
       at org.jboss.seam.intercept.SessionBeanInterceptor.postConstruct(SessionBeanInterceptor.java:101)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      Is what I'm attempting to do even possible? Is there another route that more experienced Seam developers would take? Any input would be greatly appreciated.