-
1. Re: Seam 2.0.2 Remoting In Eclipse
shane.bryzak Sep 14, 2010 8:07 AM (in response to celestialcitizen)The source paths looks correct to me - what happens when you try to view source of /SeamExample/seam/resource/remoting/resource/remote.js? Some things that you could check:
- That seam-remoting.jar is included in your deployment.
- If you are packaging as an EAR file, then seam-remoting.jar should be in the WAR.
- That the Seam resource servlet is enabled in your web.xml.
If all of those things look ok, please let me know and we can dig deeper ;)
-
2. Re: Seam 2.0.2 Remoting In Eclipse
celestialcitizen Sep 15, 2010 1:08 AM (in response to celestialcitizen)Hi Shane,
Thanks for the quick reply.
I will give you more details.
1. I am deplying a war file
2. The .war file has a WEB-INF/lib which contains the jboss-seam-remoting.jar. I looked into the jar and I could locate the remote.js3. The web.xml, components.xml are under the WEB-INF directory
4. In components.xml I have the following configuration
<component name="org.jboss.seam.remoting.remoting"> <property name="debug">true</property> </component>
5. In web.xml I have the following configuration
<servlet> <servlet-name>Seam Resource Servlet</servlet-name> <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Seam Resource Servlet</servlet-name> <url-pattern>/seam/resource/*</url-pattern> </servlet-mapping>
6. My.xhtml file which refers to remoting is included directly the in .war file which is one level above in the directory
I have a basic question. Where does the url /seam/resource look for stuff ?
-
3. Re: Seam 2.0.2 Remoting In Eclipse
celestialcitizen Sep 15, 2010 1:17 AM (in response to celestialcitizen)Hi Shane,
There is one more thing that I observe,
when i type in the following url in the browser
http://localhost:8080/SeamExample/seam/resource/remote.js
I get the following exception
javax.servlet.ServletException: Servlet.init() for servlet Seam Resource Servlet threw exception
and the root cause is
java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
-
4. Re: Seam 2.0.2 Remoting In Eclipse
shane.bryzak Sep 15, 2010 2:50 AM (in response to celestialcitizen)The /seam/resource URL sends the request to the Seam resource servlet (org.jboss.seam.servlet.SeamResourceServlet), then from here the request is routed to the correct 'resource provider'. This servlet is simply a convenience mechanism provided by Seam to provide all the non-JSF type resources without having to configure all the various servlets separately in web.xml (you just configure the resource servlet once, and you're done).
It is up to each individual resource provider to setup the Seam contexts if they are required to process the request. Remoting does this when generating JavaScript stubs - see org.jboss.seam.remoting.InterfaceGenerator.handle(). The work it does here is wrapped in a ContextualHttpServletRequest which automatically sets up Seam's contexts.
From the error you're getting it seems that something is attempting to access a Seam component without setting up the contexts first. I can't really determine from your error message what is causing this though - could you please post the full stack trace?
-
5. Re: Seam 2.0.2 Remoting In Eclipse
celestialcitizen Sep 15, 2010 8:59 AM (in response to celestialcitizen)Hi Shane,
I am trying to deploy the project as a war and not an ear. So I heard there are issues with the same. I am not sure but I heard that EJB's must be deployed as EARS
What should I do to deploy the application as a war file ?