You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "ky7333 (via GitHub)" <gi...@apache.org> on 2025/08/13 16:42:07 UTC

[I] Jasypt not finding password in application.properties [camel-quarkus]

ky7333 opened a new issue, #7632:
URL: https://github.com/apache/camel-quarkus/issues/7632

   ### Bug description
   
   Quarkus fails to start due to Jaspyt not having the password from quarkus.camel.jasypt.password passed to it. 
   
   
   To reproduce create a project from code.quarkus.io and include camel-jasypt and any other camel types to create a test route (I used timer and log) 
   
   * Fill in the required properties
   ```
   quarkus.camel.jasypt.password=password
   my.secret=MySecureRoute
   ```
   
   * Create a route file
   ```
   package org.acme;
   
   import org.apache.camel.builder.RouteBuilder;
   
   public class MySecureRoute extends RouteBuilder {
       @Override
       public void configure() {
           from("timer:tick?period=5s")
                   .to("log:com.acme.{{my.secret}}?level=DEBUG");
       }
   }
   ```
   
   * Run mvn quarkus:dev
   
   * It will fail to start with the below trace. (Trace is much longer). I Put a breakpoint in JasyptPropertiesParser and the password variable is still null when passed to nitEncryptor.
   ```
   Caused by: java.lang.IllegalArgumentException: Password cannot be set empty                                                                                                                                      
           at org.jasypt.commons.CommonUtils.validateNotEmpty(CommonUtils.java:143)                                                                                                                                 
           at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.setPassword(StandardPBEByteEncryptor.java:322)                                                                                                     
           at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.setPassword(StandardPBEStringEncryptor.java:299)                                                                                                 
           at org.apache.camel.component.jasypt.JasyptPropertiesParser.initEncryptor(JasyptPropertiesParser.java:79)                                                                                                
           at org.apache.camel.component.jasypt.JasyptPropertiesParser.parseProperty(JasyptPropertiesParser.java:59)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Jasypt not finding password in application.properties [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton closed issue #7632: Jasypt not finding password in application.properties
URL: https://github.com/apache/camel-quarkus/issues/7632


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Jasypt not finding password in application.properties [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #7632:
URL: https://github.com/apache/camel-quarkus/issues/7632#issuecomment-3187359548

   So this change to `LazySecretKeysHandler` means that the Jasypt encryptor will only get configured on the first attempt to  resolve an encrypted property.
   
   So if you change `application.properties` to the following, the application should start successfully:
   
   ```
   # Encrypted value for the string 'Some secret content'
   my.secret=ENC(ya2PsdW1DMbpDpMMZsdcnY2kWUacqvHKgj5fka/TRGI=)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Jasypt not finding password in application.properties [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #7632:
URL: https://github.com/apache/camel-quarkus/issues/7632#issuecomment-3188303599

   I made a change so that if there are no `ENC(...)` property values configured, the application will start successfully.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Jasypt not finding password in application.properties [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #7632:
URL: https://github.com/apache/camel-quarkus/issues/7632#issuecomment-3187139740

   Thanks for reporting this. Seems the extension has been broken for some time and we've not noticed because our tests are passing (not sure how / why yet). It's maybe due to this change https://github.com/apache/camel-quarkus/commit/415d6eed26bb6a677faff0fbd978dbbbe12e400d. It needs investigating.
   
   The workaround is to set `quarkus.camel.jasypt.enabled=false`, which allows you to use the vanilla Camel Jasypt component behaviour.
   
   https://camel.apache.org/camel-quarkus/next/reference/extensions/jasypt.html#extensions-jasypt-usage-disabling-automatic-jasypt-configuration


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org