3

I'm using spring to obtain connection factory for jms

<!-- 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:

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. In the same time when I get "jmsConnectionFactory" via jndi programatically, without spring container, everything works fine. Is there any clue why spring's connection factory uses another credentials to obtain connection?

user2409220
  • 31
  • 1
  • 2
  • The second to the last posting here might be of some use: http://forum.springsource.org/showthread.php?73622-Secure-JMS-and-Spring-with-WebLogic – CodeChimp May 22 '13 at 11:44
  • thanks, good point, I'll ask there as well – user2409220 May 22 '13 at 12:14
  • The link I posted is a question about using JMS with Spring on WebLogic. The 2nd to the last reply there speaks to security, and gives what looks like a pretty full example. It may behoove you to post over there, but I was more or less pointing you to the reply, not the forum. – CodeChimp May 22 '13 at 12:17
  • Yeah, it seems that it is connected with JMS security issues that are described there. I still haven't come to any solution that works for me. Hope links will help me. Thanks for link. – user2409220 May 23 '13 at 16:27
  • Ok, after playing for a while with all configurations I ended up by configuring cross domain security in weblogic. – user2409220 May 28 '13 at 07:10

0 Answers0