Wayne Earnshaw
Wayne Earnshaw

Reputation: 527

"LESS Engine initialization failed"

I'm using the LESS CSS Engine to reformat CSS, but I receive a slightly unhelpful message when starting our app. A "Property already exists" but which one? Hoping somebody has a good idea on how to track that down cheers...

2012-12-03 12:57:34,020 [Thread-2] DEBUG com.asual.lesscss.LessEngine- Initializing LESS Engine.
2012-12-03 12:57:34,066 [Thread-2] DEBUG com.asual.lesscss.LessEngine- Using implementation version: Rhino 1.6 release 6 Pre 2007 11 13
2012-12-03 12:57:34,095 [Thread-2] ERROR com.asual.lesscss.LessEngine- LESS Engine intialization failed.
java.lang.RuntimeException: Property already exists
    at org.mozilla.javascript.ScriptableObject.defineProperty(Unknown Source)
    at org.mozilla.javascript.LazilyLoadedCtor.<init>(Unknown Source)
    at org.mozilla.javascript.ScriptRuntime.initStandardObjects(Unknown Source)
    at org.mozilla.javascript.Context.initStandardObjects(Unknown Source)
    at org.mozilla.javascript.Context.initStandardObjects(Unknown Source)
    at com.asual.lesscss.LessEngine.<init>(LessEngine.java:67)
    at com.asual.lesscss.LessEngine.<init>(LessEngine.java:51)

Upvotes: 2

Views: 815

Answers (2)

Horcrux7
Horcrux7

Reputation: 24447

This error occur if you use a very old rhino runtime (rs.jar).

Upvotes: 0

Wayne Earnshaw
Wayne Earnshaw

Reputation: 527

This was a very surprising find. It was one of the 2 following dependencies I removed from our Maven POM (I compared with another project where this wasn't happening and tried removing unused dependencies from this legacy app being upgraded a couple at a time)... I've tested adding these again and it caused the same issue in LessEngine. This was tested with lesscss-engine v1.3.0 (which depends on rhino 1.7R3).

    <dependency>
        <groupId>org.apache.xmlgraphics</groupId>
        <artifactId>fop</artifactId>
        <version>0.95</version>
    </dependency>
    <dependency>
        <groupId>jtidy</groupId>
        <artifactId>jtidy</artifactId>
        <version>r8-20050104</version>
    </dependency>

Upvotes: 2

Related Questions