Announcement Announcement Module
Collapse
No announcement yet.
Not clear on how to access an ejb remotely using spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not clear on how to access an ejb remotely using spring

    Hi all
    I have a rich client configured using spring. On the server I have a bunch of stateless session beans running on Jboss 4.0

    To access a SLSB calles Search I suppose first I need to set up a jndi lookup.

    I couldn't find any where that teached how to do this. Can anyone help?

    My clientContext.xml looks as follows.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">



    <beans>

    <!-- ========================= GENERAL DEFINITIONS ========================= -->

    <!-- Configurer that replaces ${...} placeholders with values from properties files -->
    <!-- (in this case, mail and JDBC related properties) -->
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="locations">
    <list>
    <value>jndi.properties</value>
    </list>
    </property>
    </bean>

    <bean id="ejb/SearchBean" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="java.naming.factory.initial">
    <value>org.jnp.interfaces.NamingContextFactory</value>
    </property>
    <property name="java.naming.provider.url">
    <value>${java.naming.provider.url}</value>
    </property>
    <property name="java.naming.factory.url.pkgs">
    <value>org.jboss.naming:org.jnp.interfaces</value>
    </property>
    </bean>

    <bean id="searchBean" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
    <property name="jndiName">
    <value>ejb/SearchBean</value>
    </property>
    <property name="businessInterface">
    <value>com.invest.common.ISearch</value>
    </property>
    </bean>

    <bean id="searchClient" class="com.invest.client.views.actions.search">
    <property name="searchService">
    <red bean="searchBean"/>
    </property>
    </bean>


    <!--
    - The message source for this context, loaded from localized "messages_xx" files
    - in the classpath, i.e. "/WEB-INF/classes/messages.properties" or
    - "/WEB-INF/classes/messages_de.properties".
    -
    - "getMessage" calls to this context will use this source.
    - Child contexts can have their own message sources, inheriting all messages from this
    - source, being able to define new messages and override ones defined in this source.
    -->
    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename"><value>messages</value></property>
    </bean>


    </beans>



    thanks
    alex

  • #2
    Maybe this can help

    this is one of the Test case to set up a bean

    public class TestAuditoriaBean extends TestCase{

    private String[] paths = {"com/intercam/seguridad/ejb/applicationContext.xml"};
    private ApplicationContext applicationContext;

    /**
    * @see junit.framework.TestCase#setUp()
    */
    protected void setUp() throws Exception{
    applicationContext = new ClassPathXmlApplicationContext(paths);
    auditoriaSdo = (IAuditoria) applicationContext.getBean("auditoriaSeguridadServ ice"); super.setUp();
    }
    }


    and this is my applicationContext

    <bean id="auditoriaSeguridadService" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean" lazy-init="true">
    <property name="jndiName">
    <value>ejb/Intercam/Auditoria</value>
    </property>
    <property name="jndiEnvironment">
    <props>
    <prop key="java.naming.factory.initial">weblogic.jndi.WL InitialContextFactory</prop>
    <prop key="java.naming.provider.url">t3://localhost:7001</prop>
    </props>
    </property>
    <property name="businessInterface" value="com.intercam.seguridad.interfaces.IAuditori a" />
    </bean>

    Comment


    • #3
      Meanning

      And what does SLSB calles means?

      Comment

      Working...
      X