0 Replies Latest reply on Mar 3, 2008 10:16 PM by Ryan McDonough

    Seam and RichFaces Issue: Resource not Registered

    Ryan McDonough Newbie

      We are working a Seam (2.0.1) based applications which uses Spring, Hibernate (3.2.5) and RichFaces (3.1.4SR1) on Weblogic 9.2 using the JSF RI. We are now running into an issue where we keep getting the following exception on screens which use ajax components:

      org.ajax4jsf.resource.ResourceNotFoundException: Resource not registered : /org/richfaces/ui.pack.js.seam
       at org.ajax4jsf.resource.ResourceBuilderImpl.getResource(ResourceBuilderImpl.java:390)
       at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceForKey(ResourceBuilderImpl.java:334)
       at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:152)
       at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
       Truncated. see log file for complete stacktrace


      We've reverted out web.xml a number of times, but the issue persists. We have read that this maybe a browser caching issue, and we've tried that and the issue remains. Also, the issue not isolated to just teh JavaScript file, but all script, associated images, etc. However, Style Sheets come through just fine. Any insight would be greatly appreciated.

      Here's how we have our web.xml set up:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
       <display-name>Admin App</display-name>
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.REFRESH_PERIOD</param-name>
       <param-value>2</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
      
      
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
      
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
       <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>
       <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>
      
       <!-- ajax4jsf -->
       <filter>
       <display-name>RichFaces Filter</display-name>
       <filter-name>richfaces</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>richfaces</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       <dispatcher>ERROR</dispatcher>
       </filter-mapping>
      
      
       <!-- Faces 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-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.seam</url-pattern>
       </servlet-mapping>
      
      
       <session-config>
       <session-timeout>10</session-timeout>
       </session-config>
      </web-app>


      And here's what our components.xml looks like:

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:core="http://jboss.com/products/seam/core"
       xmlns:persistence="http://jboss.com/products/seam/persistence"
       xmlns:spring="http://jboss.com/products/seam/spring"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:web="http://jboss.com/products/seam/web"
       xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
       http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.0.xsd
       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd">
       <core:init debug="true"/>
      
       <core:manager concurrent-request-timeout="500"
       conversation-timeout="120000"
       conversation-id-parameter="cid"/>
      
      
       <!-- Enabling the debug property will generate an AJAX console (but you could just use FireBug) -->
       <component name="org.jboss.seam.remoting.remotingConfig">
       <property name="debug">false</property>
       </component>
      
       <web:exception-filter url-pattern="*.seam"/>
      
       <web:redirect-filter url-pattern="*.seam"/>
      
       <web:multipart-filter create-temp-files="true"
       max-request-size="1000000"
       url-pattern="*.seam"/>
      
       <!-- Add identity logging to the application. This filter adds the authenticated user name
       to the log4j mapped diagnostic context so that it can be included in formatted log output
       if desired, by adding %X{username} to the pattern -->
       <web:logging-filter url-pattern="*.seam"/>
      
       <web:ajax4jsf-filter force-parser="false"
       enable-cache="true"
       log4j-init-file="custom-log4j.xml"
       url-pattern="*.seam"/>
      
      
       <!-- Allows Seam to manage the Hibernate Session -->
       <persistence:managed-hibernate-session name="hibernateSession"
       auto-create="true"
       session-factory="#{springSessionFactory}"/>
      
       <spring:context-loader />
      
       <!-- Install a ThreadPoolDispatcher to handle scheduled asynchronous event -->
       <core:thread-pool-dispatcher name="threadPoolDispatcher"/>
      
       <!-- Install the SpringDispatcher as default -->
       <spring:task-executor-dispatcher schedule-dispatcher="#{threadPoolDispatcher}"
       task-executor="#{springThreadPoolTaskExecutor}"/>
      
       <!-- Set up the transaction Manager. The id must match the ID in the applicationContext.xml -->
       <spring:spring-transaction platform-transaction-manager="#{transactionManager}"/>
      </components>