[JBoss AS 7 Development] - How to configure datasource with encrypted password
by brian essen
brian essen [http://community.jboss.org/people/bessen] created the discussion
"How to configure datasource with encrypted password"
To view the discussion, visit: http://community.jboss.org/message/640189#640189
--------------------------------------------------------------
JBoss AS 7.1.Beta1
I want to configure an Oracle datasource with an encrypted password but always receives invalid username/password error. Here is my configuration:
| | <datasource jndi-name="java:/oracleds" pool-name="oracleds" enabled="true" jta="false" use-ccm="false"> |
| | <connection-url> |
| | jdbc:oracle:thin:@host:1521:sid |
| | </connection-url> |
| | <driver> |
| | oracle |
| | </driver> |
| | <security> |
| | <security-domain> |
| | encrypted-oracleds |
| | </security-domain> |
| | </security> |
| | </datasource> |
password encrypted with PicketBox's SecureIdentifyLoginModule
| | <security-domain name="encrypted-oracleds" cache-type="default"> |
| | <authentication> |
| | <login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required"> |
| | <module-option name="username" value="dbuser"/> |
| | <module-option name="password" value="1db2c949438bd043ed413fe8bbfc9ec6"/> |
| | <module-option name="managedConnectionFactoryName" value="jboss.jca:service=LocalTxCM,name=oracleds"/> |
| | </login-module> |
| | </authentication> |
| | </security-domain> |
I keep getting the following Oracle error. I think somehow the passed-in username/password does not match the one I provided.
Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:452)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:392)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:384)
at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:657)
at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:433)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:471)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:199)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:365)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:812)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:411)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:547)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:225)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:556)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnect
ionFactory.java:249)
... 139 more
If I use username and password in the datasource config, everything works fine.
Please let me know what I have done incorrectly.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640189#640189]
Start a new discussion in JBoss AS 7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 5 months
[JBoss Transactions Development] - Disable XA-Transaction in JMS-Datasource using OpenMQ
by Jürgen Kunz
Jürgen Kunz [http://community.jboss.org/people/gengar9] created the discussion
"Disable XA-Transaction in JMS-Datasource using OpenMQ"
To view the discussion, visit: http://community.jboss.org/message/640084#640084
--------------------------------------------------------------
Hi everyone,
I need a third party JMS-Broker with C/C++ support and therefore I evaluate ActiveMQ and OpenMQ. I can integrate both MessageBrokers into JBoss 6.1.0-Final. Because of our requirements I need to switch off <xa-transaction> if I'm using a transactional connection factory because I have to comit the JMS Session to flush the JMS messages. After that I need to immediatly call a receive to wait for the response over a temporary queue. This works as I expected with ActiveMQ but with OpenMQ it won't work and I get the error:
*javax.jms.TransactionInProgressException: [C4069]: Cannot perform commit or rollback on an XASession.*
Here ist the configuration in imqjms-jms-ds.xml for OpenMQ. There is no <xa-transcation> within the <tx-connection-factory> config:
<tx-connection-factory>
<jndi-name>imqjms/QueueConnectionFactory</jndi-name>
<track-connection-by-tx/>
<rar-name>imqjms-ra.rar</rar-name>
<connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
<ServerUrl>localhost:7676/</ServerUrl>
<min-pool-size>1</min-pool-size>
<max-pool-size>200</max-pool-size>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>3</idle-timeout-minutes>
</tx-connection-factory>
The same is here for ActiveMQ which works pretty well:
<no-tx-connection-factory>
<jndi-name>activemq/QueueConnectionFactory</jndi-name>
<track-connection-by-tx/>
<rar-name>activemq-ra.rar</rar-name>
<connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
<ServerUrl>tcp://localhost:61616</ServerUrl>
<min-pool-size>1</min-pool-size>
<max-pool-size>200</max-pool-size>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>3</idle-timeout-minutes>
</no-tx-connection-factory>
And here is my code that uses the datasources.
Destination replyDest = session.createTemporaryQueue();
consumer = session.createConsumer(replyDest);
Message m = session.createTextMessage(message);
// fill message ....
m.setJMSReplyTo(replyDest);
producer.send(m);
session.commit();
Message response = consumer.receive(timeout);
if (response instanceof TextMessage) {
result = ((TextMessage)response).getText();
.....
Offcourse I canconfigure the datasource of the ConnectionFactory with <no-tx-connection-factory> and I don't need to commit the JMS session for sending messages. But I really want to know why it works with OpenMQ and not with ActiveMQ. *So, how can I disable xa-transactions with the OpenMQ message provider?*
Thanks a lot for every answer.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640084#640084]
Start a new discussion in JBoss Transactions Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 5 months