2011-06-23 101 views
0

我在Eclipse中創建了一個動態Web項目。我有2個豆子,1個@Entity和其他@Stateless。我已經部署了戰爭到Geronimo 2.2.1和Tomcat 6警告:在.war中找不到EJB

Unresolved ejb reference "com.myconnection.servlet.AddServlet/srvc" in bean 
"GeronimoEnc". Will attempt resolution again at runtime. 

我有與動作到一個servlet(AddServlet)一.JSP的形式。這個servlet試圖引用我的@Stateless bean(通過接口)。但是,一旦我打我的提交形式去的servlet上,我得到這個錯誤:

java.lang.InstantiationException: Some objects to be injected were not found in jndi:  
[javax.naming.NameNotFoundException: No EJB found for reference "com. 

我也有在SRC/META-INF我的persistence.xml文件,我不是正面的,如果這就是它應該是。

什麼可能我是做錯了什麼?謝謝

回答

0

在Geronimo 3.0中,通過bug report 5117修復了對使用EJB部署WAR文件的支持(但可能不可用;請參閱以下文本)。通過這份報告,2.2.1中的依賴注入可能會失敗。

存在one report on the mailing list,這表明Geronimo 3.0 M1可能用於驗證依賴注入是否適用於部署在Web應用程序中的EJB;然而,這與針對同一主題的失敗提出的疑問相反。再現郵件的突出內容:


Łukasz:

Geronimo is not able to inject @EJB into a servlet. Both SLSB and my serlvet are packaged in war. ... By looking at the release notes I know that EJB 3.1 is supported only partially. I take it that the part that is not yet implemented in deploying EJBs inside war package?

Ivan:

Hmm, IIRC, the EJB injection should work in the M1 release, although it have some bugs in EJB 3.1 integration. I would suggest to use the latest trunk codes (just update some codes to try to work around the address binding issue on the building machine, hopefully a snapshot build could be generated in the next round), as we got a much better TCK result comparing with M1 release. JCDI related packages are definitely included in the latest trunk build.

全力以赴以上的,3.0 M1會在一瞬間嘗試此發佈,但肯定是這個功能是缺失的某種可能性(考慮該錯誤5117似乎未在發行說明中的​​固定錯誤列表中)。

相關問題