9 Replies Latest reply on Mar 7, 2009 2:08 AM by santi ago

    seam remote error why?

    yu zexu Newbie
      web.xml
      <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>
         <servlet>
          <servlet-name>Seam Remoting</servlet-name>
          <servlet-class>org.jboss.seam.remoting.SeamRemotingServlet</servlet-class>
        </servlet>

        <servlet-mapping>
          <servlet-name>Seam Remoting</servlet-name>
          <url-pattern>/seam/remoting/*</url-pattern>
        </servlet-mapping>

      @Name("testremoteAction")
      @Scope(ScopeType.SESSION)
      public class RemoteAction implements DocNodeRemote{
              public void sayHello() {
                      System.out.println("ddd");

              }

      }

      @Local
      public interface DocNodeRemote {

              @WebRemote
              public void sayHello();
      }

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:s="http://jboss.com/products/seam/taglib">

      <head>
              <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
              <title>Seam Remoting - Hello World Example</title>
      </head>

      <body>

        <h1>Seam Remoting - Hello World Example</h1>
       
        <p>
       
        </p>

        <s:remote include="testremoteAction"></s:remote>
        <script type="text/javascript">
          function sayHello() {
              alert("pp");
          alert(Seam.Component.getInstance("testremoteAction"));
            Seam.Component.getInstance("testremoteAction").sayHello();
          }

          function sayHelloCallback(result) {
            alert(result);
          }


        </script> 

        <button onclick="javascript:sayHello()">Say Hello</button>

      </body>
      </html>

      the Seam.Component.getInstance("testremoteAction") is can get
      ||
      but the sayHello method is never called

      please help me  sorry my bad english
        • 1. Re: seam remote error why?
          Shane Bryzak Master

          It looks like you're using an old version of Seam.  First thing I recommend to do is to upgrade to 2.1.0.GA.  Secondly, are you sure that it's your sayHello() method not being called, and not the callback (which you haven't registered) ?

          • 2. Re: seam remote error why?
            yu zexu Newbie

            I use 2.0.3  and the sayHello is not called ,I will update 2.1.0


            but I do't kown it can run ok

            • 3. Re: seam remote error why?
              Shane Bryzak Master

              If you're using 2.0.3 then your web.xml is wrong, you only need SeamResourceServlet.  I recommend you set a breakpoint in ExecutionHandler.handle() to see why your request isn't being executed.

              • 4. Re: seam remote error why?
                yu zexu Newbie

                I run the demo at IE  ,
                it say


                  object not suport property or method

                • 5. Re: seam remote error why?
                  Shane Bryzak Master

                  Which demo?  I just ran both the helloworld and chatroom demos from latest trunk in IE and they both worked fine for me.

                  • 6. Re: seam remote error why?
                    yu zexu Newbie

                    oh,I say I upload the demo



                    @Name(testremoteAction)
                    @Scope(ScopeType.SESSION)
                    public class RemoteAction implements DocNodeRemote{
                            public void sayHello() {
                                    System.out.println(ddd);


                            }


                    }


                    @Local
                    public interface DocNodeRemote {


                            @WebRemote
                            public void sayHello();
                    }
                    ....................

                    • 7. Re: seam remote error why?
                      yu zexu Newbie

                      Is have a lot of config file I is't configed or lost some jar


                      I config by the seam /example


                      but it not run good

                      • 8. Re: seam remote error why?
                        Shane Bryzak Master

                        So what happens when you set a breakpoint in ExecutionHandler.handle() ?

                        • 9. Re: seam remote error why?
                          santi ago Newbie
                          i have the same problem ,my seam version is jboss-seam-2.1.1.GA, jboss is jboss-4.2.3.GA. The seam example remoting/helloworld runs well when i deployed it to jboss.i have this test:
                          1.copy HelloWorld.java,helloWorld.xhtml to my seam project created by seam-gen
                          2.request the page http://hostname:port/webapp_name/helloWorld.seam,it can be displayed,but when i click the sayhello button,input the name,then Seam.Component.getInstance("testremoteAction") is can get,but the method sayHello can not be called ,and the error is Object doesn't support this property or method 
                          ...deployed-jars-ear.list is :
                          antlr-runtime.jar
                          core.jar
                          drools-compiler.jar
                          drools-core.jar
                          groovy-all.jar
                          janino.jar
                          jboss-el.jar
                          jbpm-jpdl.jar
                          mvel14.jar
                          richfaces-api.jar
                          richfaces-impl.jar
                          richfaces-ui.jar
                          jboss-seam-remoting.jar
                          secuInter_1.4.jar
                          ...deployed-jars-war.list is :
                          commons-beanutils.jar
                          commons-digester.jar
                          jsf-facelets.jar
                          jxl.jar
                          richfaces-impl.jar
                          richfaces-ui.jar
                          jboss-seam-debug.jar
                          jboss-seam-excel.jar
                          jboss-seam-ioc.jar
                          jboss-seam-mail.jar
                          jboss-seam-pdf.jar
                          jboss-seam-resteasy.jar
                          jboss-seam-rss.jar
                          jboss-seam-ui.jar
                          secuInter_1.4.jar

                          any help,any solution is appreciated.