org.omg.CORBA.MARSHAL:警告:00810057:无法加载 class

org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class

我正在测试简单的企业应用程序,但在调用远程方法时出现以下错误。

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;
    }

远程图书馆

@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());
}

我已将 EJB 和 remoteLibrary 项目添加到我的 WAR 项目中,因此,我的 JSP 可以访问我的客户 class。

如有任何帮助,我们将不胜感激。谢谢。

"CORBA.MARSHAL" 表示您在本地和远程程序中使用的 IDL 不相同 and/or 远程方法抛出未在 IDL 中定义的异常。

这一切都假设您在双方都使用兼容的 ORB 并且双方的设置是兼容的。