Seam Remoting Newbie Question--Getting Exception
gzoller.greg.zoller.aviall.com Sep 16, 2009 8:02 PMHello,
I'm trying remoting for the first time and am getting an exception. I will be accessing the remote functionality via a trivial HTML page.
The Java code is shown below:
Local Interface:
import org.jboss.seam.annotations.remoting.WebRemote; import javax.ejb.Local; @Local public interface StoreLocal { @WebRemote public String search(String query); }
Implementation:
import org.jboss.seam.annotations.Name; import javax.ejb.Stateless; @Stateless @Name("store") public class Store implements StoreLocal{ public String search(String query) { return "Greg's Test Successful! :::> "+query; } }
Before even testing whether the remoting is working I tried accessing the javascript file remote.js, entering the url in the browser (servlet was configured in web.xml as shown in docs). I got this exception:
javax.servlet.ServletException: Servlet.init() for servlet Seam Resource Servlet threw exception
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
java.lang.Thread.run(Unknown Source)
root cause
java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36)
org.jboss.seam.contexts.Lifecycle.mockApplication(Lifecycle.java:111)
org.jboss.seam.servlet.SeamResourceServlet.loadResourceProviders(SeamResourceServlet.java:42)
org.jboss.seam.servlet.SeamResourceServlet.init(SeamResourceServlet.java:35)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
java.lang.Thread.run(Unknown Source)
Any ideas?
Thanks!
Greg