-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>
dma_k
  • 10,431
  • 16
  • 76
  • 128
BlueSky
  • 1,423
  • 3
  • 12
  • 9
  • 4
    I took more time formating then you did copy and pasting. Please add some words explaining your code fragment, and give us a better code sample. – Nix May 31 '11 at 16:43
  • this question makes little sense, explain what it is you are after, otherwise this will be closed. – Sam Saffron Nov 01 '11 at 03:28

1 Answers1

0

As far as I know, Spring only allows you to consume EJBs, which can be obtained from application server context. However, you cannot publish EJB beans with Spring: you need to use the facilities, provided by concrete application server for that (also depends on whether you want to use EJB 2 or EJB 3).

Have a look also at EJB3 with Spring.

Community
  • 1
  • 1
dma_k
  • 10,431
  • 16
  • 76
  • 128