Q: 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
or if you have checked jboss out of cvs they are at
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)
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=PostgresDS</module-option>
<application-policy name = "PostgresDbRealm">
Everything else can be considered "Advanced Configuration"
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.
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.
I've been dealing with some of the same problems on 3.0. The conf, log and deploy directories have recently been moved. They're now at:
My simple J2EE application is made up of 2 components...one containing a couple of EJBs and one containing a Web application (containing a couple of servlets plus html pages and WEB-INF directory).
They have been packaged as a JAR file and WAR file respectively. They can both be deployed in jboss/deploy with seemingly no problem (in fact I can view the HTML pages in the WAR file no problem)
However, when I attempt to package the above as an EAR file it has the following structure:
0 Mon Apr 08 16:38:16 BST 2002 META-INF/
68 Mon Apr 08 16:38:16 BST 2002 META-INF/MANIFEST.MF
5397 Mon Apr 08 16:22:38 BST 2002 NameAge.jar
5781 Mon Apr 08 16:23:42 BST 2002 NameAge.war
368 Fri Apr 05 16:30:20 BST 2002 META-INF/application.xml
which seems OK to me(?)
BUT, when I deploy this EAR file I get an HTTP500 error when attempting to access one of the HTML pages as before.
The only thing I can think is wrong is with META-INF/application.xml.........it's contents are:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
the postgresql string example in the configuration is slightly misleading. The line :
should infact be :
Also, IMHO, the XML syntax can be improved a little:
You could have
<config-property name="Connection URL" type="java.lang.String"> VALUE </config-property>
It would make it easier to eid and less prone to errors
Thanks for the correction for postgres. I'll fix it.
I like your xml suggestion as well, however the current xml matches the ra.xml format. I have plans of merging user conf with the ra.xml using xslt... I will think about whether this can be done easily enough with the improved xml syntax you suggest. Probably yes;-)
I also had to copy the JDBC driver (postgresql.jar for Postgres) to jboss-3.0.0RC1\lib, presumably because it's not specified in the configuration file the way it was for beta 2. Without that I got a ClassNotFoundException.
I should retitle this
I've removed the old local jdbc wrapper and modified all the example config files to use its replacement. I also took Steveco's suggestion about easier to read xml syntax.
If you have a config file for a local tx datasource (NOT XA!!!) the minimum conversion necessary is to replace
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
The xa config remains unchanged.
I've grabbed the latest oracle-service.xml from cvs & cannot manage to get it working. I've followed all the steps below but still cannot get it working.
I'm attaching my oracle-service.xml file and login-conf.xml. Well actually I'm not because the attach files facility is NOT working. I'm having a fantastc day!
Here's the exception I get. Can anyone help?
16:28:08,074 INFO [MainDeployer] Starting deployment of package: file:/E:/J
16:28:08,354 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=Orac
does not implement any Service methods
16:28:08,354 INFO [LocalTxConnectionManager] Creating
16:28:08,364 INFO [LocalTxConnectionManager] Created
16:28:08,364 INFO [LocalTxConnectionManager] Starting
16:28:08,384 ERROR [LocalTxConnectionManager] Starting failed
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at $Proxy0.start(Unknown Source)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at $Proxy3.start(Unknown Source)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
This isn't problem 1 or 2. The oracle-service.xml from cvs already has the right names. I jusr copied and pasted it.
Here is my setup for Cloudscape that works:
sgturner-- a jboss 2.x db config is unfortunately completely useless for any 3.0 version.
--Do you have rc2 or later? if not, start by upgrading. I'm not sure of the exact code you have, but it looks like it is looking for the transaction manager in jndi. Is it bound? Do you have the transaction manager attribute there and set?
My Bad. My contribution of cloudscape stuff was premature. I started down the path of upgrading my app from 2.4.5 to 3.0.0RC1 and never finished the upgrade.
I have now switched to 3.0.0RC2 and am working to upgrade my app to the new JBoss. When I finish, I will post my XML file for cloudscape db.
Sorry for my confusing things.
Thanks, no problem, looking forward to the config file.
I folowed your steps to set up a Datasource for Postgres.
Could you plase tell me what the warning mean that i get when i start JBoss. (PostgresDS does not implement any Service methods)
Im Using JBoss 3.0 on SuSe Linux 8.0
Here ist the Output:
22:15:33,657 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=PostgresDS does not implement any Service methods
22:15:33,659 INFO [JBossManagedConnectionPool] Creating
22:15:33,659 INFO [JBossManagedConnectionPool] Created
22:15:33,663 INFO [JBossManagedConnectionPool] Starting
22:15:33,686 INFO [JBossManagedConnectionPool] Started
22:15:33,688 INFO [MainDeployer] Successfully completed deployment of package: file:/usr/jboss/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/postgres-service.xml
As there are more of these WARNs when JBoss is started,
i posted the question here.
Thanks and rgds!