Re: [wro4j] StackOverflowError when going from less to cs with lessCss

325 views
Skip to first unread message
Message has been deleted

Alex Objelean

unread,
Nov 30, 2012, 2:11:17 AM11/30/12
to wr...@googlegroups.com

Could you show the content of wro.properies file?

A possible cause can be a css minimization processor which can be replaced with another one.

Alex

On Nov 30, 2012 8:36 AM, "DBarbarian" <danielb...@yahoo.se> wrote:
We have a project built through maven and I am constructing a build time construction of the css files we have based on less files. However when I run the compilation I get a StackOverflowError. I am not the developer of the less file myself so I dnon't know the full extent of its usage but we have managed to minimize it to a bare minimum of how to reproduce the error. Note that the usage will be much more complicated than the example given. The less variables are to be used in iterations so I doubt that alternate solutions can help us. But why are we running into StackOverflowErrors?

main.less:
@x: 0px;
@y: 0px;
@z: @y + @x;
@x: @y + @x;


wro.xml
<?xml version="1.0" encoding="UTF-8"?>
<groups xmlns="http://www.isdc.ro/wro">
  <group name="all-styles">
    <css>/common/styles/main.less</css>
  </group>
</groups>

Excerpt from our pom.xml:
    <build>
        <plugins>
            <plugin>
                <groupId>ro.isdc.wro4j</groupId>
                <artifactId>wro4j-maven-plugin</artifactId>
                <version>1.6.1</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <cssDestinationFolder>${basedir}/src/main/webapp/common/styles</cssDestinationFolder>
                    <jsDestinationFolder>${basedir}/src/main/webapp/common/js</jsDestinationFolder>
                     <ignoreMissingResources>false</ignoreMissingResources>
                    <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
                    <extraConfigFile>${basedir}/src/main/config/wro.properties</extraConfigFile>
                     <wroFile>${basedir}/src/main/config/wro.xml</wroFile>
                </configuration>
            </plugin>
        </plugins>
    </build>

Finally the stack trace (cut):
Exception in thread "main" java.lang.StackOverflowError
    at org.mozilla.javascript.ScriptRuntime.createFunctionActivation(ScriptRuntime.java:3273)
    at org.mozilla.javascript.Interpreter.initFrame(Interpreter.java:2685)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:849)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2463)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1567)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
[...] repeated over and over
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
    at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
    at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
    at ro.isdc.wro.extensions.script.RhinoScriptBuilder.evaluate(RhinoScriptBuilder.java:191)
    at ro.isdc.wro.extensions.processor.support.less.LessCss.less(LessCss.java:89)
    at ro.isdc.wro.extensions.processor.css.RhinoLessCssProcessor.process(RhinoLessCssProcessor.java:131)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.resource.processor.decorator.LazyProcessorDecorator.process(LazyProcessorDecorator.java:53)
    at ro.isdc.wro.extensions.processor.css.LessCssProcessor.process(LessCssProcessor.java:63)
    at ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator.process(ProcessorDecorator.java:87)
    at ro.isdc.wro.model.resource.processor.decorator.LazyProcessorDecorator.process(LazyProcessorDecorator.java:53)
    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:68)
    at ro.isdc.wro.manager.WroManager.process(WroManager.java:127)
    at ro.isdc.wro.maven.plugin.Wro4jMojo.processGroup(Wro4jMojo.java:214)
    at ro.isdc.wro.maven.plugin.Wro4jMojo.doExecute(Wro4jMojo.java:116)
    at ro.isdc.wro.maven.plugin.AbstractWro4jMojo.execute(AbstractWro4jMojo.java:133)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To view this discussion on the web visit https://groups.google.com/d/msg/wro4j/-/5QtHW3wVELgJ.
To post to this group, send email to wr...@googlegroups.com.
To unsubscribe from this group, send email to wro4j+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wro4j?hl=en.

Alex Objelean

unread,
Dec 3, 2012, 12:58:27 PM12/3/12
to wr...@googlegroups.com
I've tested the less content you have posted, more precisely this one:

@x: 0px;
@y: 0px;
@z: @y + @x;
@x: @y + @x;

and it fails with the following online compilers: http://lesstester.com/ & http://winless.org/online-less-compiler

Apparently this is a less compiler bug, rather than a wro4j bug. 

You could try to use less4j which is a java implementation of less compiler.

Alex

On Monday, 3 December 2012 10:13:12 UTC+2, DBarbarian wrote:
My wro.properties
preProcessors=lessCss
postProcessors=cssMinJawr,uglifyJs,semicolonAppender

Alex Objelean

unread,
Dec 4, 2012, 7:22:36 AM12/4/12
to wr...@googlegroups.com
The latest version of less4j is 0.0.5 which works as expected for your test-case. If you want to use latest version of less4j you have two options:
1) Create a custom less4j processor which uses the latest dependency of less4j (which has changed API and is incompatible with the one from 0.0.4).
2) Wait for next release of wro4j (probably in january, unless nothing critical comes up).

Cheers,
Alex

On Tuesday, December 4, 2012 2:14:06 PM UTC+2, DBarbarian wrote:
Actually I am in the process of testing less4j, but I am running into other problems there. I will post that in a separate question though if I can't find the solution.

Thanks for the help.

DBarbarian

unread,
Dec 4, 2012, 8:09:38 AM12/4/12
to wr...@googlegroups.com
Actually, the code snippet in this case works fine in less4j 0.0.4 as well, but I have other compiling issues (there are much more code) when using less4j. I will try to bring this up with less4j.

Alex Objelean

unread,
Dec 4, 2012, 8:11:42 AM12/4/12
to wr...@googlegroups.com
There are many improvements in version 0.0.5. If you have any problems, you can open issues on less4j project homepage: https://github.com/SomMeri/less4j
Early adoption of that framework would help it a lot to become more mature and reliable.

Cheers,
Alex


--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To view this discussion on the web visit https://groups.google.com/d/msg/wro4j/-/mlyKPaFlXtEJ.
Reply all
Reply to author
Forward
0 new messages