From WebLogic to JBoss
I downloaded and installed the .sar file (clicking on the link "Download JBoss 3.2 SAR, Service Archive for 3.2, drop in deploy.") I then simply renamed my existing EJB jar file (foo.jar) to foo.wlar and dropped it the deploy directory. JBoss converted this to foo.jar and I was able to extract the jboss.xml and jbosscmp-jdbc.xml files that I needed.
I didn't run into any problems with the jboss.xml file, but I did have one problem with the jbosscmp-jdbc.xml version of the weblogic-cmp-rdms-jar.xml file. Of course, this may have been a problem with the weblogic-cmp-rdms-jar.xml (I inherited that file, I didn't create it - if I had created it, I would be SURE that that was the problem).
The relevant snippet of weblogic-cmp-rdms-jar.xml:
<weblogic-rdbms-relation>
<relation-name>conv-availActs</relation-name>
<weblogic-relationship-role>
<relationship-role-name>
AvailActRelationshipRole
</relationship-role-name>
<column-map>
<foreign-key-column>convId</foreign-key-column>
<key-column>convId</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
Gets translated to the following in jbosscmp-jdbc.xml:
<ejb-relation>
<ejb-relation-name>conv-availActs</ejb-relation-name>
<foreign-key-mapping/>
<ejb-relationship-role>
<ejb-relationship-role-name>
ConvRelationshipRole
</ejb-relationship-role-name>
<key-fields/>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>
AvailActRelationshipRole
</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>convId</field-name>
<column-name>convId</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
</ejb-relation>
And, given the original WebLogic information, that is a pretty reasonable conversion. However, in my case it generated errors of the form:
[ObjectName: jboss.j2ee:jndiName=Action,service=EJB state At least one role of a foreign-key mapped relationship must have key fields (or
The problem was that the key fields were placed in the wrong ejb-relationship-role-name. When I changed the XML to what is shown below, then everything was fine.
<ejb-relation>
<ejb-relation-name>conv-availActs</ejb-relation-name>
<foreign-key-mapping/>
<ejb-relationship-role>
<ejb-relationship-role-name>
ConvRelationshipRole
</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>convId</field-name>
<column-name>convId</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>
AvailActRelationshipRole
</ejb-relationship-role-name>
<key-fields/>
</ejb-relationship-role>
</ejb-relation>
Note: in my situation, there is a 1 to many relationship between Conv and AvailableActs (1 Conv has Many AvailableActs) - and the keys must go on the role that is referring to the "1" not to the role referring to the "many".
There is a good writeup on devx that was particularly helpful in resolving this issue.