I am trying to get a simple 1:n container-managed relationship to work (JBoss 3.0.0alpha). It seems that it is not sufficient to define the relationships in ejb-jar.xml. Though everything deploys without any error messages, no foreign keys fields appear in the generated database tables, and trying to access any of the relationships fields fails.
If I create a jbosscmp-jdbc.xml file and define the relationships there, I get an error while deploying. Note that I double-checked that the names used were the same in both files.
[...] org.jboss.ejb.DeploymentException: Configuration found in jbosscmp-jdbc.xml for relation ProviderBean-ServiceBean but relation is not a jbosscmp-jdbc-managed relation in ejb-jar.xml [...]
Problem solved. I had mistakenly declared the inside <enterprise-beans> instead of at the level of <ejb-jar> in the ejb-jar.xml. Time for a validating XML editor...