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 ;)
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.js
3. 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 ?
There is one more thing that I observe,
when i type in the following url in the browser
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
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).
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?
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 ?