1 2 3 4 5 6 Previous Next 79 Replies Latest reply on Jul 23, 2003 6:56 AM by quentin Go to original post
      • 45. Re: MQSeries/JBoss MDB/3rd Party Messaging

        JBoss creates a "Dead Letter Queue". If a message is re-delivered to your MDB too many times (configurable in the standardjboss.xml file). it then sends it to the dead letter queue. The actual JNDI name of the dead letter queue is also configurable.

        Since you provide your own JMS provider adapter, it is using an instance of MQQueueConnectionFactory to look up the dead letter queue. My bet is that the dead letter queue is not an MQQueue (you would have to create in in the JMSAdmin as such) but is a JBossMQ queue, hence the exception.

        There are two things you can do:

        1. Don't use your custom JMSProviderAdapter.
        2. Configure JBoss so that the JNDI name of the dead letter queue references an actual MQQueue.

        -Dave

        • 46. Re: MQSeries/JBoss MDB/3rd Party Messaging
          henryb

          We currently have MSeries and Jboss working(Almost).

          (INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory) and put the required MQseries entries in it using the JMSAdmin tool. This works fine.
          We created an external context similar to :

          external/fs
          external.fs.props
          javax.naming.InitialContext




          However, How do I get the Bean that I created and deployed to JBoss to use the fscontext I created. The Bean I created has a OnMessage() method, but it seems that it only connects to the JBossNS default context and I need it to access the fscontext with the MQSeries queue definitions, when the Jboss container instatiates the bean. How/where do I tell JBoss to use the external fscontext??

          Henry
          Does any

          • 47. Re: MQSeries/JBoss MDB/3rd Party Messaging
            sairam_70

            Hi ,

            I tried your steps to modify the JBOSS COnf files , but I am not able to see any new JNDI Name which I have created for MQSeries based connection .

            You have mentioned JBOSSMQSeriesProvider , is that you need to write a seperate Java class for working with MQ Series

            I am really confused , Can you repeat more step wise and how to check the new MQSeries based JMS in the jmx-console ?

            Help is highly appriciated



            • 48. Re: MQSeries/JBoss MDB/3rd Party Messaging
              sairam_70

              I have the same problem . How can I configure JBossMQ for DefaultJMSProvider and MQSeriesJMSProvider for MQ Series and how can I test it .

              in the Jmx-console I get only the JBSSMQProvider irrespective of changes in the jms-ds.xml and jboss-service.xml

              Can you post (Cut and Paste ) the config files in the Fourm

              Many thanks

              • 49. Re: MQSeries/JBoss MDB/3rd Party Messaging
                rudifr

                Hello all,

                We also need the integration of Websphere MQ with JBoss. It must be Websphere MQ because we communicate with Non-JMS-Clients over Websphere MQ. I found very confusing what I read up to now in this thread. Something like a "how-to integrate Websphere MQ with JBoss would be very helpful.
                Thanks in advance

                - Rudi

                • 50. Re: MQSeries/JBoss MDB/3rd Party Messaging
                  mars73

                  hello all,

                  I am trying to get IBM Websphere MQ 5.3 to work with JBOSS 3.2.1...

                  I manage to get context via...

                  INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
                  PROVIDER_URL=jnp://localhost

                  I manage to use JMSAdmin to add QCF and Q to context

                  I am tring to run some simple send and receive JMS example but receive some error

                  ---------
                  jms-hello-sender:
                  [echo] Using resources from: C:\jboss\examples/resources
                  [java] java.lang.ClassCastException: javax.naming.Reference
                  [java] at org.jboss.docs.jms.client.HelloSender.setupQueue(HelloSender.
                  [java] at org.jboss.docs.jms.client.HelloSender.main(HelloSender.java:6
                  [java] Exception in thread "main"
                  [java] Java Result: 1

                  -----------

                  error comes from

                  Object tmp = iniCtx.lookup("QueueConnectionFactory");
                  QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;

                  It seems that I am getting a MQQueueConnectionFactory object and cant be cast into QueueConnectionFactory... how can this be happening? Subclass can be cast to parent rite?






                  • 51. Re: MQSeries/JBoss MDB/3rd Party Messaging
                    amapumu

                    Hi all,
                    I use the values:

                    INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
                    PROVIDER_URL=jnp://localhost


                    in JMSAdmin, but I'm not sure wich commands I need to add a queue to JNDI.

                    I've read in previous posts that I need enter the folloeing commands:

                    InitCtx> def qcf(QueueConnectionFactory) qmanager(queue_manager_name)

                    InitCtx> def ctx(queue)

                    InitCtx> change ctx(queue)

                    InitCtx/queue> def q(RequestQueue) qmanager(queue_manager_name) queue(queue_name)

                    InitCtx/queue> end

                    Where queue_name and queue_manager_name should be replaced with my environment values.


                    But, who have post these commands uses:

                    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
                    PROVIDER_URL=file:///jndiRoot


                    And when I start the JMSAdmin I can see that the queue context is defined.

                    Could someone help me?

                    Thanks.

                    Mario

                    • 52. Re: MQSeries/JBoss MDB/3rd Party Messaging
                      amapumu

                      Sorry, I have seen that in Allen Hsu messages appear the answer to my question.

                      Thanks.

                      • 53. Re: MQSeries/JBoss MDB/3rd Party Messaging
                        tcherel


                        Thanks to this thread I managed (without too much pain) to have WebSphere MQ 5.3 working as a JMS provider in JBoss 3.0.5.
                        Thanks a lot to everyone providing details on how to do it.
                        You can find below the details of what I did to make it work.

                        I tried a couple of different things as well:

                        - Having both the WebSphere MQ JMS provider and JBoss provider working in JBoss (I do not want to replace one by the other, I want both to coexist). This is working fine. I can have an MDB reading messages from a WebSphere MQ queue and sending a reply to a JBoss queue.

                        - I will be interested by anyone sending an example of the custom MBean to load the factory and queue in the JNDI namespace (post 19 by dtauzell).

                        - I am now trying to have all that working with XA (my goal is to have the MDB reading from WebSphere MQ and sending a reply to a JBoss MQ all in the same transaction). But I am experiencing some problems, my last one being the following error when deploying the MDB:

                        02:09:32,718 WARN [JMSContainerInvoker] JMS provider failure detected:
                        javax.jms.JMSException: MQJMS1068: failed to obtain XAResource
                        at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:530)
                        at com.ibm.mq.jms.MQXAQueueConnection.createXAQueueSession(MQXAQueueConnection.java:96)
                        at org.jboss.jms.asf.StdServerSessionPool.create(StdServerSessionPool.java:359)

                        Anyone having any success in setting WebSphere MQ in JBoss with XA support?


                        Thanks.

                        Thomas


                        1) I copied the following files from the MQSeries java lib directory to the JBoss lib directory:
                        com.ibm.mq.jar
                        com.ibm.mqjms.jar
                        com.ibm.mqbind.jar
                        fscontext.jar
                        providerutil.jar

                        Not sure the two last jars are really required.

                        2) In jms-service.xml, duplicate the org.jboss.jms.jndi.JMSProviderLoader mbean. Change the ProviderName to MQSeriesJMSProvider, chnage the QueueFactoryRef to MQQueueConnectionFactory (I also changed the TopicFactoryRef to MQQueueConnectionFactory, but I did not play with topics).

                        3) In standardjboss.xml, duplicate the Standard Message Driven Bean container configuration. Change the name Standard Message Driven Bean to MQSeries Message Driven Bean and set the JMSProviderAdapterJNDI to MQSeriesJMSProvider (same as ProviderName in jms-service.xml).

                        4) Modify the JMSAdmin.cfg and register the MQSeries object in JBoss JNDI

                        INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
                        PROVIDER_URL=jnp://localhost:1099

                        def qcf(MQQueueConnectionFactory) qmanager(qeue_manager) host(localhost) channel(queue_manager_channel) transport(client)
                        chg ctx(queue)
                        def q(MQRequestQueue) qmanager(qeue_manager) queue(TestQueue)

                        5) Deploy a message bean with the following configuration:

                        ejb-jar.xml (nothing specific):
                        <message-driven>
                        <ejb-name>MDB</ejb-name>
                        <ejb-class>jms.simple.MDB</ejb-class>
                        <message-selector></message-selector>
                        <transaction-type>Bean</transaction-type>
                        <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
                        <message-driven-destination>
                        <destination-type>javax.jms.Queue</destination-type>
                        </message-driven-destination>
                        </message-driven>

                        jboss.xml:
                        <message-driven>
                        <ejb-name>MDB</ejb-name>
                        <configuration-name>MQSeries Message Driven Bean</configuration-name>
                        <destination-jndi-name>queue/MQRequestQueue</destination-jndi-name>
                        <xa-connection>false</xa-connection>
                        </message-driven>

                        configuration name matches the newly created configuration in standardjboss.xml.
                        destination-jndi-name matches the context/name created through the JMSAdmin tool.
                        xa-connection is required to avoid invalid cast exception as jboss assumes by default that the factory is an XA factory.

                        • 54. Re: MQSeries/JBoss MDB/3rd Party Messaging
                          amapumu

                          I have working WebSphere MQ 5.3 as JBoss 3.2.0 JMS provider.
                          I have followed the steps of the previous replay,
                          but because I am using JBoss 3.2.X,
                          in standardjboss.xml I have to duplicate message-driven-beans
                          <invoker-proxy-binding>
                          and Standard Message Driven Beans
                          <container-configuration>
                          then I have done the changes, and I have added:
                          <invoker-proxy-binding-name>MQmessage-driven-bean</invoker-proxy-binding-name>
                          to <container-configuration>.

                          But whe I try to deploy the MDB I get the error:

                          13:44:01,056 ERROR [JMSContainerInvoker] Starting failed java.lang.ClassCastException: com.ibm.mq.jms.MQQueue
                          at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:69)
                          at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:113)
                          ....
                          13:44:01,296 ERROR [MessageDrivenContainer] Starting failed java.lang.ClassCastException: com.ibm.mq.jms.MQQueue
                          at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:69)
                          at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:113)
                          .....
                          13:44:01,536 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=local/enlaceMQBean,service=EJB
                          java.lang.ClassCastException: com.ibm.mq.jms.MQQueue
                          at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:69)
                          at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:113)
                          ....
                          13:44:01,817 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
                          Cause: Incomplete Deployment listing:
                          Packages waiting for a deployer:

                          Incompletely deployed packages:

                          MBeans waiting for classes:

                          MBeans waiting for other MBeans:
                          [ObjectName: jboss.j2ee:jndiName=local/enlaceMQBean,service=EJB
                          state: FAILED
                          I Depend On:
                          Depends On Me: java.lang.ClassCastException: com.ibm.mq.jms.MQQueue]


                          I think that the MDB ignores:
                          <configuration-name>MQSeries Message Driven Bean</configuration-name>
                          deployers tag (in jboss.xml).

                          Could someone help me? Because I need have runnig "MQSeries MDBs" and "Normal MDBs" in JBoss.

                          Thanks.

                          Mario

                          • 55. Re: MQSeries/JBoss MDB/3rd Party Messaging
                            tcherel

                            I just tried with JBoss 3.2.1 and everything is working fine.
                            It seems that your JBoss is considering your WS MQ queue to be one of its own and is trying to cast it as such.
                            Or actually it is considering the connection to be one of its own. Something is not properly configured in your MQ JMS provider. Did you chang the QueueFactoryRef in your provider in jms-ds.xml? If yes, to which object is ti pointing to?

                            Hope this helps.

                            Thomas

                            • 56. Re: MQSeries/JBoss MDB/3rd Party Messaging
                              amapumu

                              Hi,
                              I add this:

                              jms-ds.xml:

                              <!-- The MQSeries provider loader -->

                              MQSeriesProvider

                              org.jboss.jms.jndi.JBossMQProvider

                              QueueConnectionFactory
                              java:/XAConnectionFactory


                              standardjboss.xml:

                              <invoker-proxy-binding>
                              MQmessage-driven-bean
                              <invoker-mbean>default</invoker-mbean>
                              <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
                              <proxy-factory-config>
                              MQSeriesProvider
                              StdJMSPool
                              15
                              1
                              True

                              10

                              queue/DLQ
                              10
                              0


                              </proxy-factory-config>
                              </invoker-proxy-binding>

                              .....
                              .....
                              <container-configuration>
                              <container-name>MQSeries Message Driven Bean</container-name>
                              <call-logging>false</call-logging>
                              <invoker-proxy-binding-name>MQmessage-driven-bean</invoker-proxy-binding-name>
                              <container-interceptors>
                              org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor
                              org.jboss.ejb.plugins.LogInterceptor
                              org.jboss.ejb.plugins.RunAsSecurityInterceptor
                              <!-- CMT -->
                              org.jboss.ejb.plugins.TxInterceptorCMT
                              org.jboss.ejb.plugins.MetricsInterceptor
                              org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
                              <!-- BMT -->
                              org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
                              org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT
                              org.jboss.ejb.plugins.MetricsInterceptor
                              org.jboss.resource.connectionmanager.CachedConnectionInterceptor
                              </container-interceptors>
                              <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
                              <instance-cache></instance-cache>
                              <persistence-manager></persistence-manager>
                              <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
                              <container-pool-conf>
                              100
                              </container-pool-conf>
                              </container-configuration>


                              And into jboss.xml:



                              <enterprise-beans>

                              <message-driven>
                              <ejb-name>enlaceMQBean</ejb-name>
                              <configuration-name>MQSeries Message Driven Bean</configuration-name>
                              <destination-jndi-name>queue/MQqueue</destination-jndi-name>
                              </message-driven>

                              </enterprise-beans>

                              <resource-managers>
                              </resource-managers>



                              Where is the mistake?

                              Thanks for your help.

                              Mario.

                              • 57. Re: MQSeries/JBoss MDB/3rd Party Messaging
                                pjrmoreira

                                Hi,

                                I've everything that is described in the posts, but when I try to deploy my MDB I have the following exception:

                                18:24:31,555 ERROR [JMSContainerInvoker] Starting failed
                                java.lang.ClassCastException
                                at org.jboss.ejb.plugins.jms.JMSContainerInvoker.createDestination(JMSCo
                                ntainerInvoker.java:463)
                                at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContaine
                                rInvoker.java:793)
                                at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContain
                                erInvoker.java:824)
                                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
                                65)
                                at org.jboss.ejb.MessageDrivenContainer.start(MessageDrivenContainer.jav
                                a:200)
                                at org.jboss.ejb.Container.invoke(Container.java:756)
                                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
                                ler.java:978)

                                Anyone has any idea about what is going wrong?

                                Thanks

                                Paulo

                                • 58. Re: MQSeries/JBoss MDB/3rd Party Messaging

                                  Try 3.0.8 or 3.2.1RC1
                                  I recently added some more informative
                                  error messages.

                                  Regards,
                                  Adrian

                                  • 59. Re: MQSeries/JBoss MDB/3rd Party Messaging

                                    I meant 3.2.2RC1

                                    Regards,
                                    Adrian