【问题标题】:org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load classorg.omg.CORBA.MARSHAL:警告:00810057:无法加载类
【发布时间】:2017-07-29 19:00:22
【问题描述】:

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

输入异常报告

消息内部服务器错误

描述服务器遇到阻止它的内部错误 完成此请求。

异常

org.apache.jasper.JasperException: javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446393 也许;嵌套的 例外是:org.omg.CORBA.MARSHAL:警告:00810057:不能 加载类 entitydata.Customer vmcid:OMG 次要代码:57 完成: 也许

根本原因

javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446393 也许;嵌套异常是:org.omg.CORBA.MARSHAL: 警告:00810057:无法加载类实体数据。客户 vmcid: OMG 次要代码:57 完成:也许

根本原因

java.rmi.MarshalException: CORBA MARSHAL 1330446393 也许;嵌套的 例外是:org.omg.CORBA.MARSHAL:警告:00810057:不能 加载类 entitydata.Customer vmcid:OMG 次要代码:57 完成: 也许

根本原因

org.omg.CORBA.MARSHAL:警告:00810057:无法加载类 entitydata.Customer vmcid:OMG 次要代码:57 完成:也许

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 可以访问我的 Customer 类。

任何帮助都会被应用。谢谢。

【问题讨论】:

    标签: java jakarta-ee corba remoteobject entity-bean


    【解决方案1】:

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

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

    【讨论】:

    • 本地和远程都配置为返回相同的“对象”。
    • @Developer 好吧,“客户”作为“对象”从 SearchData() 返回。然后您将 custSession.SearchData(1) 转换为“客户”。您必须在任何地方都使用“客户”对象,尤其是在 IDL 中。例如:public Customer SearchData(Integer id) { return em.find(Customer.class, id); } 您需要注意的另一件事是异常。如果 SearchData() 可以抛出异常,则需要在 IDL 中列出这些异常。如果未列出异常并抛出异常,您将再次获得 MARSHALL。
    猜你喜欢
    • 2023-03-06
    • 2014-12-24
    • 1970-01-01
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多