1 Reply Latest reply on Jan 10, 2012 6:56 AM by maxandersen

    Static resource not found for path jquery.maskedinput-1.3.js when RichFaces app is run on Eclipse/JBossTools in debug mode

    juanpusong

      I am trying to incorporate a jquery plugin (query.maskedinput-1.3.js) in my RichFaces (richfaces-ui-3.3.3.Final) application. When I try to run the app in debug mode on an Eclipse IDE (Helios) with JBoss Tools RichFaces v 3.2.0.v20110119-2004-H17-CR1 the app throws the following exception:

       

      javax.servlet.ServletException: Static resource not found for path jquery.maskedinput-1.3.js

      javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)

      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

      org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)

       

      root cause

      org.ajax4jsf.resource.ResourceNotFoundException: Static resource not found for path jquery.maskedinput-1.3.js
           org.ajax4jsf.resource.ResourceBuilderImpl.createStaticResource(ResourceBuilderImpl.java:463)
           org.ajax4jsf.resource.ResourceBuilderImpl.createResource(ResourceBuilderImpl.java:267)
           org.ajax4jsf.application.AjaxViewHandler.getResourceURL(AjaxViewHandler.java:142)
           org.ajax4jsf.renderkit.LoadResourceRendererBase.encodeToHead(LoadResourceRendererBase.java:83)
           org.ajax4jsf.context.ViewResources.processComponent(ViewResources.java:342)
           org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:381)
           org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
           org.ajax4jsf.context.ViewResources.processHeadResources(ViewResources.java:514)
           org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:193)
           com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
           com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
           com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
           org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
           org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
           org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)

       

      It happens only in debug mode. However, when I run the application in Tomcat, the error does not occur and the masked fields works fine indicating that the jquery plugin is working properly.

       

      Here's a snippet of my code:

       

      <html xmlns="http://www.w3.org/1999/xhtml"

            xmlns:h="http://java.sun.com/jsf/html"

            xmlns:f="http://java.sun.com/jsf/core"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j">

       

                <f:loadBundle basename="crms-messages" var="labels"/>

        <a4j:loadScript src="resource://jquery.js"/>

        <a4j:loadScript src="resource://query.maskedinput-1.3.js"/>

                <head>

                               <title><h:outputText value="#{labels.crmsSystemName}"/></title>

        </head>

       

                <body style="width:800px; height:400px;">

                               <rich:panel id="entryPanel" style="width:300px; margin:0 auto;" >

                                              <f:facet name="header">

                                                             <h:outputText value="Data Entry Form"/>

                                              </f:facet>

       

                   <h:form>

                                              <h:panelGrid columns="2">

                        <h:outputText value="Date Field"/>

                                                             <h:inputText id="myDateFld" value="" size="20">

                                                                            <rich:jQuery selector="#myDateFld"

                               query="mask('99/99/9999',{placeholder:' '})" timing="onload"/>

                                                             </h:inputText>

                                              </h:panelGrid>

       

       

                                              <h:panelGroup style="text-align:right;"">

                                                             <h:commandButton action="#{myBean.nextView}"

                          actionListener="#{myBean.entryListener}" value="Entry"/>

                                              </h:panelGroup>

                                              </h:form>

                               </rich:panel>

                </body>

      </html>

       


       

      Here's additional info that might help:

      In eclipse project, the plugin is saved in crms/WebContent/resources and in Tomcat its saved in webapps/crms/resources

      OS: Windows 7

      JDK v 1.6.0.0_29

      Tomcat : v7.0.6.

       

      When Tomcat is Restart(ed) in Debug mode, it detects some error. Here's the console message output:

       

      01 9, 12 9:50:37 PM com.sun.faces.config.WebConfiguration processInitParameters

      WARNING: JSF1025: [/crms] Context initialization parameter 'facelets.REFRESH_PERIOD' is deprecated.  The option will still be configured, but please use 'javax.faces.FACELETS_REFRESH_PERIOD' in the future.

      01 9, 12 9:50:37 PM com.sun.faces.config.WebConfiguration processInitParameters

      INFO: JSF1019: [/crms] Configuration option 'javax.faces.FACELETS_REFRESH_PERIOD' RESET to '2'

      01 9, 12 9:50:38 PM com.sun.faces.config.ConfigureListener contextInitialized

      INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/crms'

      01 9, 12 9:50:39 PM com.sun.faces.spi.InjectionProviderFactory createInstance

      INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.

      01 9, 12 9:50:41 PM org.apache.catalina.core.StandardContext listenerStart

      SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener

      java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1488)

                at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)

                at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)

                at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4458)

                at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)

                at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)

                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

                at java.util.concurrent.FutureTask.run(FutureTask.java:138)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                at java.lang.Thread.run(Thread.java:662)

      01 9, 12 9:50:41 PM org.apache.catalina.core.StandardContext listenerStart

      SEVERE: Skipped installing application listeners due to previous error(s)

      01 9, 12 9:50:41 PM org.apache.catalina.core.StandardContext startInternal

      SEVERE: Error listenerStart

      01 9, 12 9:50:41 PM org.apache.catalina.core.StandardContext startInternal

      SEVERE: Context [/jqmask] startup failed due to previous errors

      log4j:WARN No appenders could be found for logger (org.springframework.util.ClassUtils).

      log4j:WARN Please initialize the log4j system properly.

      01 9, 12 9:50:42 PM org.apache.catalina.core.ApplicationContext log

      INFO: Initializing Spring root WebApplicationContext

      01 9, 12 9:50:43 PM org.apache.catalina.core.ApplicationContext log

      INFO: Initializing Spring FrameworkServlet 'survey'

      01 9, 12 9:50:43 PM org.apache.coyote.AbstractProtocolHandler start

      INFO: Starting ProtocolHandler ["http-bio-8280"]

      01 9, 12 9:50:43 PM org.apache.coyote.AbstractProtocolHandler start

      INFO: Starting ProtocolHandler ["ajp-bio-8209"]

      01 9, 12 9:50:43 PM org.apache.catalina.startup.Catalina start

      INFO: Server startup in 44430 ms

       

       

       

      What is probably wrong. Any help would be greatly appreciated.

       

      Thanks in advance

        • 1. Re: Static resource not found for path jquery.maskedinput-1.3.js when RichFaces app is run on Eclipse/JBossTools in debug mode
          maxandersen

          Does it fail the same way when running in debug mode from command line ? i..e not within tools ?

           

           

          if yes, then I would say this question is better asked on richfaces forum than here.

           

          if no, ...I got no idea why we should be different.

           

          You write "when I try to run the app in debug mode on eclipse IDE" does that mean you did not run this in non-debug mode ?

           

          Could it be that the difference is not about debug, but about you using i.e. mvn to build and deploy the war and then run tomcat manually vs

          using eclipse and running tomcat directly?

           

          Then the difference is to be found in how you have configured eclipse to build/deploy the app.