Results 1 to 2 of 2

Thread: @Value error: SpelParseException

  1. #1

    Lightbulb @Value error: SpelParseException

    Hi Expert Community,

    I have a simple @Value annnotation code:

    Code:
    	@Value("${predef.queries.list}")
    	private String predefQueries;
    And on my properties file:

    Code:
    predef.queries.list=#{'asm':'ASM', 'tbs':'Tablespace', 'cpu':'CPU'}
    When I start the webserver I got the following error:

    Code:
    SEVERE: Servlet /capman threw load() exception
    org.springframework.expression.spel.SpelParseException: EL1041E:(pos 5): After parsing a valid expression, there is still more data in the expression: 'colon(:)'
    But when I changed the properties file value to below I don't get an error anymore.

    Code:
    predef.queries.list='asm':'ASM', 'tbs':'Tablespace', 'cpu':'CPU'
    Can you please help me how can I fix this to use my original properties file value?
    Is there a way to escape characters in properties file?

    Thanks!

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,791

    Default

    Hello

    Little confused

    Code:
    And on my properties file:
    predef.queries.list=#{'asm':'ASM', 'tbs':'Tablespace', 'cpu':'CPU'}
    in a .properties file the # start a comment

    Code:
    But when I changed the properties file value to below I don't get an error anymore.
    predef.queries.list='asm':'ASM', 'tbs':'Tablespace', 'cpu':'CPU'
    Seems fine

    what are you trying to do?
    could you post the complete error stack trace?
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •