2 Replies Latest reply: May 7, 2012 12:38 PM by Celer RSS

    Error whilst parsing css file, what line?

    Celer
      All I get this error when starting my application after jar upgrades on jfx
      WARNING: com.sun.javafx.css.parser.CSSParser linearGradient Using deprecated syntax for linear gradient at jar:file:/C:/win-image/lib/themes.jar!/com/client/themes/celer_style_blue.css[2285,31]. Refer to the CSS Reference Guide
      WARNING: com.sun.javafx.css.parser.CSSParser linearGradient Using deprecated syntax for linear gradient at jar:file:/C:/win-image/lib/themes.jar!/com/client/themes/celer_style_blue.css[2367,34]. Refer to the CSS Reference Guide
      WARNING: com.sun.javafx.css.parser.CSSParser linearGradient Using deprecated syntax for linear gradient at jar:file:/C:/win-image/lib/themes.jar!/com/client/themes/celer_style_blue.css[2501,31]. Refer to the CSS Reference Guide
      WARNING: com.sun.javafx.css.parser.CSSParser linearGradient Using deprecated syntax for linear gradient at jar:file:/C:/win-image/lib/themes.jar!/com/client/themes/celer_style_blue.css[2505,31]. Refer to the CSS Reference Guide
      WARNING: com.sun.javafx.css.parser.CSSParser declaration Expected '<number>' while parsing '-fx-font' at jar:file:/C:/win-image/lib/themes.jar!/com/client/themes/celer_style_blue.css[2589,22]
      Is it line 31,34?

      The last one says something about a number -fx-font so I check line 22

      line 22 has -fx-background-radius: 3;
        • 1. Re: Error whilst parsing css file, what line?
          jsmith
          The content below is quoted directlu from the css reference: (http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html)
          Understanding Parser Warnings

          When the JavaFX CSS parser encounters a syntax error, a warning message is emitted which conveys as much information as is available to help resolve the error. For example

          WARNING: com.sun.javafx.css.parser.CSSParser declaration Expected '<percent>' while parsing '-fx-background-color' at ?[1,49]

          The cryptic '?[1,49]' pertains to the location of the error. The format of the location string is

          <url>[line, position]

          If the error is found while parsing a file, the file URL will be given. If the error is from an inline style (as in the example above), the URL is given as a question mark. The line and position give an offset into the file or string where the token begins. Note well! The lexer does a poor job of counting lines and characters. The line and position may not be accurate. This should be resolved in a future release.

          Applications needing to detect errors from the parser can add a listener to the errors property of com.sun.javafx.css.StyleManager. This is not public API and is subject to change.
          Which means that your first error is on line 2285, column 31, unless of course the lexer has done "a poor job of counting lines and characters" . . .
          If your css file is actually short, rather than thousands of lines, post it here and somebody could take a look at it.
          • 2. Re: Error whilst parsing css file, what line?
            Celer
            Thank yes I saw that, the only problem is my css contains 1600 lines.