9 Replies Latest reply on Mar 10, 2009 11:06 AM by adubovsky

    Seam-Richfaces-JBoss AS  -- A4J is Undefined

      Hi there,

      I've got a project running Richfaces 3.3.0GA, Seam 2.0.2SP1 on JBoss 4.2.2 AS. I created a test project to use A4J and Richfaces to have a datatable, but with the ability to click edit, and have a new row appear underneath with edit controls. This worked perfectly. I went to put this in the main project, which has a lot of stuff in it already, lots of Richfaces controls, but no ajax functionality.

      When I put my code in and ran it in Firefox, it throws a Javascript error - "A4J is Undefined" this is on the "A4J.AJAX.Submit" command. This is preventing me from doing what I want to do, I've checked that I'm using the same version of Richfaces and Seam as the test project, but still it doesn't work.

      Any ideas or solutions would be greatly appreciated. I've had this problem once before, and the only solution was to recreate the project. But this time I can't recreate it as we have a lot of people working on it, and it's getting painful creating new projects each time a problem comes up!

      Thanks,

      Chris

        • 1. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined
          nbelaevski

          Hello Chris,

          Can you please check if:

          1. HEAD element of the generated HTML code contains references to RF scripts (use "view source" in browser)
          2. Referenced scripts are loaded ok (check with Firebug/Eclipse TCP Monitor/Fiddler tool)

          • 2. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined

            Hi, thanks for the quick reply.

            The head tag does contain references to all RF script files, however using Firebug I have ascertained that they are not being loaded - an HTTP 404 error is occurring.

            Any idea of how to fix this?

            Thanks,

            Chris

            • 3. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined
              nbelaevski

              Chris,

              Please post web.xml.

              • 4. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined

                 

                "nbelaevski" wrote:
                Chris,

                Please post web.xml.

                <?xml version="1.0" encoding="UTF-8"?>
                <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                 <context-param>
                 <param-name>facelets.DEVELOPMENT</param-name>
                 <param-value>true</param-value>
                 </context-param>
                 <context-param>
                 <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                 <param-value>.xhtml</param-value>
                 </context-param>
                 <!-- Authenticator config -->
                 <context-param>
                 <param-name>appconfig.casServiceUrl</param-name>
                 <param-value>webaddress</param-value>
                 </context-param>
                 <context-param>
                 <param-name>appconfig.appServiceUrl</param-name>
                 <param-value>webaddress</param-value>
                 </context-param>
                 <context-param>
                 <param-name>appconfig.ldapServerUrl</param-name>
                 <param-value>ldap://somerandommachine</param-value>
                 </context-param>
                 <context-param>
                 <param-name>appconfig.ldapUserName</param-name>
                 <param-value>cn=Manager</param-value>
                 </context-param>
                 <context-param>
                 <param-name>appconfig.ldapPassword</param-name>
                 <param-value>myvalue</param-value>
                 </context-param>
                 <context-param>
                 <param-name>org.richfaces.SKIN</param-name>
                 <param-value>blueSky</param-value>
                 </context-param>
                 <filter>
                 <filter-name>Seam Filter</filter-name>
                 <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
                 </filter>
                 <filter-mapping>
                 <filter-name>Seam Filter</filter-name>
                 <url-pattern>/*</url-pattern>
                 </filter-mapping>
                 <listener>
                 <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                 </listener>
                 <servlet>
                 <servlet-name>Seam Resource Servlet</servlet-name>
                 <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
                 </servlet>
                 <servlet>
                 <servlet-name>Faces Servlet</servlet-name>
                 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
                 </servlet>
                 <servlet>
                 <display-name>Apache-Axis Servlet</display-name>
                 <servlet-name>AxisServlet</servlet-name>
                 <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
                 </servlet>
                 <servlet-mapping>
                 <servlet-name>Seam Resource Servlet</servlet-name>
                 <url-pattern>/seam/resource/*</url-pattern>
                 </servlet-mapping>
                 <servlet-mapping>
                 <servlet-name>Faces Servlet</servlet-name>
                 <url-pattern>*.seam</url-pattern>
                 </servlet-mapping>
                 <servlet-mapping>
                 <servlet-name>AxisServlet</servlet-name>
                 <url-pattern>/servlet/AxisServlet</url-pattern>
                 </servlet-mapping>
                 <servlet-mapping>
                 <servlet-name>AxisServlet</servlet-name>
                 <url-pattern>*.jws</url-pattern>
                 </servlet-mapping>
                 <servlet-mapping>
                 <servlet-name>AxisServlet</servlet-name>
                 <url-pattern>/services/*</url-pattern>
                 </servlet-mapping>
                 <security-constraint>
                 <display-name>Restrict raw XHTML Documents</display-name>
                 <web-resource-collection>
                 <web-resource-name>XHTML</web-resource-name>
                 <url-pattern>*.xhtml</url-pattern>
                 </web-resource-collection>
                 <auth-constraint/>
                 </security-constraint>
                 <login-config>
                 <auth-method>BASIC</auth-method>
                 </login-config>
                </web-app>
                


                • 5. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined
                  nbelaevski

                  Thanks you! web.xml seems to be ok. Can you please post how generated script URLs look like?

                  • 6. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined

                    These are all of the links and scripts included in the HEAD tag:

                    <link class="component" href="/MWM Admin/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" />
                    <link class="component" href="/MWM Admin/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" media="rich-extended-skinning" rel="stylesheet" type="text/css" />
                    <link class="component" href="/MWM Admin/a4j/s/3_3_0.GAcss/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" />
                    <script src="/MWM Admin/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"></script>
                    <script src="/MWM Admin/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script>
                    <script src="/MWM Admin/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/data-table.js" type="text/javascript"></script>
                    <link class="component" href="/MWM Admin/a4j/s/3_3_0.GAcss/table.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" />
                    <script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script>
                    <script src="/MWM Admin/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript"></script>
                    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


                    Cheers for your help!

                    Chris

                    • 8. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined

                      Hi,

                      Thanks for all your help. As we are in the early stages of the project, we have decided to cut our losses and to create a new project.

                      Once again, thank you for everything,

                      Chris

                      • 9. Re: Seam-Richfaces-JBoss AS  -- A4J is Undefined
                        adubovsky

                        Hello,

                        Seems like your project has space in app context name. If so you can just change app context name and all will be OK. Issue is opened: https://jira.jboss.org/jira/browse/RF-6497