You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kwosie <mo...@gmail.com> on 2010/07/19 11:06:51 UTC

JMS message to Weblogic -> Security Exception (Access denied to resource)

Howdi,

I'm trying to access a JMS Queue in a secure WebLogic JMS module using
ActiveMQ & Camel.
I have tried using the UserCredentialsConnectionFactoryAdapter as per JIRA
(CAMEL-246), but with no success.
I keep on getting the following exception (on both send & receive
endpoints):
weblogic.jms.common.JMSSecurityException: Access denied to resource:
type=<jms>, application=jms_module, destinationType=queue,
resource=jms_response, action=receive

I've tried the following (as well as permutations thereof - see config
below):
 #1 Populate the credentials on the uri in the route itself
 #2 Populate the credentials on UserCredentialsConnectionFactoryAdapter
xbean
 #3 Populate the credentials in the JndiTemplate
(which is the correct way?)

More notes:
 * Everytime a login to WebLogic does occur (because there is a Login error
if the password is incorrect)
 * I can access the JMS queue with the same credentials using another tool
(i.e. Hermes JMS).
 * With secure I mean a simple Role & Policy in the WebLogic JMS module

Here is the spring config xml:
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
trace="true">
  <route id="testReceive">
<!-- Credentials #1 -->
    <from
uri="webLogic:jmsResponseQueue?username=theUser&amp;password=thePassword"/>
    <to uri="mock:myName" />
  </route>
</camelContext>

<bean id="webLogic" class="org.apache.camel.component.jms.JmsComponent">
  <property name="connectionFactory" ref="webLogicConnectionFactory"/>
  <property name="destinationResolver" ref="webLogicDestinationResolver" />
</bean>
	
<bean id="webLogicConnectionFactory"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
  <property name="targetConnectionFactory"
ref="webLogicTargetConnectionFactory"/>
<!-- Credentials #2 -->
  <property name="username" value="theUser" />
  <property name="password" value="thePassword" />
 </bean>

<bean id="webLogicTargetConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean"> 
  <property name="jndiName" value="jms/ConnectionFactory" /> 
  <property name="jndiTemplate" ref="webLogicJndiTemplate" /> 
</bean>

<bean id="webLogicJndiTemplate"
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://webLogicServer:7001</prop>
  <!-- Credentials #3 -->
	  <prop key="java.naming.security.principal">theUser</prop>
	  <prop key="java.naming.security.credentials">thePassword</prop>
    </props>
  </property>
</bean>
 
<bean id="webLogicDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver"> 
  <property name="jndiTemplate" ref="webLogicJndiTemplate" /> 
</bean>

Can anyone tell me what am I missing?
(Versions: @ActiveMQ: 5.3.1    @Camel 2.2.0)
-- 
View this message in context: http://camel.465427.n5.nabble.com/JMS-message-to-Weblogic-Security-Exception-Access-denied-to-resource-tp1438688p1438688.html
Sent from the Camel - Users mailing list archive at Nabble.com.