Hibernate异常 - 初始SessionFactory创建failed.org.hibernate.MappingException:无法确定类型:

时间:2017-12-30 05:23:19

标签: java hibernate javafx-8 rmi netbeans-8

我在项目的服务器端遇到了问题。我为此使用了hibernate。有三个实体,如帐户,聊天和chataccount。账户实体如下所示。我没有使用任何注释来获取getter或setter。

@Entity
public class Account {

 @Id
 @GeneratedValue(strategy = GenerationType.AUTO)
 private int aid;

 @OneToOne(cascade = CascadeType.ALL)
 private Customer customer;

 private String email;
 private String password;
 private int real_payment;

 public Account() {
 }

和我的聊天实体。

@Entity
public class Chat {

 @Id
 @GeneratedValue(strategy = GenerationType.AUTO)
 private int chatId;

 private String description;
 private String time;

 public Chat() {
 }

最后聊天帐户在这里。这是关联实体。

@Entity
public class ChatAccount {

 @EmbeddedId
 private ChatPK chatPK;

 @ManyToOne(cascade = CascadeType.ALL)
 private Chat chat;

 @ManyToOne(cascade = CascadeType.ALL)
 private Account account;

 private int receiveAid;

 public ChatAccount() {
 }

错误如下所示。请帮我解决这个问题。

服务器端:

Initial SessionFactory creation failed.org.hibernate.MappingException: Could not determine type for: com.coinnet.entity.Account, at table: ChatAccount, for columns: [org.hibernate.mapping.Column(account)]

客户方:

java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: 
java.lang.ClassNotFoundException: org.hibernate.MappingException (no security manager: RMI class loader disabled)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:247)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
at com.sun.proxy.$Proxy11.checkLogin(Unknown Source)

0 个答案:

没有答案