Results 1 to 2 of 2

Thread: JndiTemplate question

Hybrid View

  1. #1

    Default JndiTemplate question

    Hi,

    I'm using 2 JndiTemplates to access two EJB's which are deployed on different machines and therefore the properties are different.
    The problem is that when the beans are loaded and when running a test to consult one of the Ejb's I get a SecurityException because it's still using the properties of the first JndiTemplate instead of the properties of the second.
    Is this a problem of caching ?? Can I destroy a JndiTemplate after it's been used ?

    Here are the 2 JndiTemplates and the beans : Ripservice makes use of the JndiTemplate and DmfaConsultation makes use of the JndiTemplate2 bean but somehow the latter still uses the properties of the first template :


    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">${java.naming.fa ctory.initial}</prop>
    <prop key="java.naming.provider.url">${java.naming.provi der.url}</prop>
    <prop key="java.naming.security.principal">${java.naming .security.principal}</prop>
    <prop key="java.naming.security.credentials">${java.nami ng.security.credentials}</prop>
    </props>
    </property>
    </bean>

    <bean id="jndiTemplate2" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">${java.naming.fa ctory.initial}</prop>
    <prop key="java.naming.provider.url">${dmfaconsult.java. naming.provider.url}</prop>
    <prop key="java.naming.security.principal">${dmfaconsult .java.naming.security.principal}</prop>
    <prop key="java.naming.security.credentials">${dmfaconsu lt.java.naming.security.credentials}</prop>
    </props>
    </property>
    </bean>


    <!-- A reference to a RipService instance -->
    <bean id="ripService" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName">
    <value>${ripService.jndiName}</value>
    </property>
    <property name="businessInterface">
    <value>be.smalsmvm.common.businessservices.rip.ser vice.RipService</value>
    </property>
    </bean>

    <!-- A reference to a DmfaConsult instance -->
    <bean id="dmfaConsultation" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate2" />
    </property>
    <property name="jndiName">
    <value>${dmfaConsultService.jndiName}</value>
    </property>
    <property name="businessInterface">
    <value>be.smalsmvm.common.dmfaconsultation.ejb.Dmf aConsultation</value>
    </property>
    </bean>


    Thanks for any info !

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default Re: JndiTemplate question

    I remember the posting of a similar problem.
    Have a look at http://forum.springframework.org/sho...nitial+context
    Unfortunately there has been no solution.

    Regards,
    Andreas
    Last edited by robyn; May 19th, 2006 at 05:32 AM.

Similar Threads

  1. Forgot password (e.g. secret question) using Acegi
    By lowerymb77 in forum Security
    Replies: 1
    Last Post: Oct 16th, 2005, 10:46 PM
  2. Messaging question
    By tentacle in forum Architecture
    Replies: 6
    Last Post: Dec 20th, 2004, 08:33 AM
  3. Need Help - Question regarding PetClinic Example
    By spring04 in forum Architecture
    Replies: 6
    Last Post: Nov 17th, 2004, 12:59 AM
  4. Replies: 6
    Last Post: Oct 8th, 2004, 02:21 PM
  5. Design question, c3p0 and more..
    By kantorn in forum Data
    Replies: 4
    Last Post: Oct 7th, 2004, 08:20 AM

Posting Permissions

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