Results 1 to 2 of 2

Thread: Using SLSB's on different weblogic instances

  1. #1
    Join Date
    Oct 2004
    Posts
    14

    Default Using SLSB's on different weblogic instances

    Hi,

    I'm really new to spring and I hadn't encountered any serious problem using it until today... there's a first time for everything I guess :?

    I'm using different "base services" (as we call them in my company, they are in fact SLSB's) that are deployed on different weblogic instances.

    So, I'm defining 2 SimpleRemoteStatelessSessionProxyFactoryBean in my applicationContext.xml with the proper jndi names and environment properties. Everything (creating the beans, performing lookup,..) is going fine until I finally make use of those SLSB's. It seems that one of the SLSB's is trying to use jndi environment properties from the other SLSB (like java.naming.security.principal) and as they're not the same, I got a java.lang.SecurityException.

    When using them apart, everything is ok... the problem occurs only when the 2 SLSB's are defined at the same time (even if I only make use of only one).

    Maybe something is wrong with the jndi stuff ?

    applicationContext.xml
    Code:
    <bean id="service1"
        class="...SimpleRemoteStatelessSessionProxyFactoryBean">
      <property name="jndiEnvironment">
        <props>
          <prop
              key="java.naming.factory.initial">
            weblogic.jndi.WLInitialContextFactory
          </prop>
          <prop key="java.naming.provider.url">t3&#58;//server1&#58;7215</prop>
          <prop key="java.naming.security.principal">user1</prop>
          <prop key="java.naming.security.credentials">pw1</prop>
        </props>	
      </property>
      <property name="jndiName">
        <value>ejb/service1</value>
      </property>
      <property name="businessInterface">
        <value>...Service1</value>
      </property>
    </bean>
    	
    <bean id="employerIdentifier"
        class="...SimpleRemoteStatelessSessionProxyFactoryBean">
      <property name="jndiEnvironment">
        <props>
          <prop
              key="java.naming.factory.initial">
            weblogic.jndi.WLInitialContextFactory
          </prop>
          <prop key="java.naming.provider.url">t3&#58;//server2&#58;7027</prop>
          <prop key="java.naming.security.principal">user2</prop>
          <prop key="java.naming.security.credentials">pw2</prop>
        </props>	
      </property>
      <property name="jndiName">
        <value>ejb/service2</value>
      </property>
      <property name="businessInterface">
        <value>...Service2</value>
      </property>
    </bean>
    Any help would be greatly appreciated!

    Thanks a lot!
    Xavier.

  2. #2
    Join Date
    Oct 2004
    Posts
    14

    Default

    I've been digging a little more (wihtout spring) and it seems that it is impossible to have multiple javax.naming.Context at the same time...

    if I do something like this:

    Code:
    initialize context 1 &#40;url=L1, user=U1, password=P1&#41;
    initialize context 2 &#40;url=L2, user=U2, password=P2&#41;
    
    context2.lookup&#40;something&#41;
    context1.lookup&#40;somethingElse&#41; throws java.lang.SecurityException &#91;Security&#58;090398&#93;Invalid Subject&#58; principals=&#91;U2&#93;
    somehow, the context1's java.naming.security.principal has been overwritten with the one contained in context2...

    So, I suppose that spring is not fautive... but does any J2EE god know some trick to avoid the problem?

    thanks!
    Xavier.

Similar Threads

  1. Replies: 6
    Last Post: Dec 7th, 2010, 06:57 AM
  2. Replies: 1
    Last Post: Sep 17th, 2005, 02:19 AM
  3. Replies: 2
    Last Post: Aug 6th, 2005, 04:30 PM
  4. Replies: 1
    Last Post: Jun 23rd, 2005, 02:13 AM
  5. Replies: 2
    Last Post: May 26th, 2005, 02:30 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
  •