Skip to Content
Former Member
Aug 19, 2010 at 07:50 PM

How to call method of one EJB3.0 project in another EJB3.0 project



I would be thankful if someone could help me in this -

I am using SAP Netweaver 7.2 and have two EJB3.0 projects.

Now I am trying to instantiate a class of one EJB project into another and when I get a run time exception as -

javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError

I have tried to add it under the Java Build Path -> Projects but it only helps during compile time.

I have also tried checking the projects under "Project References" but it still gives the same problem

Here is the code and where exactly its failing -

import java.util.ArrayList;
import java.util.logging.Logger;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.csagroup.wsecomm.OrderSearch;
import org.csagroup.wsecomm.SalesOrderSearchQueryInImplBean;

import VendaOrders.ServiceClientImpl;

 * Message-Driven Bean implementation class for: HelloWorldBean
		activationConfig = { 
				@ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "JobDefinition='HelloWorldJob'"),
				@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
public class HelloWorldBean extends MDBJobImplementation {	

     * @see MessageListener#onMessage(Message)
	public void onJob(JobContext ctx) {
    	Logger logger = ctx.getLogger();
    	 "Hello World Testing onJob().....");
    	{"Before Order Search...");
    		OrderSearch os = new OrderSearch();   *// this is where it fails*"Before os...");
    		SalesOrderID salesOrderIdBeginRange = new SalesOrderID();"Before salesOrderIdBeginRange...");
    		salesOrderIdBeginRange.setValue("1");"After setValue(1)");
    		SalesOrderID salesOrderIdEndRange = new SalesOrderID();"Before salesOrderIdEndRange");
        	"After 99999");
        	SalesOrderSearchQueryInImplBean salesOrderSearchQueryInImplBean = new SalesOrderSearchQueryInImplBean();
    		"After salesOrderSearchQueryInImplBean");
    	} catch (Exception e){"Exception is...." + e.getLocalizedMessage());}
        // TODO Auto-generated method stub


I am able to see the message in my logs till "Before Order Search.." and fails when I try to instantiate OrderSearch class which is in another EJB 3.0 project.

Thanks for the help in advance.

Edited by: Shiv Khullar on Aug 19, 2010 10:30 PM