Cannot build valid CacheKey from request

1383 views
Skip to first unread message

A Nageshwar

unread,
Sep 29, 2015, 7:42:43 AM9/29/15
to wro4j
Sep 29, 2015 12:45:10 PM ro.isdc.wro.http.WroFilter onException
SEVERE: Exception occured
ro.isdc.wro.WroRuntimeException: Cannot build valid CacheKey from request: /NYSIFCC-react/images/header_bg_oneCol2.jpg

Exception :
--------------- 
Sep 29, 2015 12:24:49 PM ro.isdc.wro.http.WroFilter onException
SEVERE: Exception occured
ro.isdc.wro.WroRuntimeException: Cannot build valid CacheKey from request: /NYSIFCC-react/jscript/react-bootstrap.min.js.map
at ro.isdc.wro.manager.ResourceBundleProcessor.getSafeCacheKey(ResourceBundleProcessor.java:111)
at ro.isdc.wro.manager.ResourceBundleProcessor.serveProcessedBundle(ResourceBundleProcessor.java:61)
at ro.isdc.wro.manager.WroManager.process(WroManager.java:159)
at ro.isdc.wro.http.WroFilter.processRequest(WroFilter.java:335)
at ro.isdc.wro.http.WroFilter.doFilter(WroFilter.java:289)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:180)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Sep 29, 2015 12:24:49 PM ro.isdc.wro.http.WroFilter onException
WARNING: Cannot process. Proceeding with chain execution.

Configuration setup (I had set up)
===========================

web.xml
------------
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
    <filter>
   <filter-name>WebResourceOptimizer</filter-name>
   <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
   <init-param>
     <param-name>targetBeanName</param-name>
      <param-value>wroFilter</param-value>
        </init-param>
        <init-param>
      <param-name>targetFilterLifecycle</param-name>
     <param-value>true</param-value>
        </init-param>
   </filter>
    <filter-mapping>
        <filter-name>WebResourceOptimizer</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 

wro.xml
------------

<?xml version="1.0" encoding="UTF-8"?>
<groups xmlns="http://www.isdc.ro/wro"
        xsi:schemaLocation="http://www.isdc.ro/wro wro.xsd">

<!-- CSS resources -->
<group name="bundledCss">
<css>/css/main.css</css>
<css>/css/custom.css</css>
<css>/css/jquery/jquery-ui-1.8.17.custom.css</css>
<css>/css/bootstrap.css</css>
<css>/css/bootstrap-responsive.css</css>
<css>/css/style.css</css>
<css>/css/docs/pub/style.css</css>
<css>/css/docs/api.css</css>

</group>

<!-- JS resources -->
<group name="bundledJs">
<js>/jscript/react.js</js>
<js>/jscript/react-bootstrap.min.js</js>
<js>/jscript/JSXTransformer.js</js>
<js>/jscript/jquery-1.7.2.js</js>
<js>/jscript/action.js</js>
<js>/jscript/jsfunctions.js</js>
<js>/jscript/jquery/jquery.ui.core.js</js>
<js>/jscript/jquery/jquery.ui.datepicker.js</js>
<js>/jscript/jquery/jquery.ui.position.js</js>
<js>/jscript/jquery/jquery.ui.widget.js</js>
<js>/jscript/jquery/jquery.ui.dialog.js</js>
<js>/jscript/jsfunctions.js</js>
</group>

</groups>


wro4j.properties with in generated source folder
======================================
#If true, it is DEVELOPMENT mode, by default this value is true
debug=true
# Default is true
gzipEnabled=true
jmxEnabled=true
# MBean name to be used if JMX is enabled
mbeanName=wro
# Default is 0
cacheUpdatePeriod=0
# Default is 0
modelUpdatePeriod=0
# Default is false.
disableCache=false
# Default is UTF-8
encoding=UTF-8
uriLocators=servletContext,uri,classpath

In JSP pages
===========

<script type="text/javascript" src="${pageContext.request.contextPath}/jscript/bundledJs.js"></script>


<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/wro/bundledCss.css" />  


Thanks in Adavance could you please what setup i had made so that i am getting exception 

With regards 
A Nageshwar Rao
India

Alex Objelean

unread,
Sep 29, 2015, 7:44:53 AM9/29/15
to wr...@googlegroups.com
Hi A Nageshwar,

I think your problem is that you are mapping WroFilter to all requests ("/*"). As result, any request to your server is processed by WroFilter, which of course is not correct.
I would recommend you to use update the mapping, to make a difference between wro related requests and any other requests (example: "/wro/*" or "*.js").

Let me know if that helps.

Cheers,
Alex

--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

A Nageshwar

unread,
Sep 29, 2015, 7:56:20 AM9/29/15
to wro4j
Working Fine 

Thanks Alex
Reply all
Reply to author
Forward
0 new messages