google-code-export / wro4j

Automatically exported from code.google.com/p/wro4j
1 stars 1 forks source link

cssImport processor translates urls incorrectly #650

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've been using v1.4.8.1 and now tried v1.6.2.

And noticed cssImport misbehaves now.

I have the following setup:
preProcessors=cssVariables,cssUrlRewriting,cssImport,cssMinJawr,semicolonAppende
r,consoleStripper
postProcessors=jsMin

and page:
/<context>/pages/index.jsp
in which I importing:

assets/stylesheets/application.css:
@import url("page.css");
@import url("menu.css");

page.css and menu.css are also under assets/stylesheets/

In v1.4.8.1 those imported files were included correctly and with v1.6.2 
application.css is returned empty and in log I see that the imported page and 
menu css were failed to resolve.

Here is excerpt of the logs for 1.4.8.1:

10:47:14,410 DEBUG MinimizeAwareProcessorDecorator:61 - Using Processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@7957f145
10:47:14,411 DEBUG CssImportPreProcessor:76 - Applying CssImportPreProcessor 
processor
10:47:14,417 DEBUG ServletContextUriLocator:130 - locate resource: 
/assets/stylesheets/application.css
10:47:14,418 DEBUG DispatcherStreamLocator:70 - dispatching request to 
location: /assets/stylesheets/application.css
10:47:14,419 DEBUG PreProcessorExecutor:79 - process and merge resources: 
[ro.isdc.wro.model.resource.Resource@6ef63b1e[CSS,/assets/stylesheets/page.css,t
rue], 
ro.isdc.wro.model.resource.Resource@67a3677b[CSS,/assets/stylesheets/menu.css,tr
ue]]
10:47:14,420 DEBUG PreProcessorExecutor:85 -    merging resource: 
ro.isdc.wro.model.resource.Resource@6ef63b1e[CSS,/assets/stylesheets/page.css,tr
ue]
10:47:14,420 DEBUG AbstractConfigurableMultipleStrategy:73 - configured 
aliases: cssVariables,cssUrlRewriting,cssImport,semicolonAppender
10:47:14,421 DEBUG AbstractConfigurableMultipleStrategy:61 - using strategies: 
[ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor@34148067, 
ro.isdc.wro.model.resource.processor.impl.css.CssUrlRewritingProcessor@2dfa04e7,
 ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@7957f145, 
ro.isdc.wro.model.resource.processor.impl.js.SemicolonAppenderPreProcessor@7ca12
73f]
10:47:14,421 DEBUG PreProcessorExecutor:169 - applying preProcessors: 
[ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor@34148067, 
ro.isdc.wro.model.resource.processor.impl.css.CssUrlRewritingProcessor@2dfa04e7,
 ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@7957f145]
10:47:14,422 DEBUG ServletContextUriLocator:130 - locate resource: 
/assets/stylesheets/page.css
10:47:14,422 DEBUG DispatcherStreamLocator:70 - dispatching request to 
location: /assets/stylesheets/page.css
10:47:14,423 DEBUG MinimizeAwareProcessorDecorator:61 - Using Processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor@34148067
10:47:14,424 DEBUG MinimizeAwareProcessorDecorator:61 - Using Processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssUrlRewritingProcessor@2dfa04e7
10:47:14,425 DEBUG AbstractCssUrlRewritingProcessor:128 - Applying 
CssUrlRewritingProcessor processor
10:47:14,425 DEBUG AbstractCssUrlRewritingProcessor:131 - cssUri: 
/assets/stylesheets/page.css

and in v1.6.2:

10:34:15,491 DEBUG ServletContextUriLocator:195 - retrieving servletContext 
stream for uri: /../assets/stylesheets/page.css
10:34:15,491 DEBUG ServletContextUriLocator:226 - [FAIL] reading resource from 
/../assets/stylesheets/page.css
10:34:15,492 DEBUG ServletContextUriLocator:175 - Wrong or empty resource with 
location: /../assets/stylesheets/page.css
10:34:15,492 DEBUG PreProcessorExecutor:193 - Invalid resource found: 
ro.isdc.wro.model.resource.Resource@97de276[CSS,/../assets/stylesheets/page.css,
true]
10:34:15,493 DEBUG PreProcessorExecutor:104 -   merging resource: 
ro.isdc.wro.model.resource.Resource@279eb5d8[CSS,/../assets/stylesheets/menu.css
,true]
10:34:15,493 DEBUG AbstractConfigurableMultipleStrategy:73 - configured 
aliases: cssVariables,cssUrlRewriting,cssImport,semicolonAppender
10:34:15,493 DEBUG AbstractConfigurableMultipleStrategy:61 - using strategies: 
[ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor@66cf439b, 
ro.isdc.wro.model.resource.processor.impl.css.CssUrlRewritingProcessor@315fa9d8,
 ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@28986c3f, 
ro.isdc.wro.model.resource.processor.impl.js.SemicolonAppenderPreProcessor@32052
c5d]
10:34:15,494 DEBUG PreProcessorExecutor:187 - applying preProcessors: 
[ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor@66cf439b, 
ro.isdc.wro.model.resource.processor.impl.css.CssUrlRewritingProcessor@315fa9d8,
 ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@28986c3f, 
ro.isdc.wro.model.resource.processor.impl.js.SemicolonAppenderPreProcessor@32052
c5d]
10:34:15,493 DEBUG AbstractDigesterHashStrategy:46 - SHA1HashStrategy hash: 
1d04a2bcd3e11eb414994ae5bfcc04116b48eb85
10:34:15,494 DEBUG DefaultSynchronizedCacheStrategyDecorator:122 - computed 
entry: hash: 1d04a2bcd3e11eb414994ae5bfcc04116b48eb85
10:34:15,494 DEBUG ServletContextUriLocator:133 - locate resource: 
/../assets/stylesheets/menu.css
10:34:15,495 DEBUG CacheValue:45 - Gzipping the content....
10:34:15,496 DEBUG ServletContextUriLocator:195 - retrieving servletContext 
stream for uri: /../assets/stylesheets/menu.css
10:34:15,497 DEBUG ServletContextUriLocator:226 - [FAIL] reading resource from 
/../assets/stylesheets/menu.css
10:34:15,497 DEBUG ServletContextUriLocator:175 - Wrong or empty resource with 
location: /../assets/stylesheets/menu.css
10:34:15,497 DEBUG PreProcessorExecutor:193 - Invalid resource found: 
ro.isdc.wro.model.resource.Resource@279eb5d8[CSS,/../assets/stylesheets/menu.css
,true]
10:34:15,498 DEBUG CssImportPreProcessor:53 - Imported resources found : 2
10:34:15,498 DEBUG CssImportPreProcessor:56 - importsCollector: 
[ro.isdc.wro.model.resource.Resource@97de276[CSS,/../assets/stylesheets/page.css
,true], 
ro.isdc.wro.model.resource.Resource@279eb5d8[CSS,/../assets/stylesheets/menu.css
,true]]
10:34:15,499 DEBUG ProcessorDecorator:89 - Skipping processor: 
ro.isdc.wro.model.resource.processor.impl.js.SemicolonAppenderPreProcessor@2eeab
0eb
10:34:15,499 DEBUG PreProcessorExecutor:226 - StopWatch '': running time 
(millis) = 172

Original issue reported on code.google.com by lystoc...@gmail.com on 11 Jan 2013 at 9:23

GoogleCodeExporter commented 9 years ago
I notice that when using wro4j-1.6.2, the url of the resource being processed 
looks like: /../assets/stylesheets/page.css, while when using the wro4j-1.4.8.1 
it looks like: /assets/stylesheets/page.css

I assume it has something to do with the way the model is built. Could you 
provide more details? How your wro.xml looks like? How do you configure it? 
Please provide as many details as you can.

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 9:35

GoogleCodeExporter commented 9 years ago
In src/main/webapp/WEB-INF/wro.xml I have:

  <group name="application">
    <css>/assets/stylesheets/application.css</css>
  </group>

and other .js groups which works correctly.

application.css is the only css that is included on the page.

also in web.xml mapping part is:

  <filter-mapping>
    <filter-name>WebResourceOptimizer</filter-name>
    <url-pattern>/assets/*</url-pattern>
  </filter-mapping>

I also use custom
  <filter>
    <filter-name>WebResourceOptimizer</filter-name>
    <filter-class>com.diio.platform.wro.http.CustomWroFilter</filter-class>
  </filter>

which just allows to override wro.properties with wro-debug.properties and 
wro-override.properties depending on environment, but this should not be 
related to the issue.
I tested both in debug and not debug mode.

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 9:47

GoogleCodeExporter commented 9 years ago
I think this has to do with the way the css is imported. Not sure yet why there 
is a difference with the older version, but could you try instead of:
assets/stylesheets/application.css

to import the 
/<context>/assets/stylesheets/application.css 

Let me know if that fixes the problem. I'll try to identify the cause of the 
problem when css is imported with relative url.

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 9:52

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 9:53

GoogleCodeExporter commented 9 years ago
Oh, sorry, I missed important bits which is applied in this case:

I also have in web.xml:

  <filter-mapping>
    <filter-name>WebResourceOptimizer</filter-name>
    <url-pattern>/v/*</url-pattern>
  </filter-mapping>

and application.css is actually included on page as

<link rel="stylesheet" type="text/css" 
href="/starod/v/-/assets/application.css" />

where '-' is replaced with build number in production mode to allow cache 
bursting.

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 10:00

GoogleCodeExporter commented 9 years ago
/starod/ is webapp context here

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 10:00

GoogleCodeExporter commented 9 years ago
The version you encode in url is the one which breaks the computation of the 
css path, since you are adding a virtual subfolder (-) which changes the way 
relative resource path is computed.

Could you try a different approach for encoding version for aggressive caching? 
Example: /assets-123/application.css & strip the -123 on the serverside when 
serving request...  or /assets/application.css?version=123 which should work 
without any changes....

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:06

GoogleCodeExporter commented 9 years ago
From my point of view, since you are changing with css path name, it is your 
responsibility to handle it in a custom way, so this is not a bug.

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:07

GoogleCodeExporter commented 9 years ago
Also, I recommend to consider using http://tuckey.org/urlrewrite/ which could 
probably be useful for your use-case.

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:13

GoogleCodeExporter commented 9 years ago
Do you mean that in v1.4.8.1 it works correctly by some 'mistake' and now in 
1.6.2 it regressioned because something else was fixed? I don't understand why 
it can not work as in 1.4.8.1.

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 10:14

GoogleCodeExporter commented 9 years ago
I'm not sure yet why it worked correctly in 1.4.8.1, but the current behavior 
is the expected one. I'll do some investigation to identify the reason ... very 
interesting :)

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:17

GoogleCodeExporter commented 9 years ago
I tried urlrewrite before and was having problems with css image urls rewriting 
not being working correctly in this case (or I would need some custom solution 
for images url rewritting) - spend lots of time on this. But then I realized 
that wro4j ignoring /context/path/<gropu>.js|css and I could put into path 
anything to allow cache bursting.

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 10:29

GoogleCodeExporter commented 9 years ago
There is an open issue for this: issue280. I hope to have enough time to 
implement that feature. Contributions are welcome. I like when people are 
contributing, since it allows to discuss this kind of issues and approaches.

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:31

GoogleCodeExporter commented 9 years ago
Btw, could you try with other versions too? I'm wondering where exactly the 
change related to this issue happened. Let me know if it works the same way 
with 1.5.0 or 1.6.0..

Thanks.

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:35

GoogleCodeExporter commented 9 years ago
I'm not sure how issue280 is related to this. With urlrewrite combined with 
wro4j css image url rewritting I was having image urls having incorrect 
relative paths.

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 10:48

GoogleCodeExporter commented 9 years ago
It appears it worked in all previous versions (1.5.0, 1.6.0, 1.6.1) but just 
not in 1.6.2.

Original comment by lystoc...@gmail.com on 11 Jan 2013 at 10:49

GoogleCodeExporter commented 9 years ago
That is weird... Thanks for confirming this.

The issue280 is not related to this particular issue, but is a feature which 
enhance aggressive caching for images referred by css..

Original comment by alex.obj...@gmail.com on 11 Jan 2013 at 10:51

GoogleCodeExporter commented 9 years ago
Hey Alex,

I wanted to confirm I also see this issue on 1.6.2, but not 1.6.1.  I was using 
urlrewrite with /v-*/, but have found that this issue exists if I also use my 
/nocache/ path which avoids the urlrewrite entirely.

Thanks,

D.

Original comment by dannyjro...@gmail.com on 12 Feb 2013 at 6:45

GoogleCodeExporter commented 9 years ago
Can you elaborate on your configuration? 

Original comment by alex.obj...@gmail.com on 12 Feb 2013 at 6:48

GoogleCodeExporter commented 9 years ago
UPDATE: Removing any @Imports from my css files and just adding them directly 
to wro.xml worked around this issue for me.

Here's my configuration that caused the failure - running 1.6.2:
wro.xml section
    <group name="legacy">
        <!-- Legacy CSS - this needs to be removed by the end of migration -->
        <css>/css/legacy/style.css</css>
    </group>

styles.css
/* CSS Document */
@import url("style-common.css");
@import url("style-components.css");
@import url("style-plugins.css");

ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@503bbcfd, 
ro.isdc.wro.model.resource.processor.impl.js.SemicolonAppenderPreProcessor@1f4af
32]
2013-02-12 15:20:46,049 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.l.ServletContextUriLocator - locate resource: 
/css/css/legacy/style-common.css
2013-02-12 15:20:46,049 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.l.s.DispatcherStreamLocator - dispatching request to location: 
/css/css/legacy/style-common.css
Feb 12, 2013 3:20:46 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet default threw exception
java.io.FileNotFoundException: The requested resource 
(/thdc/css/css/legacy/style-common.css) is not available
    at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:776)
    at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:411)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:690)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:599)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:536)
    at ro.isdc.wro.model.resource.locator.support.DispatcherStreamLocator.getInputStream(DispatcherStreamLocator.java:77)
    at ro.isdc.wro.model.resource.locator.ServletContextUriLocator.dispatcherBasedStreamLocator(ServletContextUriLocator.java:206)
    at ro.isdc.wro.model.resource.locator.ServletContextUriLocator.dispatcherFirstStreamLocator(ServletContextUriLocator.java:193)
    at ro.isdc.wro.model.resource.locator.ServletContextUriLocator.locate(ServletContextUriLocator.java:168)
    at ro.isdc.wro.model.resource.locator.factory.InjectorAwareUriLocatorFactoryDecorator.locate(InjectorAwareUriLocatorFactoryDecorator.java:56)
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.getResourceContent(PreProcessorExecutor.java:251)
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.applyPreProcessors(PreProcessorExecutor.java:191)
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.processAndMerge(PreProcessorExecutor.java:105)
    at ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor.doTransform(CssImportPreProcessor.java:50)
    at ro.isdc.wro.model.resource.processor.impl.css.AbstractCssImportPreProcessor.parseCss(AbstractCssImportPreProcessor.java:109)
    at ro.isdc.wro.model.resource.processor.impl.css.AbstractCssImportPreProcessor.process(AbstractCssImportPreProcessor.java:74)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.resource.processor.decorator.SupportAwareProcessorDecorator.process(SupportAwareProcessorDecorator.java:39)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.resource.processor.decorator.ExceptionHandlingProcessorDecorator.process(ExceptionHandlingProcessorDecorator.java:56)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.applyPreProcessors(PreProcessorExecutor.java:216)
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.processAndMerge(PreProcessorExecutor.java:105)
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.processAndMerge(PreProcessorExecutor.java:79)
    at ro.isdc.wro.model.group.processor.GroupsProcessor.process(GroupsProcessor.java:81)
    at ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator.loadValue(DefaultSynchronizedCacheStrategyDecorator.java:90)
    at ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator.loadValue(DefaultSynchronizedCacheStrategyDecorator.java:36)
    at ro.isdc.wro.cache.support.AbstractSynchronizedCacheStrategyDecorator.get(AbstractSynchronizedCacheStrategyDecorator.java:57)
    at ro.isdc.wro.manager.ResourceBundleProcessor.serveProcessedBundle(ResourceBundleProcessor.java:66)
    at ro.isdc.wro.manager.WroManager.process(WroManager.java:127)
    at ro.isdc.wro.http.WroFilter.processRequest(WroFilter.java:328)
    at ro.isdc.wro.http.WroFilter.doFilter(WroFilter.java:270)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    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:394)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    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:680)
2013-02-12 15:20:46,051 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.l.s.DispatcherStreamLocator - [FAIL] Error while dispatching the 
request for location /css/css/legacy/style-common.css
2013-02-12 15:20:46,082 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.l.ServletContextUriLocator - retrieving servletContext stream for 
uri: /css/css/legacy/style-common.css
2013-02-12 15:20:46,083 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.l.ServletContextUriLocator - [FAIL] reading resource from 
/css/css/legacy/style-common.css
2013-02-12 15:20:46,084 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.l.ServletContextUriLocator - Wrong or empty resource with location: 
/css/css/legacy/style-common.css
2013-02-12 15:20:46,084 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.g.p.PreProcessorExecutor - Invalid resource found: 
ro.isdc.wro.model.resource.Resource@500ab58d[CSS,/css/css/legacy/style-common.cs
s,true]
2013-02-12 15:20:46,084 [http-bio-8100-exec-1] ERROR 
r.i.w.m.g.p.PreProcessorExecutor - Cannot ignore missing resource:  
ro.isdc.wro.model.resource.Resource@500ab58d[CSS,/css/css/legacy/style-common.cs
s,true]
2013-02-12 15:20:46,084 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.p.d.ExceptionHandlingProcessorDecorator - Failed to process the 
resource: 
ro.isdc.wro.model.resource.Resource@4e64f6fe[CSS,/css/legacy/style.css,true] 
using processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@503bbcfd. 
Reason: Exception while reading resource from /css/css/legacy/style-common.css
2013-02-12 15:20:46,090 [http-bio-8100-exec-1] DEBUG 
r.i.w.m.r.p.d.ExceptionHandlingProcessorDecorator - Original Exception
java.io.IOException: Exception while reading resource from 
/css/css/legacy/style-common.css
    at ro.isdc.wro.model.resource.locator.ServletContextUriLocator.validateInputStreamIsNotNull(ServletContextUriLocator.java:227) ~[wro4j-core-1.6.2.jar:1.6.2]
    at ro.isdc.wro.model.resource.locator.ServletContextUriLocator.locate(ServletContextUriLocator.java:172) ~[wro4j-core-1.6.2.jar:1.6.2]
    at ro.isdc.wro.model.resource.locator.factory.InjectorAwareUriLocatorFactoryDecorator.locate(InjectorAwareUriLocatorFactoryDecorator.java:56) ~[wro4j-core-1.6.2.jar:1.6.2]
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.getResourceContent(PreProcessorExecutor.java:251) [wro4j-core-1.6.2.jar:1.6.2]
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.applyPreProcessors(PreProcessorExecutor.java:191) [wro4j-core-1.6.2.jar:1.6.2]
    at ro.isdc.wro.model.group.processor.PreProcessorExecutor.processAndMerge(PreProcessorExecutor.java:105) [wro4j-core-1.6.2.jar:1.6.2]
    at ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor.doTransform(CssImportPreProcessor.java:50) ~[wro4j-core-1.6.2.jar:1.6.2]

Original comment by dannyjro...@gmail.com on 12 Feb 2013 at 8:55

Attachments:

GoogleCodeExporter commented 9 years ago
This issue is fixed in branch 1.6.x.
Can anybody confirm that it works with your project?
Thanks!

Original comment by alex.obj...@gmail.com on 19 Feb 2013 at 5:50

GoogleCodeExporter commented 9 years ago
The cause of the problem: apparently the regex used to identify the @import 
statement was wrong. I don't understand why this problem didn't occur 
earlier... :)

Original comment by alex.obj...@gmail.com on 19 Feb 2013 at 5:51

GoogleCodeExporter commented 9 years ago
For some reason I wasn't able to reproduce the problem on 1.6.2 anymore, is 
there any specifics that causes it?

Original comment by lystoc...@gmail.com on 19 Feb 2013 at 8:18

GoogleCodeExporter commented 9 years ago
I was able to reproduce the problem when there is a css resource containing 
@import statement and has some relative url's which should be rewritten with 
cssUrlRewritingProcessor. Once the @import statements are removed and imported 
resource are referenced in the model, the problem cannot be reproduced anymore. 

@lystochok You are saying that you can't reproduce with 1.6.2. Have you 
modified anything since you've reported the problem? If yes, it would help if 
you could use initial configuration and try the snapshot version (1.6.3) to 
confirm that the problem is fixed for your test-case.

Original comment by alex.obj...@gmail.com on 19 Feb 2013 at 8:26

GoogleCodeExporter commented 9 years ago
Sorry, I couldn't reproduce it because styles were not used (were embedded into 
page itself as workaround), so now I was able to confirm again it didn't work 
in 1.6.2 BUT I'm still able to reproduce it in 1.6.3-SNAPSHOT. Attaching log.

Original comment by lystoc...@gmail.com on 19 Feb 2013 at 10:28

Attachments:

GoogleCodeExporter commented 9 years ago
Managed to reproduce the problem. The cause is the following: apparently the 
cssUrlRewriter also rewrites @import statements. Until the fix is available, 
use a different import syntax:

Instead of:

@import url("path/to/style.css");

use

@import "path/to/style.css";

I have a fix already, but need to create more unit tests to be sure that 
nothing else is broken.

Original comment by alex.obj...@gmail.com on 20 Feb 2013 at 1:53

GoogleCodeExporter commented 9 years ago
Reopening issue, until the final fix is committed.

Original comment by alex.obj...@gmail.com on 20 Feb 2013 at 1:53

GoogleCodeExporter commented 9 years ago
Fixed in 1.6.x.

@lystochok - could you try with the latest version again and confirm it works 
now?

Original comment by alex.obj...@gmail.com on 22 Feb 2013 at 2:56

GoogleCodeExporter commented 9 years ago
Thanks Alex, now I can confirm it works as required. Looking forward to new 
1.6.3 release which will be first one bugless for me :).

Original comment by lystoc...@gmail.com on 22 Feb 2013 at 7:04

GoogleCodeExporter commented 9 years ago
Bugfree software hans random features :)

Original comment by alex.obj...@gmail.com on 22 Feb 2013 at 7:54