0 Replies Latest reply on Oct 11, 2009 3:12 AM by Greg Zoller

    Seam Remoting and Apache

    Greg Zoller Newbie

      Hello,


      I'm trying to take my Seam remoting to the next level.  I can get a simple remote service working with everything served from JBoss.


      Now I'd like to be able to serve the html from apache and have it call the Seam app running on JBoss as before.  (The search service called is trivial and merely echos some text back to the caller.)


      Here's my HTML:



      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html>
           <head>
                <title>Aviall</title>
                <script src="http://localhost:8080/hah/js/jquery-1.3.1.js"></script>
                <script src="http://localhost:8080/hah/seam/resource/remoting/resource/remote.js"></script>
                <script src="http://localhost:8080/hah/seam/resource/remoting/interface.js?store"></script>
           </head>
           <body>
                <h2>Testing...</h2>
                <script language="javascript">
                     jQuery(function() {
                          search();
                     });
      
                     var search = function() {
                          alert("Calling search...");
                          Seam.Component.getInstance("store").search("Foo", searchResults);
                          alert("Back from search.");
                     };
                     
                     function searchResults(result) {
                          alert("Seam says>>> "+result);
                     }
                </script>     
           </body>
      </html>
      



      The call does not complete successfully as it did when the html was served by JBoss.  There was a POST error:




      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>404 Not Found</title>
      </head><body>
      <h1>Not Found</h1>
      <p>The requested URL /hah/seam/resource/remoting/execute was not found on this server.</p>
      </body></html>
      



      Just guessing but it may be that this file is referenced inside the server-generated js files and these files got generated with relative urls, which is causing the trouble.


      Has anyone been successful separating the html content from the Seam ear/war file and having remoting work?


      Thanks in advance,
      Greg