I'm using J2EE 1.2.1 on Solaris 2.6 and I am trying to deploy an ejb that uses a "helper class". The home interface, remote interface, and bean are, respectively, DataSearchHome, DataSearch, and DataSearchEJB. The helper class is LDAPLookup. All these classes are in the net.trapdoor.datasearch package, and they all compile, but when I use the New Bean Wizard, I get an error ["The class (net.trapdoor.datasearch.LDAPLookup) could not be loaded. ..."] when I click the "Next" button after specifiying the contents of the EJB jar file. If I take the helper class out, everything goes well. Why will this class not load? TIA, -Joe
Whenever I got that error, it usually had to do with having the wrong "root" directory selected.
Your classes are all in the same package, so placing them all in the same directory *should* be sufficient. I've heard from others that packaging the bean classes is not the greatest idea. Perhaps this is why? Specifically they mention that EJB's shouldn't be packaged, but the helper classes can be packaged.
If you choose to do this (only package helper classes), then when you add the helper class, you'd have to make sure to specify the correct root (bottom of package) and when you look at the deploytool's listing, it would have to be something like: DataSearchHome DataSearch DataSearchEJB net/trapdoor/datasearch/LDAPLookup
An alternative is to jar this separate helper class, and add it as a Library jar. A difficulty to be aware of if you take this approach - if any of your EJB's are subclasses of an EJB Class in the jar, the deploytool will complain of a 'class not found' error when you attempt an 'update and redeploy'. However, you can dismiss the error, your app will be 'undeployed', and simply click 'update and redeploy' again. For whatever reason, on a deployed app, the updater will not include the library jars when rmic compiling the EJB's. But when deploying it from an undeployed state, it does.
Hopefully this flakey behaviour is not in the Solaris version of the deploytool, but I wouldn't hold my breath.