2011-05-31 34 views
-1
package com.apress.springrecipes.post; 
import javax.ejb.Remote; 
import javax.ejb.Stateless; 
@Stateless 
@Remote({ PostageService.class }) 
public class PostageServiceBean implements PostageService { 
    public double calculatePostage(String country, double weight) { 
    return 1.0; 
} 
} 

 jndi-name="PostageServiceBeanRemote"> 
     <jee:environment> 
      java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory 
      java.naming.provider.url=ejbd://127.0.0.1:4201 
     </jee:environment> 
    </jee:jndi-lookup> 


    <bean id="frontDesk" 
      class="com.apress.springrecipes.post.FrontDeskImpl"> 
     <property name="postageService" ref="postageService"/> 
    </bean> 
</beans> 
+4

我花了更多時間格式化,然後你做了複製和粘貼。請添加一些解釋您的代碼片段的單詞,併爲我們提供更好的代碼示例。 – Nix 2011-05-31 16:43:40

+0

這個問題沒有什麼意義,請解釋一下它是什麼,否則這將被關閉。 – 2011-11-01 03:28:45

回答

0

據我所知,春天只允許你消耗的EJB,這可以從應用程序服務器環境中獲得。但是,您不能使用Spring發佈EJB bean:您需要使用由具體應用程序服務器提供的工具(也取決於您是否使用EJB 2或EJB 3)。

看一看EJB3 with Spring