0
我在本地計算機上運行JBoss 5服務器,並且需要從我的Java EE項目到PostgreSQL數據庫的工作數據庫連接。我已經開發了一個名爲的UserManager其代碼是一個Java類:Java EE EJB部署錯誤:容器已經註冊
import javax.ejb.Local; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @Stateless(name="UserManager1") @Local(UserManagerItf.class) public class UserManager implements UserManagerItf { @PersistenceContext private EntityManager em; public boolean addUser(Joueur j) { Joueur jexist = em.find(Joueur.class, j.getLogin()); if(jexist==null) { em.persist(j); return true; } else { return false; } } }
問題是,當我使用Eclipse導出我的.war文件和我的JBoss運行在部署我.war文件,我得到這個錯誤部署:
18:47:27,645 INFO [BeanInstantiatorDeployerBase] Installed [email protected]b4f into MC at org.jboss.ejb.bean.instantiator/JEE/JEE/UserManager1 18:47:27,650 WARN [InterceptorInfoRepository] EJBTHREE-1852: InterceptorInfoRepository is deprecated 18:47:28,062 INFO [BeanInstantiatorDeployerBase] Uninstalled [email protected]b4f from MC at org.jboss.ejb.bean.instantiator/JEE/JEE/UserManager1 18:47:28,063 ERROR [AbstractKernelController] Error installing to Real: name=vfs:///home/tuxer/jboss/jboss6/server/default/deploy/JEE.war state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error deploying JEE.war: Error creating ejb container UserManager1: Container jboss.j2ee:jar=JEE.war,name=UserManager1,service=EJB3,VMID=11d1def534ea1be0:-3567a2b:137b33e6929:-7ffd + is already registered
謝謝你提供的任何答案。