[jboss-user] [JBoss Messaging] New message: "AccessLocalException appears after QueueConnection was started"

aaaaaaa aaaaaaaaa do-not-reply at jboss.com
Tue Mar 16 05:42:08 EDT 2010


User development,

A new message was posted in the thread "AccessLocalException appears after QueueConnection was started":

http://community.jboss.org/message/532205#532205

Author  : aaaaaaa aaaaaaaaa
Profile : http://community.jboss.org/people/volod1

Message:
--------------------------------------------------------------
Hi, all
 
I have experienced the following problem while using EJB&messaging under JBoss 5.1
I have some Queue where I send messages from EJB
My EJB is under my security domain and messaging Queue is under default security domain (called "messaging")
Everything works fine BUT:
after I have created a QueueConnection, start it, send a message and return to parent EJB I have AccessLocalException when try to get some another EJB local interface
 
 
Note that under JBoss 4.x it works fine!
 
 
Does anyone know what am I doing wrong?
 
Thanks in advance
 
 
My configuration:
 
My security domain:
<application-policy name="VTBiz-Portal">
<authentication>
<login-module code="com.vtsystems.vtbiz.security.VTLoginModule" flag="required">
<module-option name="unauthenticatedIdentity">guest</module-option>
<module-option name="dsJndiName">java:/VTPortalDS</module-option>
<module-option name="principalsQuery">SELECT UD.password FROM UserData as UD inner join User U on U.currentData = UD.id where UD.userName=? and userAccess = 'STAFF'</module-option>
<module-option name="rolesQuery">SELECT r.name, 'Roles' FROM UserRole as ur inner join User U on U.id = ur.user inner join Role r on r.id = ur.role inner join UserData UD on U.currentData = UD.id where ur.active=1 and UD.userName=?</module-option>
<module-option name="userIdQuery">SELECT U.id FROM UserData as UD inner join User U on U.currentData = UD.id where UD.userName=?</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
<module-option name="hashEncoding">hex</module-option>
<module-option name="hashCharset">UTF-8</module-option>
<module-option name="principalClass">com.vtsystems.vtbiz.security.VTPrincipal</module-option>
</login-module>
</authentication>
</application-policy>
 
 
 
 
 
My messaging/messaging-jboss-beans.xml :
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!--
    Messaging beans
    $Id: messaging-jboss-beans.xml 88672 2009-05-11 20:49:47Z mailto:anil.saldhana at jboss.com $
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
 
 
 
   <!-- messaging application-policy definition -->
   <application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
      <authentication>
         <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
            <module-option name="unauthenticatedIdentity">guest</module-option>
            <module-option name="dsJndiName">java:/DefaultDS</module-option>
            <module-option name="principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
            <module-option name="rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
         </login-module>
      </authentication>
   </application-policy>
 
   <bean name="SecurityStore" class="org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore">
      <!-- default security configuration -->
      <property name="defaultSecurityConfig">
         <![CDATA[
            <security>
               <role name="guest" read="true" write="true" create="true"/>
            </security>
         ]]>
      </property>
      <property name="suckerPassword">CHANGE ME!!</property>
      <property name="securityDomain">messaging</property>
      <property name="securityManagement"><inject bean="JNDIBasedSecurityManagement"/></property>
      <!-- @JMX annotation to export the management view of this bean -->
      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.messaging:service=SecurityStore",exposedInterface=org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStoreMBean.class)</annotation>
      <!-- Password Annotation to inject the password from the common password utility
       <annotation>@org.jboss.security.integration.password.Password(securityDomain="messaging",methodName="setSuckerPassword")</annotation>
       -->
   </bean>
 
   <bean name="MessagingDeploymentTemplateInfoFactory"
      class="org.jboss.managed.plugins.factory.DeploymentTemplateInfoFactory"/>
 
   <bean name="QueueTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
      <property name="info"><inject bean="QueueTemplateInfo"/></property>
   </bean>
   <bean name="QueueTemplateInfo"
      class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
      <constructor factoryMethod="createTemplateInfo">
         <factory bean="DSDeploymentTemplateInfoFactory"/>
         <parameter class="java.lang.Class">org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo</parameter>
         <parameter class="java.lang.Class">org.jboss.jms.server.destination.QueueServiceMO</parameter>
         <parameter class="java.lang.String">QueueTemplate</parameter>
         <parameter class="java.lang.String">A template for JMS queue *-service.xml deployments</parameter>
      </constructor>
      <property name="destinationType">QueueTemplate</property>
   </bean>
 
   <bean name="TopicTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
      <property name="info"><inject bean="TopicTemplateInfo"/></property>
   </bean>
   <bean name="TopicTemplateInfo"
      class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
      <constructor factoryMethod="createTemplateInfo">
         <factory bean="DSDeploymentTemplateInfoFactory"/>
         <parameter class="java.lang.Class">org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo</parameter>
         <parameter class="java.lang.Class">org.jboss.jms.server.destination.TopicServiceMO</parameter>
         <parameter class="java.lang.String">TopicTemplate</parameter>
         <parameter class="java.lang.String">A template for JMS topic *-service.xml deployments</parameter>
      </constructor>
      <property name="destinationType">TopicTemplate</property>
   </bean>
 
</deployment>
 
 
 
 
my destinations-service.xml :
 
    <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=VTBizCommManager"
        xmbean-dd="xmdesc/Queue-xmbean.xml">
 
        <attribute name="RedeliveryDelay">600000</attribute>
        <attribute name="MaxDeliveryAttempts">-1</attribute>
 
        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
        <depends>jboss.messaging:service=PostOffice</depends>
    </mbean>
 
 
 
my EJB :
 
javax.naming.InitialContext initialContext = new javax.naming.InitialContext();
        try {
            Object tmp = initialContext.lookup("ConnectionFactory");
            QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
            QueueConnection con= qcf.createQueueConnection();
        } finally {
            initialContext.close();
        }
 
 
            try {
                QueueSession ses = con.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
                Queue que = getQueue();
                con.start();
 
                try {
                    ses.createSender(que).send(ses.createObjectMessage(obj));
                } finally {
                    ses.close();
                }
            } finally {
                con.close();
            }
 
 
 
 
my ejb-jar.xml :
      <message-driven >
         <description><![CDATA[Redirects all queued messages to {@link com.vtsystems.vtbiz.process.BusinessExecutionService}]]></description>
 
         <ejb-name>VTBizCommManager</ejb-name>
 
         <ejb-class>com.vtsystems.vtbiz.service.messaging.ejb.impl.VTBizCommManagerMdb</ejb-class>
 
         <messaging-type>javax.jms.MessageListener</messaging-type>
         <transaction-type>Container</transaction-type>
         <message-destination-type>javax.jms.Queue</message-destination-type>
         <activation-config>
           <activation-config-property>
             <activation-config-property-name>destinationType</activation-config-property-name>
             <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>
             <activation-config-property-name>acknowledgeMode</activation-config-property-name>
             <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
           </activation-config-property>
         </activation-config>
 
      </message-driven>
 
 
 
 
my jboss.xml :
      <message-driven>
         <ejb-name>VTBizCommManager</ejb-name>                       
         <destination-jndi-name>queue/VTBizCommManager</destination-jndi-name>
 
      </message-driven>

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/532205#532205




More information about the jboss-user mailing list