You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Awad Shalak <aw...@gmail.com> on 2015/09/01 10:59:22 UTC

Encrypting password with different key not working

Hi All,

I followed the instruction under
http://activemq.apache.org/encrypted-passwords.html and it worked perfectly
using Apache 5.11.0 just i made a modification to use
org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer
instead of
org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer.
Now i m trying to encrypt the password with a different key then activemq,
The encryption and decryption worked perfectly through command line but when
i put the credential in the credential-enc.properties and launch activemq i
got the following error:

jvm 1    |  INFO | Loading properties file from URL
[file:../../conf/credentials-enc.properties]
jvm 1    | ERROR: java.lang.RuntimeException: Failed to execute start task.
Reason: org.jasypt.exceptions.EncryptionOp
jvm 1    | java.lang.RuntimeException: Failed to execute start task. Reason:
org.jasypt.exceptions.EncryptionOperation
jvm 1    |      at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
jvm 1    |      at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
jvm 1    |      at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
jvm 1    |      at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
jvm 1    |      at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at
org.apache.activemq.console.Main.runTaskClass(Main.java:262)
jvm 1    |      at org.apache.activemq.console.Main.main(Main.java:115)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at
org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
jvm 1    | Caused by:
org.jasypt.exceptions.EncryptionOperationNotPossibleException
jvm 1    |      at
org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1055)
jvm 1    |      at
org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)
jvm 1    |      at
org.jasypt.properties.PropertyValueEncryptionUtils.decrypt(PropertyValueEncryptionUtils.java:72)
jvm 1    |      at
org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer.convertPropertyValue(Encryp
er.java:109)
jvm 1    |      at
org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperty(PropertyResourc
jvm 1    |      at
org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperties(PropertyResou
jvm 1    |      at
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(Property
jvm 1    |      at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(Abst

jvm 1    |      at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(Abst

jvm 1    |      at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.j
jvm 1    |      at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.
jvm 1    |      at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.
jvm 1    |      at
org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
jvm 1    |      at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
jvm 1    |      at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
jvm 1    |      at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
jvm 1    |      at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
jvm 1    |      at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
jvm 1    |      ... 16 more
jvm 1    | ERROR:
org.jasypt.exceptions.EncryptionOperationNotPossibleException
jvm 1    | org.jasypt.exceptions.EncryptionOperationNotPossibleException
jvm 1    |      at
org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1055)
jvm 1    |      at
org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)
jvm 1    |      at
org.jasypt.properties.PropertyValueEncryptionUtils.decrypt(PropertyValueEncryptionUtils.java:72)
jvm 1    |      at
org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer.convertPropertyValue(Encryp
er.java:109)
jvm 1    |      at
org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperty(PropertyResourc
jvm 1    |      at
org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperties(PropertyResou
jvm 1    |      at
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(Property
jvm 1    |      at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(Abst

jvm 1    |      at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(Abst

jvm 1    |      at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.j
jvm 1    |      at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.
jvm 1    |      at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.
jvm 1    |      at
org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
jvm 1    |      at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
jvm 1    |      at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
jvm 1    |      at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
jvm 1    |      at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
jvm 1    |      at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
jvm 1    |      at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
jvm 1    |      at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
jvm 1    |      at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
jvm 1    |      at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at
org.apache.activemq.console.Main.runTaskClass(Main.java:262)
jvm 1    |      at org.apache.activemq.console.Main.main(Main.java:115)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at
org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
wrapper  | <-- Wrapper Stopped

Any suggestion to solve this problem or i m not able to change the
encryption key?

Thanks in advance
Awad





--
View this message in context: http://activemq.2283324.n4.nabble.com/Encrypting-password-with-different-key-not-working-tp4701572.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.