6 Replies Latest reply on Sep 27, 2001 9:58 AM by pra

    Setup JMS resource adapter problem

    willievu

      I follow the manual and fail to get a JMS connection. The problem seems like JmsXA can never create a connection due some security problem. Here is the server log:

      [JmsXA] Using default value 'java:DefaultJMSProvider' for config property 'JmsProviderAdapterJNDI'
      [JmsXA] FINE: Setting LogWriter: org.jboss.logging.LogWriter@472243
      [JmsXA] Unable to create ManagedConnection: javax.resource.spi.SecurityException: No Subject or Conn
      ectionRequestInfo set, could not get credentials
      [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 factory org.jboss.pool.connector.Managed
      ConnectionPoolFactory@5c9766 unable to create new object!
      [JmsXA] Unable to create ManagedConnection: javax.resource.spi.SecurityException: No Subject or Conn
      ectionRequestInfo set, could not get credentials
      [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 factory org.jboss.pool.connector.Managed
      ConnectionPoolFactory@5c9766 unable to create new object!
      [JmsXA] Unable to create ManagedConnection: javax.resource.spi.SecurityException: No Subject or Conn
      ectionRequestInfo set, could not get credentials
      [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 factory org.jboss.pool.connector.Managed
      ConnectionPoolFactory@5c9766 unable to create new object!
      [JmsXA] Unable to create ManagedConnection: javax.resource.spi.SecurityException: No Subject or Conn
      ectionRequestInfo set, could not get credentials
      [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 factory org.jboss.pool.connector.Managed
      ConnectionPoolFactory@5c9766 unable to create new object!
      [JmsXA] Unable to create ManagedConnection: javax.resource.spi.SecurityException: No Subject or Conn
      ectionRequestInfo set, could not get credentials
      [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 factory org.jboss.pool.connector.Managed
      ConnectionPoolFactory@5c9766 unable to create new object!
      [JmsXA] Bound connection factory for resource adapter 'JMS Adapter' to JNDI name 'java:/JmsXA'

      Can someone help me correct this?

        • 1. Re: Setup JMS resource adapter problem
          willievu

          I'm using JBoss 2.4.1a with Tomcat 3.2.3. The JMS portion of jboss.jcml looks like this:

          <!-- For Message Driven Beans -->


          DefaultJMSProvider
          org.jboss.jms.jndi.JBossMQProvider
          java:/XAConnectionFactory
          java:/XAConnectionFactory


          StdJMSPool
          org.jboss.jms.asf.StdServerSessionPoolFactory



          ../../db/jbossmq/




          <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->

          JmsXA
          JCA:service=RARDeployer
          JMS Adapter
          MinervaXACMFactory
          <!-- See the documentation for the specific connection manager
          implementation you are using for the properties you can set -->

          # Pool type - uncomment to force, otherwise it is the default
          #PoolConfiguration=per-factory

          # Connection pooling properties - see
          # org.jboss.pool.PoolParameters
          MinSize=5
          MaxSize=10
          Blocking=true
          GCEnabled=false
          IdleTimeoutEnabled=false
          InvalidateOnError=false
          TrackLastUsed=false
          GCIntervalMillis=120000
          GCMinIdleMillis=1200000
          IdleTimeoutMillis=1800000
          MaxIdleTimeoutPercent=1.0


          <!-- Principal mapping configuration -->
          org.jboss.resource.security.ManyToOnePrincipalMapping

          userName=sa
          password=



          Thanks again.

          • 2. Re: Setup JMS resource adapter problem

            Seems strange. Have you tested to do it without your added principal mapping?

            //Peter

            • 3. Re: Setup JMS resource adapter problem
              willievu

              Yes I did. I am using JAAS though for EJBs. Does it have something to do with this JMS security problem?

              • 4. Re: Setup JMS resource adapter problem
                davidjencks

                Aha! you have to set minsize 0 in the pool unless you can supply default credentials to the adapter. In this case, the adapter does not support UserName and Password attributes, so you can't. The "Minsize" connections are created with no context, so there is no way to get a Subject unless the adapter is configured with a default. (JBoss can't really know that the ManyToOnePrincipalMapping always returns the same Subject)

                So -- you should set minsize 0 and we should add UserName and Password to the rar (and provide them to ManagedConnections as default).

                And I should add a comment in the manual about this gotcha.

                Peter, would you like to do this (modify the rar) or shall I?

                thanks
                david jencks

                • 5. Re: Setup JMS resource adapter problem
                  willievu

                  ok. I tried David's suggestion. However, when my entity bean tries to get a connection, the server encounters problem. It keeps saying connection factory is not bound by the JNDI name. Here is the server log:

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

                  [JmsXA] Unable to create ManagedConnection: javax.resource.spi.CommException: javax.naming.NameNotFoundException: INVMXATopicConnectionFactory not bound
                  [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 factory org.jboss.pool.connector.ManagedConnectionPoolFactory@688b35 unable to create new object!
                  [JmsXA] Pool org.jboss.jms.ra.JmsManagedConnectionFactory-1 [0/0/10] waiting for a free object

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

                  I tried many combinations of JMSProviderLoader but all combinations yield the same result.

                  Here is the excerpt from jboss.jcml. Notice that the commented out QueueFactoryRef and TopicFactoryRef are all the combinations I tried.

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


                  DefaultJMSProvider
                  org.jboss.jms.jndi.JBossMQProvider
                  <!--
                  java:/INVMXAQueueConnectionFactory
                  java:/INVMXATopicConnectionFactory
                  -->
                  <!--
                  java:/XAQueueConnectionFactory
                  java:/XATopicConnectionFactory
                  -->
                  <!--
                  java:/XAConnectionFactory
                  java:/XAConnectionFactory
                  -->
                  <!--
                  java:/ConnectionFactory
                  java:/ConnectionFactory
                  -->
                  <!--
                  java:/INVMQueueConnectionFactory
                  java:/INVMTopicConnectionFactory
                  -->
                  XAConnectionFactory
                  XAConnectionFactory


                  StdJMSPool
                  org.jboss.jms.asf.StdServerSessionPoolFactory



                  ../../db/jbossmq/





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

                  • 6. Re: Setup JMS resource adapter problem

                    Hi, in your first example configuration you had a correct JMS provider adapter configured.


                    DefaultJMSProvider
                    org.jboss.jms.jndi.JBossMQProvider
                    java:/XAConnectionFactory
                    java:/XAConnectionFactory


                    This ought to work.

                    By the way. The problem you had earlier is now fixed in the CVS Head branch. But it is not backported to 2.4.x.

                    //Peter