Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SimpleParserException: Unknown function: property.fileName

I'm using Apache Camel 3.0 and I'm getting this error when parsing the file:

    from("file:" + filePath)
            .routeId("create-ticket")
            .unmarshal(ticketCsv)
            .to("jpa:Ticket")
            .log("Created new ticket with id ${body.id}")
            .convertBodyTo(String.class)
            .setProperty("fileName", simple("${header.CamelFileAbsolutePath}"))
            .setProperty("fileContents", body())
            .to("sql:INSERT INTO DOCUMENT(document_name, document_contents) VALUES(:#${property.fileName}, :#${property.fileContents})");

Exception:

org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Unknown function: property.fileName at location 0 ${property.fileName}

like image 388
uzx79024 Avatar asked Aug 10 '26 21:08

uzx79024


1 Answers

${property.xxx} is deprecated in 2.x. Use ${exchangeProperty.xxx} which is the correct name for the function.

More changes can be found in the migration guide

like image 58
Claus Ibsen Avatar answered Aug 14 '26 10:08

Claus Ibsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!