3 Replies Latest reply on Jan 3, 2008 3:46 AM by cvigouroux

    Seam Remoting failing on Firefox 2.0

    cvigouroux

      Hi, I'm having some trouble to use Seam Remoting on Firefox. My example works fine on IE 6, but when debugging within firebug I catch the following exception :

      [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: :: anonymous :: line 1" data: no]

      Here are the versions :
      - Firefox 2.0.0.11
      - Seam 2.0.1CR1

      Did anybody have some trouble with this setup ? Did I something wrong ?

      Here is my example code :

      ---------------------------------------------------------------------------------
      "Remote" interface
      ---------------------------------------------------------------------------------
      @Local
      public interface HelloAction {

      @WebRemote
      public String getAllIsoCodes();

      @WebRemote
      public List getPays();
      }

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

      <ui:define name="body">





      //<![CDATA[

      function getAllIsoCodes() {
      Seam.Component.getInstance("helloAction").getAllIsoCodes(getAllIsoCodesCallback);
      }

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

      function listePays() {
      Seam.Component.getInstance("helloAction").getPays(listePaysCallback);
      }

      function listePaysCallback(result) {
      alert(result[0].getCdpayiso());
      }

      // ]]>


      <h:messages globalOnly="true" styleClass="message" />

      <rich:panel>
      <f:facet name="header">helloAction</f:facet>

      <h:form id="helloActionForm">

      All Iso Codes
      Countries List

      </h:form>

      </rich:panel>

      </ui:define>

      </ui:composition>


      Thanks for your answers !

        • 1. Re: Seam Remoting failing on Firefox 2.0
          cvigouroux

          Ok, some problem with HTML rendering on this forum...


          So the remote javascript functions look like :

          function getAllIsoCodes() {
          Seam.Component.getInstance("helloAction").getAllIsoCodes(getAllIsoCodesCallback);
          }

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

          function listePays() {
          Seam.Component.getInstance("helloAction").getPays(listePaysCallback);
          }

          function listePaysCallback(result) {
          alert(result[0].getCdpayiso());
          }

          • 2. Re: Seam Remoting failing on Firefox 2.0
            shane.bryzak

            Your code looks fine to me. Does the remoting/helloworld example work for you?

            • 3. Re: Seam Remoting failing on Firefox 2.0
              cvigouroux

              Ok, I've managed to find where was the problem. It stands in the fact that my buttons which call the remote methods are in a form element. This causes on Firefox some sort of page reloading. I've put the buttons out of the form and it now works.

              Thanks for your answer.