Did you ever find out the answer? If yes, can you let me know? I have to do similar thing....
I too am researching mixing EJB 2.1 and 3.0 Beans in the same .jar file. I have verified that you can mix EJB2.1 SLSB and EJB3 SLSB in the same .jar file. Unit tests verified that they work perfectly together.
HOWEVER, currently I am not able to mix EJB2.1 entities with EJB3 entities.
* If persistence.xml is placed inside the .jar file, then the EJB3 deployer kicks in and only EJB3 entity beans are deployed.
* If I remove the persistence.xml file, then the normal deployment takes place and only my EJB2.1 entity beans are deployed.
It would be really really great if someone could shed light on this issue. I'm sure there are many of us who want to upgrade to EJB3 but can only do so partially (and is one of the objectives of EJB3 to allow interoperability if I'm not mistaken). It would be a problem if EJB2.1 and EJB3 entities had to be packaged in different .jar files as I would not be able to implement CMR between those entities.
Thanks very much in advance.
ps. sorry for the same posting to two different forum messages, as they are similar.
Is there any progress on this? I think it is still a problem in jboss 5 beta 4.
If you use the 2.0 dtd for your ejb-jar.xml file: -
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd"> <ejb-jar> ...
all ejb 3 beans in the jar are ignored.
Vice versa, if you use the ejb 3 schema for your ejb-jar.xml file: -
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"> ...
all ejb 2 beans are ignored
Is it a mandatory to put different ejb versions in different ejb modules?