Wolfgang, > I still have to points to ask for comments: > > 1. The EJB jars do only contain the 'normal' ejb files. The > ejbc compiler does need access to other classes. Thats > the point where the 'classpath' attribute comes in handy. > > As of now, this leads to a fork of the java task. Is this > realy needed? Isn't there this new classloader feature? > > Not to fork would give us a BIG performance hit! >
Yes, I've made the 4.5.1 task use a classloader to avoid creating a new VM. It was a little involved but the same strategy should work for the 5.1 task. I'm looking into it. > 2. There is a register call to make a DTD known: > > handler.registerResourceDTD( > "-//Sun Microsystems, Inc.//DTD Enterprise > JavaBeans 1.1//EN", > "/weblogic/ejb/deployment/xml/ejb-jar.dtd"); > > The location of the dtd file is hardcoded an assumes the default > installation location of weblogic. > > Should not be this registerFileDTD ? > No, I prefer a resource. The loading of the resource is based on the classpath, so I don't need to know the actual file location. It does mean that you need to have your weblogic classpath set up before you run ant. I don't really like that - I try to run a mimimal classpath. Nevertheless, it works for now. > 3. I patched the sources a little bit to make my initial source > tree possible. > > a) changed registerResourceDTD to registerFileDTD > b) added setter for user specific placement of dtd file > c) added extraction of ejb-name from ejb-jar.xml > d) added search for 'weblogic-ejb-jar.xml' if > /<Name>-weblogic-ejb-jar.xml' not found. The file > has to be in the same directory as ejb-jar.xml > > With this you can have your directory structure like this: > > <base>/**/person/Person.java > <base>/**/person/PersonBean.java > <base>/**/person/PersonPK.java > <base>/**/person/PersonHome.java > <base>/**/person/META-INF/ejb-jar.xml > <base>/**/person/META-INF/weblogic-ejb-jar.xml > > And create the bean jar with > > <ejbjar srcdir="${dir.build.javac}"> > <weblogic destdir="${dir.dist}" > classpath="${classpath.run}" > keepgeneric="true" > > dtdlocation="${weblogic.home}/classes/weblogic/ejb/deployment/xml/ > ejb-jar.dt > d" > suffix="EJB.jar"/> > <include name="**/ejb-jar.xml"/> > <exclude name="**/weblogic-ejb-jar.xml"/> > </ejbjar> > > The diffs are attached. Please comment. > > These changes should be good. I'll look into them. Conor