Specifying a Base Class for Remote Interfaces Using the ejbgen.properties File

By default, generated remote interfaces extend javax.ejb.EJBObject. If you would like them to extend a different interface, follow the instructions below.

  1. Ensure that all jars needed to resolve the target base interface and all referenced classes are added to the Java build path for your WebLogic EJB project. To add jars to the build path, open the dialog Properties->Java Build Path->Libraries.
  2. Export a Ant script for your WebLogic EJB project. To export an Ant script for your project, follow the instructions at Creating Ant Build and Maven POM Files for an Application. This will generate a build.xml Ant script under your project root directory.
  3. Edit this build.xml script as follows: in the call to the ejbgen task within the build target, add the attribute:

           propertyFile="ejbgen.properties"
  4. Create a file named ejbgen.properties under the root of your WebLogic EJB project and add the following entry:

          YourSessionBeanClassName.remote.baseClass=<my-target-base-interface>
  5. If necessary, add <path refid="java.classpath"/> to the <classpath> for the <java> task element that calls weblogic.ejbc. (This will ensure that the target class is resolved by EJBC.)
        <java classname="weblogic.ejbc"
          failonerror="true"
          fork="yes">
          <classpath>
    	    ...
            <path refid="java.classpath"/>
          </classpath>
         ...
        </java>

For more information on EJBGen property file support, see EJBGen Reference in the WebLogic Workshop documentation.


Still need help? Post a question on the Workshop newsgroup.