0 Replies Latest reply on Apr 25, 2014 1:39 PM by schellinger

    Using JASYPT In Camel Contexts

    schellinger

      I have 2 questions about using JASYPT for property file value encryption in Camel using Blueprint in Fuse 6.1.  The first question is about which direction I should take when implementing this, and the second is errors I'm getting using both options.

       

      So if I understand this correctly, I have 2 options:

       

      1.  I can use org.apache.camel.component.jasypt.JasyptPropertiesParser with org.apache.camel.component.properties.PropertiesComponent all wrapped up under the camel-jasypt (2.12.0) dependency.  See the snippet below:

       

        <bean id="configProperties" class="org.apache.camel.component.properties.PropertiesComponent">

          <property name="location" value="classpath:activeMQ.properties"/>

          <property name="propertiesParser" ref="jasypt"/>

        </bean>

       

        <cxf:cxfEndpoint id="reportEndpoint"

                         address="/report/"

                         serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"

                         wsdlURL="wsdl/report_incident.wsdl"/>

       

        <broker:broker persistent="true" brokerName="amqBroker">

          <broker:transportConnectors>

            <broker:transportConnector uri="tcp://${activeMQ.url}"/>

          </broker:transportConnectors>

        </broker:broker>

       

      2.  I can use property-placeholder from blueprint-ext and property-placeholder from jasypt all wrapped up under the org.jasypt (1.9.2) dependency.  It uses org.jasypt.encryption.pbe.StandardPBEStringEncryptor.

       

      The first problem I have with #1 is it doesn't seem to allow me to use ${xxxxx} outside of the context.  I tried using an unencrypted ActiveMQ URL in my properties file, but when I tried using it to configure my connection outside of the context using ${activeMQ.url}, it wasn't replaced.  When I used {{activeMQ.queueName}} inside the context, it worked great.

       

      The problem I have with #2 is a ClassNotFoundException on org.jasypt.encryption.pbe.StandardPBEStringEncryptor.  I have this dependency in my POM:

       

      <dependency>
          <groupId>org.jasypt</groupId>
          <artifactId>jasypt</artifactId>
          <version>1.9.2</version>
      </dependency>

       

      But I don't see the JAR Fuse would need to resolve that class.  What am I missing there?  Also, in terms of the problem I'm having with option #1, can I use ${xxx} syntax outside of the context for encrypted property values?

       

      Thanks for your input.

       

      Shawn