Results 1 to 3 of 3

Thread: obtaining jms connection to external weblogic server via jndi

  1. #1
    Join Date
    May 2013
    Posts
    2

    Default obtaining jms connection to external weblogic server via jndi

    Hi,

    I'm using spring 3.2.2 to obtain connection factory for jms

    Code:
    <!-- looking through jndi -->
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
            <prop key="java.naming.provider.url">t3://xxx.xxx.xx.x:8002</prop>
            <prop key="java.naming.security.principal">test</prop>
            <prop key="java.naming.security.credentials">test</prop>
        </props>
    </property>
    </bean>
    
    <!-- JMS Topic Connection Factory -->
    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="jndiTemplate" />
        <property name="jndiName" value="jms/AMP/AMPConnectionFactory" />
        <property name="lookupOnStartup" value="true" />
        <property name="cache" value="false" />
        <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
    </bean>
    The application by itself runs on one instance of weblogic while jndi lookup is performed on external weblogic server. The problem is that when I'm trying to create connection with the help of mentioned above "jmsConnectionFactory" I receive error:

    Code:
    Caused by: java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[weblogic, Administrators]
    it seems that my "jmsConnectionFactory" doesn't use propper credentials to open connection (while spring uses right credentials to retrieve "jmsConnectionFactory"). In the same time when I get "jmsConnectionFactory" via jndi programatically, without spring container, everything works fine. Is there any clue why spring generated "jmsConnectionFactory" uses another credentials to obtain connection?

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    May 2013
    Posts
    2

    Default

    Thanks, Gary for answer.

    After some investigation it seems that I have a problem with InitialContext . InitialContext caches properties that I'm passing to it, and since I'm using two different jndi servers I have a real mess with default InitialContext object.

Posting Permissions

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