论坛首页 入门技术论坛

程序部署到JBOSSAS 4.2.0时出现错误

浏览 2634 次
该帖已经被评为新手帖
作者 正文
   发表时间:2007-05-19  
我在把程序部署到JBOSSAS 4.2.0时出现下那样的错误,有谁知道怎么解决吗?我在网上查,大概是表的顺序有问题,可是我不知道怎么解决,谁能告诉我吗?谢谢

2007-05-18 22:16:57,843 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
java.lang.NullPointerException
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)


--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
  State: FAILED
  Reason: java.lang.NullPointerException
  I Depend On:
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  Depends On Me:
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AddressFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AdminFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=CommentFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesDirectoryFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=PermissionFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=RoleFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=SiteFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=TagFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UsersFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UserSiteFacade,service=EJB3

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
  State: FAILED
  Reason: java.lang.NullPointerException
  I Depend On:
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  Depends On Me:
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AddressFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AdminFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=CommentFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesDirectoryFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=PermissionFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=RoleFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=SiteFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=TagFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UsersFacade,service=EJB3
    jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UserSiteFacade,service=EJB3

代码是:
@Entity
@Table(name = "users", catalog = "favorites", uniqueConstraints = {})
public class Users implements java.io.Serializable {
private Set<UserSite> userSites = new HashSet<UserSite>(0);
//...
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "users")
public Set<UserSite> getUserSites() {
return this.userSites;
}

public void setUserSites(Set<UserSite> userSites) {
this.userSites = userSites;
}

}


@Entity
@Table(name = "user_site", catalog = "favorites", uniqueConstraints = {})
public class UserSite implements java.io.Serializable {

private Users users;
//...
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "userId", unique = false, nullable = false, insertable = true, updatable = true)
public Users getUsers() {
return this.users;
}

public void setUsers(Users users) {
this.users = users;
}
}
   发表时间:2007-05-19  
自己解决了,谢谢
0 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics