I seem to be having trouble getting a reference to the Queue from jndi. I've 
setup a Scoped queue as follows:

<?xml version="1.0" encoding="UTF-8"?>

 <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
        
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
 </loader-repository>
 <mbean code="org.jboss.jms.server.destination.Queue"
           name="jboss.messaging.destination:service=Queue,name=pulseMailQueue"
           xmbean-dd="xmdesc/Queue-xmbean.xml">
           <depends 
optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
           
              
                 
                 
                 
               
           
           75000
           2000
           2000
 


The messaging-server.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>


<!--
     The JBoss Messaging service deployment descriptor.

     $Id: messaging-service.xml,v 1.1 2006/05/02 02:45:10 ovidiu Exp $
 -->



   <mbean code="org.jboss.jms.server.ServerPeer"
      name="jboss.messaging:service=ServerPeer"
      xmbean-dd="xmdesc/ServerPeer-xmbean.xml">

      
         <!-- ServerPeerID -->
         
         <!-- DefaultQueueJNDIContext -->
         
         <!-- DefaultTopicJNDIContext -->
         
      

      <depends 
optional-attribute-name="ThreadPool">jboss.messaging:service=ThreadPool
      <depends 
optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager
      <depends 
optional-attribute-name="MessageStore">jboss.messaging:service=MessageStore
      <depends 
optional-attribute-name="ChannelMapper">jboss.messaging:service=ChannelMapper

      <!-- Set to -1 to completely disable client leasing -->
      java:/jaas/pulse-domain
      
        
            
        
      
   

   <!-- Plug-ins -->

   <mbean code="org.jboss.jms.server.plugin.DefaultThreadPool"
      name="jboss.messaging:service=ThreadPool"
      xmbean-dd="xmdesc/DefaultThreadPool-xmbean.xml">
      
         <!-- the default pool size -->
         
      
   

   <mbean code="org.jboss.messaging.core.plugin.SimpleMessageStore"
      name="jboss.messaging:service=MessageStore"
      xmbean-dd="xmdesc/SimpleMessageStore-xmbean.xml">
      
         <!-- StoreID -->
         
            
   



The login-config.xml domain config is as follows:

        <application-policy name = "pulse-domain">
                
                        <login-module   
                                
code="au.com.pulse.common.providers.jaas.LoggableDatabaseServerLoginModule"
                                flag="required">
                                <module-option 
name="dsJndiName">java:/jdbc/ScorpionJAAS</module-option>
                                <module-option name = 
"unauthenticatedIdentity">anonymous</module-option>
                                <module-option name="principalsQuery">
                                    <![CDATA[
                                    SELECT PASSWORD 
                                    FROM P_USER 
                                    WHERE LOGIN=?
                                    AND   ACTIVE=1
                                    AND   EFFECTIVE <= NOW()
                                    AND   (EXPIRES IS NULL OR EXPIRES >= NOW()) 
]]>
                                                </module-option>
                                <module-option name="rolesQuery">
                                    <![CDATA[
                                    SELECT NAME, 'Roles' 
                                    FROM VW_USER_ROLES
                                    WHERE login = ? ]]>
                                                </module-option>
                                                <!--module-option 
name="hashAlgorithm">SHA-1</module-option>
                                                <module-option 
name="hashEncoding">hex</module-option-->
                                <module-option 
name="enableLogging">true</module-option>
                        </login-module>
                        <login-module 
code="org.jboss.security.ClientLoginModule" flag="required" />
                
        </application-policy>

LoggableDatabaseServerLoginModule is just a subclass of 
DatabaseServerLoginModule that does some log statements on the method calls.

When I try to get a queue using the following EJB3 session bean code the Queue 
is always null. I can get the ConnectionFactory,
and the connection and establish a Session ok but cannot get the Queue from 
jndi:

@Stateless
@SecurityDomain(IPulseConstants.SECURITY_DOMAIN) //<-- this is "pulse-domain"
@Remote( { IMailFacade.class })
@RemoteBinding(jndiBinding = IMailFacade.JNDI_NAME_REMOTE)
public class MailFacadeBean implements IMailFacade {

    Log log = LogFactory.getLog(MailFacadeBean.class);

    @Resource(authenticationType = AuthenticationType.CONTAINER)
    private SessionContext ctx;
    
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public void sendMail(String inputMessage) throws Exception {
        String destinationName = "/queue/pulseMailQueue";

        ConnectionFactory cf = null;
        Connection connection = null;
        Connection connection2 = null;

        try {
            cf = (ConnectionFactory) ctx.lookup("java:/ConnectionFactory");
            Queue queue = (Queue) ctx.lookup(destinationName);
            log.info("Queue " + destinationName + " exists");

            connection = cf.createConnection();
            
            
            
I authenticate before calling the session bean and the caller principal is ok 
and also isCallerInRole("Supplier") returns true.

Not sure what else to try.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3943323#3943323

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3943323


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to