Announcement Announcement Module
Collapse
No announcement yet.
Value of JNDI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Value of JNDI

    I'm trying to use stateful bean(ejb 3.0) in spring(2.5), but i'm don't know how should look value of JNDI property. I would like to add that I use wls 10.
    I get this error: javax.naming.NameNotFoundException:

    <bean id="bean" class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean">
    <property name="jndiName" value="SpringTest-ejb/ejbModule/com/ejb/UserBean" />
    <property name="resourceRef" value="false"/>
    <property name="businessInterface" value="com.ejb.UserLocal" />
    </bean>


    Thanks for all responses.
    Last edited by lukep1984; Oct 6th, 2008, 05:20 AM.

  • #2
    Still problem

    <bean id="bean" class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean">
    <property name="jndiName" value="java:comp/env/ejb/UserBean" />
    <property name="resourceRef" value="false"/>
    <property name="businessInterface" value="com.xxx.ejb.UserLocal" />
    <property name="lookupHomeOnStartup" value="false" />
    </bean>

    @Local
    public interface UserLocal {
    List<Usr> findUsers();
    }

    @Stateless(name="UserBean")
    @EjbLocalRef(jndiName="ejb/UserBean")
    public class UserBean implements UserLocal {

    @PersistenceContext(unitName="SpringTest-ejb")
    EntityManager em;

    @SuppressWarnings("unchecked")
    public List<Usr> findUsers() {
    //body
    }

    }

    Errors:
    org.springframework.ejb.access.EjbAccessException: Failed to locate local EJB [ejb/UserBean]; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'ejb.UserBean'. Resolved 'ejb'; remaining name 'UserBean'
    javax.naming.NameNotFoundException: While trying to look up comp/env/ejb/UserBean in /app/webapp/SpringTest-war/19699640.; remaining name 'comp/env/ejb/UserBean'

    What should I change or add?!
    Thanks, for all responses.

    Comment


    • #3
      Still problem

      I'm little bit far in searching solution for using ejb stateless bean in spring bean.
      Now I declared ejb bean in:
      weblogic-ejb-jar.xml:
      <weblogic-enterprise-bean>
      <ejb-name>UserBean</ejb-name>
      <local-jndi-name>ejb/userBean</local-jndi-name>
      </weblogic-enterprise-bean>

      ejb-jar.xml:
      <enterprise-beans>
      <session>
      <ejb-name>UserBean</ejb-name>
      <ejb-class>com.bzwbk.ejb.UserBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      </session>
      </enterprise-beans>

      weblogic.xml (i'm not sure if it's neccessary too):
      <wls:ejb-reference-description>
      <wls:ejb-ref-name>com.bzwbk.ejb.UserBean</wls:ejb-ref-name>
      <wls:jndi-name>ejb/userBean</wls:jndi-name>
      </wls:ejb-reference-description>

      and my applicationContext.xml declaration for ejb bean looks:
      <jee:jndi-lookup id="bean"
      jndi-name="java:comp/env/ejb/userBean"
      resource-ref="false" lookup-on-startup="false"
      proxy-interface="com.bzwbk.ejb.UserLocal"/>

      Unfortunately, I still have error:
      javax.naming.NameNotFoundException: While trying to look up comp/env/ejb/userBean in /app/webapp/SpringTest-war/31074016.

      Now, after deployment ejb, local-jndi for this bean in weblogic administartive console is set to my value ejb/userBean, but I have no idea why it doesn't work.

      Thanks for all responses.
      Best regards,
      Luke

      Comment


      • #4
        Still problem

        Can Anyone wrote few sentecnces about what is neccessary to set in xml files of enterprise application consisting of ejb- and web-module. I have already spent 3 days to find right way to have access to ejb in spring bean. The chapter 18 in sprng reference hasn't enough information for me.

        Best regards,
        Luke

        Comment


        • #5
          A little bit different problem

          I have already(after 4 days)found solution to access stateless bean from spring bean, but I have problem when I deployed ejbmodule alone out of my enterprise application and then I want to access to the same bean from web application.
          Thanks for all responses.

          Comment

          Working...
          X