Leonardo Reis created AMQ-8595:
----------------------------------

             Summary: activemq-security.xml not working 
                 Key: AMQ-8595
                 URL: https://issues.apache.org/jira/browse/AMQ-8595
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.15.13
            Reporter: Leonardo Reis


Error starting broker  "bin/activemq start xbean:conf/activemq-security.xml" no 
process is spawned, unable to continue. Im respecting the documentation 
(http://activemq.apache.org/encrypted-passwords.html) 
inserting the encrypted password in the credential-enc.properties file:

 

----------------------------------------------activemq.log----------------------------------------------------------------------------------

2022-05-04 09:51:12,337 | ERROR | Failed to load: class path resource 
[conf/activemq-security.xml], reason: IOException parsing XML document from 
class path resource [conf/activemq-security.xml]; nested exception is 
java.io.FileNotFoundException: class path resource [conf/activemq-security.xml] 
cannot be opened because it does not exist | 
org.apache.activemq.xbean.XBeanBrokerFactory | main
org.springframework.beans.factory.BeanDefinitionStoreException: IOException 
parsing XML document from class path resource [conf/activemq-security.xml]; 
nested exception is java.io.FileNotFoundException: class path resource 
[conf/activemq-security.xml] cannot be opened because it does not exist
    at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)[spring-beans-4.3.26.RELEASE.jar:4.3.26.RELEASE]
    at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)[spring-beans-4.3.26.RELEASE.jar:4.3.26.RELEASE]
    at 
org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)[xbean-spring-4.17.jar:4.17]
    at 
org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)[xbean-spring-4.17.jar:4.17]
    at 
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)[spring-context-4.3.26.RELEASE.jar:4.3.26.RELEASE]
    at 
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:614)[spring-context-4.3.26.RELEASE.jar:4.3.26.RELEASE]
    at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:514)[spring-context-4.3.26.RELEASE.jar:4.3.26.RELEASE]
    at 
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-4.17.jar:4.17]
    at 
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-4.17.jar:4.17]
    at 
org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.13.jar:5.15.13]
    at 
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.15.13.jar:5.15.13]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_301]
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_301]
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_301]
    at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_301]
    at 
org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.15.13]
    at 
org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.15.13]

---------------------------------------------------file configuration 
activemq-security------------------------------------------

 

<bean id="environmentVariablesConfiguration" 
class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWithMD5AndDES" />
<property name="passwordEnvName" value="ACTIVEMQ_ENCRYPTION_PASSWORD" />
</bean>
<bean id="configurationEncryptor" 
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config" ref="environmentVariablesConfiguration" />
</bean> 
<bean id="propertyConfigurer" 
class="org.jasypt.spring4.properties.EncryptablePropertyPlaceholderConfigurer">
<constructor-arg ref="configurationEncryptor" /> 
<property name="location" 
value="file:${activemq.conf}/credentials-enc.properties"/> 
</bean>
 

<bean id="requiredBeanForOracleAq" 
class="org.apache.activemq.ActiveMQConnectionFactory"/>
<bean id="connectionFactoryOracleAQQueue" class="oracle.jms.AQjmsFactory" 
factory-method="getQueueConnectionFactory">
<constructor-arg index="0">
<value>jdbc:oracle:thin:@(description=(address=(protocol=TCP)(host=localhost)(port=1521))(connect_data=(service_name=sid_db)))</value>
</constructor-arg>
<constructor-arg index="1" type="java.util.Properties">
<value></value>
</constructor-arg>
</bean>
<bean id="oracleQueueCredentials" 
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory">
<ref bean="connectionFactoryOracleAQQueue"></ref>
</property>
<property name="username">
<value>user</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
</bean>
<bean id="oracleQueue" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="oracleQueueCredentials"/>
</bean>

<transportConnectors>
<transportConnector name="openwire" 
uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=103857600"/>
<transportConnector name="amqp" 
uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=103857600"/>
<transportConnector name="stomp" 
uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=103857600"/>
<transportConnector name="mqtt" 
uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=103857600"/>
<transportConnector name="ws" 
uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=103857600"/>
</transportConnectors>

 

-----------------------------------------------------------------------------------------------------------------------------------------------------

the procedure was strictly followed confirm website documentation 
http://activemq.apache.org/encrypted-passwords.html

 

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to