Q: HELP! My DataSource Is Broken in 3.0 RC1!
davidjencks Apr 18, 2002 3:10 PMQ: HELP! My DataSource Is Broken in 3.0 RC1!
A: Several people have been confused by the configuration changes present in JBoss 3.0 RC1. I'll attempt to explain what to do to set up a working configuration.
Please remember that what you are configuring is a complete replacement for the previous system(s), it is new, I am trying to make it easier to use, and I'm changing the sample configuration files fairly frequently in attempts to make what is going on more clear. The new configuration is unrelated to the old configuration so it is easier to start over than try to modify an old file.
First of all, the most recent sample configuration files are in cvs, not the RC1 binary download. You can view them at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosscx/src/etc/example-config/
or if you have checked jboss out of cvs they are at
connector/src/etc/example-config/
If you get a working configuration for a database or other resource adapter (such as SAP R/3) please contribute it.
If there is an example for your database, start with it.
Fill in the ConnectionURL to point to your database. If you are using a JDBC 1 driver, you may want to check that the URL is correct using a small standalone test program or other external tool.
Set the JndiName property to what you want the DataSource to be bound under in the java:/ context.
Assuming you want everyone logged in to the db as the same user, copy the xml snippet <application-policy-name.... from the comment near the end and put it in your login-conf.xml file. Fill in the appropriate username and password. The principal can be the same as the username.
Double and triple check that the following match:
name="xxx" from the <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=PostgresDS">
(normally the first mbean in the file)
MUST MATCH
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=PostgresDS</module-option>
AND
java:/jaas/PostgresDbRealm
MUST MATCH
<application-policy name = "PostgresDbRealm">
Everything else can be considered "Advanced Configuration"
PROBLEMS:
1. If you get log messages about trying to log in using UserRolesLoginModule, this means the second match, between the realm name, is not set up properly.
2. If you get log messages about username=null and invalid login attempts, this means that the first match is is not set up correctly and the object names are different.
Notes:
Some databases do not allow you to specify username and password. In this case remove the SecurityDomainJndiName element.
If you want CallerIdentity security, there is a login module for that purpose in cvs.
For any real installation, obviously you will have to tune the pooling parameters. Please try out the documentation you can get by compiling build/build.sh all and looking in the jmx-api directory.
Thanks. Suggestions on how to improve the configuration process and setup are appreciated.