Results 1 to 9 of 9

Thread: Spring and EJB3

  1. #1

    Default Spring and EJB3

    Greetings,

    I'm trying to call EJB3 stateless session bean from a client employing Spring and following example from http://www.springframework.org/docs/reference/ejb.html. I'm getting an exception in reards to home interface:

    EJB home [jboss.j2ee:service=EJB3,name=test.HelloWorldBean] has no no-arg create() method

    Since there is no home interfaces in EJB3 I guess those examples are not really applicable. Does anyone know of any resources showing how to marry Spring and EJB3? I'm also curious on best practices on how to use two technologies together (if it's not too early yet).

    Thanks,
    Yuriy

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    I'm also curious on best practices on how to use two technologies together (if it's not too early yet).
    I think it is a bit early, as the EJB3 draft is evolving.

    Regarding best practices, we plan to begin work on integration with the EJB3 persistence APIs as soon as the Reference Implementation (announced at JavaOne) is available.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3

    Default

    Thanks.

    What about Spring and EJB3 STSB? Is it possible already?

    Regards,
    Yuriy

  4. #4

    Default

    I don't believe no one knows what the deal is with EJB3 and Spring. Don't get shy guys.

    Regards,
    Yuriy

  5. #5
    Join Date
    Jul 2005
    Location
    Rüdesheim, Germany
    Posts
    29

    Default

    Using the JBoss EJB3 preview I retrieve my SLSB quite simple via

    Code:
    <bean id="userManager" class="org.springframework.jndi.JndiObjectFactoryBean">
    		<property name="jndiName"><value>foo.service.UserManager</value></property>
    	</bean>
    Sebastian

  6. #6
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    Yes, all you should need to look up EJB3 Session Beans is Spring's JndiObjectFactoryBean, as EJB3 effectively exposes the component interface directly, rather than enforcing the indirection via a home interface. Same goes for an EJB3 EntityManager, which should simply be available at a specific JNDI location.

    Juergen

  7. #7
    Join Date
    Aug 2007
    Posts
    18

    Default

    It's now 2007, two years later from your post and I'm having the same issue of "EJB home: ... has no no-arg create() method". I tried your fix mentioned above and I'm getting an "IllegalArgumentException" as Spring cannot convert the EJB proxy to my local interface due to the "no matching editors or conversion strategy was found" error.

    Can anybody please help ?

  8. #8
    Join Date
    Apr 2006
    Posts
    2

    Default

    Hi, you are patient though
    I'me developing application which is supposed to run in tomcat using ejb3 persistance and spring transaction demarcation and in jboss using ejb3 full features and spring injections into http handler beans.

    I've just succefully injected ejb3 session bean deployed into jboss using spring.
    Have a look
    Code:
      <bean id="mediaAcceptorManager" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName" value="100_personalMediaCenter/FileMediaAcceptorManagerImpl/local"/>
            <property name="proxyInterface" value="com.primetel.pmc.mediaacceptor.service.FileMediaAcceptorManager"/>
        </bean>
    Then you can inject mediaAcceptorManager wherever you want

  9. #9
    Join Date
    Aug 2007
    Posts
    18

    Default

    Thanks a lot, baocean. Somehow, I was able to make it work using the following:
    <jee:jndi-lookup id="ManageMemberService" jndi-name="ejb/ManageMemberEJB" cache="true" />
    It's pretty weird as I tried those tags and what everybody else on this forum told me to try but it wouldn't work for me. Now, all of a sudden, I got it work. Anyway, thanks for your reply.

Similar Threads

  1. EJB3.0 without Spring :-)
    By josenyimi in forum EJB
    Replies: 11
    Last Post: Oct 30th, 2007, 03:12 PM
  2. Hostility from Hibernate people
    By hucmuc in forum Data
    Replies: 25
    Last Post: May 31st, 2007, 08:12 AM
  3. EJB3
    By djeang in forum Container
    Replies: 8
    Last Post: Apr 11th, 2006, 11:58 AM
  4. spring ejb3 hibernate
    By hari_ks in forum Architecture
    Replies: 2
    Last Post: Sep 27th, 2005, 08:18 AM
  5. On java article Spring and EJB3
    By hucmuc in forum Meta
    Replies: 1
    Last Post: Jun 30th, 2005, 12:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •