0

I am testing simple Enterprise application but I am getting following error when I call remote method.

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446393 Maybe; nested exception is: org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class entitydata.Customer vmcid: OMG minor code: 57 completed: Maybe

root cause

javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446393 Maybe; nested exception is: org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class entitydata.Customer vmcid: OMG minor code: 57 completed: Maybe

root cause

java.rmi.MarshalException: CORBA MARSHAL 1330446393 Maybe; nested exception is: org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class entitydata.Customer vmcid: OMG minor code: 57 completed: Maybe

root cause

org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class entitydata.Customer vmcid: OMG minor code: 57 completed: Maybe

SessionBean

public Object SearchData(Integer id) {
        Customer cust = em.find(Customer.class, id);
        return cust;
    }

RemoteLibrary

@Remote
public interface CustomerSessionBeansRemote {

    Object SearchData(Integer id);

}

JSP

Object o = ic.lookup(CustomerSessionBeansRemote.class.getName());
CustomerSessionBeansRemote custSession = (CustomerSessionBeansRemote) o;
Customer customer = (Customer)custSession.SearchData(1);
if(customer!=null){
     out.print(customer.getName());
}

I have added EJB and remoteLibrary project into my WAR project,so, my JSP hasa access to my Customer class.

any Help would be appriciated. Thanks.

Neil Stockton
  • 11,383
  • 3
  • 34
  • 29

1 Answers1

0

"CORBA.MARSHAL" means that IDLs you use in your local and remote program are not identical and/or remote method is throwing exception which is not defined in IDL.

This is all assuming that you're using compatible ORBs on both sides and settings on both sides are compatible.

BJovke
  • 1,737
  • 15
  • 18
  • Both the local and remote is configured to return 'Object' which is same. –  Mar 27 '17 at 16:50
  • @Developer Well, "Customer" is returned as "Object" from SearchData(). Then you are casting custSession.SearchData(1) as "Customer". You have to use "Customer" object everywhere, especially in IDL. For example: `public Customer SearchData(Integer id) { return em.find(Customer.class, id); }` The other thing you need to take care of are exceptions. If SearchData() can throw exceptions, you need to list those exceptions in IDL. If exceptions are not listed and it throws, you will get a MARSHALL again. – BJovke Apr 02 '17 at 12:48