-1

Am trying to migrate project from ejb2.1 to ejb3.1. In my current project's ejb-jar.xml, i am using for loading the spring configuration xml file{which initializes the beans which going to be called in ejbbean class in onEjbCreate() method using "getBeanFactory().getBean("somespringclass") }.

Sample environment entry: <env-entry>
                 <env-entry-name>ejb/BeanFactoryPath</env-entry-name>
                 <env-entry-type>java.lang.String</env-entry-type>
                 <env-entry-value>config/xyz.xml</env-entry-value>
            </env-entry>

what is the ideal syntax for using annotation(ejb3.1) in ejbbean class so that i can remove in ejb-jar.xml. Thanks in advance.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
A K M
  • 11
  • 9

1 Answers1

0

Just annotate your EJB-3.1 interface with @EJB and put the following in your Spring configuration XML:

<context:component-scan base-package="<your-ejb-package-e.g.-com.ejb.sample>" />
damat-perdigannat
  • 5,780
  • 1
  • 17
  • 33