How to invoke EJB's from a client on the same JVM


General J2EE: How to invoke EJB's from a client on the same JVM

  1. I have 5 EJBs deployed using a single .EAR file containing the deployable jars for each EJB as componenets. I have an utitlity class that needs to invoke methods on one of these EJB's i.e. basically getting the home and remote interfaces of the EJB. The home and remote interfaces are in the EJB jar file which is one of the components in the .EAR file. The utility class is not able to see the home or remote interface classes of the EJB. The problem here is that both the EJB and the utility class (which is the client) are in the same JVM. I cannot specify the home and remote interfaces in the weblogic classpath as the WLS says the EJB cannot be deployed at run time as it finds the home and remote interface classes in its own jar file as well as in the weblogic class path. I am frantically looking for a solution on this issue.
    Can someone please help me out ?
  2. See the doc on 6.x classloading:

    If you client needs to acess EJB's and it is not deployed in the same deployment unit (EAR), you must deploy EJB home and remote interfaces with your client (even in the same JVM).