【问题标题】:Error when getting JPA Entity in JSF bean via EJB SessionBean in GlassFish3.1通过 GlassFish3.1 中的 EJB SessionBean 在 JSF bean 中获取 JPA 实体时出错
【发布时间】:2011-05-06 06:57:43
【问题描述】:

我遇到了这个异常:

java.rmi.RemoteException: CORBA BAD_OPERATION 1330446343 No; nested exception is: org.omg.CORBA.BAD_OPERATION: WARNING: IOP01210007: Expected typecode kind to be one of [value, valueBox, abstractInterface] but got typecode kind null vmcid: OMG minor code: 7 completed: No

当我尝试在 jsf 客户端(支持 bean)中调用 ejb 方法以获取样本列表时 List<Sample> l = ejbBean.getSamples();

这是我的 JPA 实体:

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Sample implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    public Sample() {

    }

    @Id
    @GeneratedValue
    private Long id;
    @Temporal(TemporalType.TIMESTAMP)
    private Date date;
    private String title;
    private String description;
    private String type;


    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Date getDate() {
        return date;
    }
    public void setDate(Date date) {
        this.date = date;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }

}

独立客户端可以很好地使用相同的会话 bean,并且当我将 JPA 实体更改为纯 java 类而没有任何从 jsf 调用 ejb 的注释时效果很好。

【问题讨论】:

    标签: java jsf jpa glassfish ejb


    【解决方案1】:

    如果它在一个 EAR 中,它会很好地工作。我在 eclipse 和 glassfish 服务器上的单独 ejb 项目和动态 web 项目中有这个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-10
      • 2011-08-10
      • 1970-01-01
      • 1970-01-01
      • 2019-08-30
      • 2013-06-23
      • 1970-01-01
      相关资源
      最近更新 更多