Quantcast
Channel: Spring Community Forums - JMS
Viewing all articles
Browse latest Browse all 51

obtaining jms connection to external weblogic server via jndi

$
0
0
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?

Viewing all articles
Browse latest Browse all 51

Trending Articles