0

I am working on grails. I am using resources plugin to acquire all the dependencies in my application. The problem is I am getting the exception like

Module [jquery] depends on resource [/plugins/jquery-1.8.0/js/jquery/jquery-1.8.0.min.js] but the file cannot be found

for every module in my applicationresources.groovy file. This is some part of the code that I am using

import org.springframework.context.annotation.DependsOn;

modules = {
application {
    dependsOn 'bootstrap' , 'bootstrap-js'
    resource url:'js/application.js'
    resource url:'js/bootstrap-hover.js'
    resource url:'js/bootstrap-popover.js'
    resource url: 'js/bootbox.js'
    resource url: 'js/filedownload.js'

}
dateTimePicker{
    dependsOn 'bootstrap' , 'bootstrap-js'
    resource url :'css/datetimePicker/DateTimePicker.css'
    resource url: 'css/datetimePicker/DateTimePicker-ltie9.css'
    resource url:'js/dateTimePicker/DateTimePicker.js'
    resource url:'js/dateTimePicker/DateTimePicker-ltie9.js'

}
jquery_ui{
    dependsOn 'jquery'
     resource url:'css/jquery-ui.css'
    resource url: 'js/jquery-ui/jquery-ui.js'
    resource url:'js/jquery-ui/jquery.ui.core.js'
    resource url:'js/jquery-ui/jquery.ui.widget.js'
    resource url:'js/jquery-ui/jquery.ui.button.js'

}
dataTable{
    dependsOn 'jquery' ,'bootstrap'
    resource url: 'js/dataTable/jquery.dataTables.min.js'
    resource url:'js/dataTable/dataTables.tableTools.min.js'
    resource url:'css/datatable/jquery.dataTables.css'
    resource url:'css/datatable/dataTables.tableTools.min.css'
    resource url:'js/dataTable/jquery.dataTables.columnFilter.js'

}
dataTable_Bootstrp{
    dependsOn 'dataTable'
    resource url:'js/dataTable/dataTable_Bootstrap.js'
    resource url:'css/datatable/dataTable_bootstrap.css'
}
bootstrap_dateTimePicker_css{
dependsOn 'bootstrap-css','bootstrap'
    resource url:'css/bootstrap-datetimepicker.min.css'
}
bootstrap_dateTimePicker{
    dependsOn 'jquery','bootstrap-js','moment'
    resource url:'js/bootstrap-datetimepicker.min.js'


}
bootstrap_dateTimePicker_locales   {
    resource url:'js/locales/bootstrap-datetimepicker.fr.js',charset:"UTF-8"
    resource url:'js/locales/bootstrap-datetimepicker.ru.js',charset:"UTF-8"
}
moment{
    resource url:'js/moment.min.js'
}
scaffolding {
    dependsOn 'bootstrap'
    resource url: 'css/scaffolding.css'
 }

styles {
    dependsOn 'bootstrap'
    resource url:"css/style.css"
}
Jquery{
    resource url: 'js/jquery-1.8.0.js'
}


chosen {
    dependsOn 'jquery'
    resource url:"css/chosen/chosen.css"
    resource url:"js/chosen/chosen.jquery.js"
}

//Adding Toaster Related Resources
toaster {
    dependsOn 'jquery'
    resource url: '/js/Toaster/toastr.js'
    resource url: '/css/Toaster/toastr.css'
}

push_events {
    dependsOn 'jquery', 'grailsEvents'
}
}

I can see all the files in the directory that exception says not found. What am I missing ?

These are the stacktraces

=======================

type Exception report

message Filtered request failed.

description The server encountered an internal error that prevented it from      fulfilling this request.

exception

 javax.servlet.ServletException: Filtered request failed.
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractSh     iroFilter.java:384)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFil    ter.java:125)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11    45)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6          15)
  java.lang.Thread.run(Thread.java:745)
root cause

   org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException:    Error applying layout : main
  net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
  net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
   org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:      55)
   org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilte    r.java:449)
     org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
 root cause

org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error    processing GroovyPageView: Error executing tag <r:layoutResources>: Module    [jquery] depends on resource [/plugins/jquery-1.8.0/js/jquery/jquery-   1.8.0.min.js] but the file cannot be found
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:    55)
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
root cause

org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error  executing tag <r:layoutResources>: Module [jquery] depends on resource  [/plugins/jquery-1.8.0/js/jquery/jquery-1.8.0.min.js] but the file cannot be  found
 E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp$_run_closure1.doCall(E__C     BR_1_cbr_2_0_grails_app_views_layouts_main_gsp:62)
E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp.run(E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp:67)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:55)
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
 root cause

 java.lang.IllegalArgumentException: Module [jquery] depends on resource [/plugins/jquery-1.8.0/js/jquery/jquery-1.8.0.min.js] but the file cannot be found
org.grails.plugin.resource.ResourceTagLib$_closure10.doCall(ResourceTagLib.groovy:462)
org.grails.plugin.resource.ResourceTagLib$_closure6.doCall(ResourceTagLib.groovy:377)
E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp$_run_closure1.doCall(E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp:62)
E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp.run(E__CBR_1_cbr_2_0_grails_app_views_layouts_main_gsp:67)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:55)
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 java.lang.Thread.run(Thread.java:745)
Muhammad Usman
  • 10,039
  • 22
  • 39
  • 1
    I suspect one of those files `if the problem is related to jquery-ui` will be one of those files contains a physical reference to a specific version of jquery `jquery-1.8.0` search for that word in that directory. but problem is about jquery and you have only posted your jquery_ui module then ... where the important bit was supposed to be. also files with generic names such as `jquery-ui.js` could be any version - @549 points think of wider audience who are not behind your PC – V H Mar 09 '17 at 11:03
  • @vahid I've edited my question with all the code in ApplicationResources.groovy file and the stacktraces. I am striking my head for very long on it . Couldn't figure out what's wrong. Thanks for your response – Muhammad Usman Mar 09 '17 at 12:21
  • right so in there it tells you `grails_app_views_layouts_main_gsp:62)` take a look in layouts/main.gsp ensure there is no other jquery resources loaded i.e. the jquery-1.8.0.min.js js that it complains about. Ultimately you have a declaration or something that relies on this `min` version of jqeury and you have declared the full version change your full version declaration to use the min version of the js file and put the min file in your js folder – V H Mar 09 '17 at 12:30
  • There is no other js loaded at 62 line on main.gsp If I remove jquery plugin.. same error occurs for next dependency. what's that ? – Muhammad Usman Mar 09 '17 at 12:47
  • cos it is the compiled gsp don't take it too literally - there are config options to export out compiled gsp's - irrelevant though since the above pointer is your key and you need to fix it either by finding it or by taking out segments of your resources config / to find which bit - ultimately you are behind it and no one else from here can give u a better indicator without seeing all of what you see – V H Mar 09 '17 at 12:53

0 Answers0