I get the error message "jboss.jca,name=JndiName,service=LocalTxCM
specified in a ConfiguredIdentityLoginModule could not be found. ConnectionFactory will be unusable!"
Question
I've configured my login module on a JBossJCA connection factory or datasource and I receive the above error message.
Symptom
Every time I access this resource it throws a SecurityException.
Answer
The answer is you have wrong name for the connection factory (really connection manager) in the configuration.
Unfortunately the name varies according to type as described on the JCA login module page.
Most of the examples are for local datasources, i.e. local-tx-datasource
jboss.jca:servce=LocalTxCM,name=DefaultDS
But if this was an xa-datasource it would be
jboss.jca:servce=XATxCM,name=DefaultDS
Or a no-tx-datasource
jboss.jca:servce=NoTxCM,name=DefaultDS
For connection factories it has a different pattern, transactional, i.e. tx-connection-factory
jboss.jca:service=TxCM,name=JndiName
non-transactional, i.e. no-tx-connection-factory
jboss.jca:service=NoTxCM,name=JndiName
Example
Here's a real example from the default configuration that makes users of java:/JmsXA login as guest/guest to the jms server.
<application-policy name = "JmsXARealm"> <authentication> <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"> <module-option name = "principal">guest</module-option> <module-option name = "userName">guest</module-option> <module-option name = "password">guest</module-option> <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option> </login-module> </authentication> </application-policy>
Related:
Comments