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

    As I was saving the file to my local drive, I looked at the package you had the class in. Seeing the word poll made we look through the code.

    MQSeries has a ConnectionConsumer so I'm not sure why you used a polling mechanism. Maybe this ContainerInvoker predates the MQSeries ConnectionConsumer. Or maybe this was written to work with some other JMS provider that didn't support ConnectionConsumer and it happened to work with MQSeries.

    In either case, if I get time I'll probably try to figure out why the standard MDB doesn't work instead of trying this container. One of the things I'm try to get away from is having a bunch of threads doing blocking reads.

    Thanks again for posting the code.

    -Peter

  • 31. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Peter Callies Newbie

    I'm ba-aack.

    First of all, I'd like to give my compliments to the chef (Peter). The standard MDB container works as advertised once I finished stumbling through the configuration (doh!).

    Using 3.0.0RC2, the final piece to the puzzle was configuring the JMS service to use the MQSeries connection factory instead of the Spy connection factory.

    Here is the configuration I ended up with.

    -I removed jbossmq-destinations-service.xml and jbossmq-service.xml from the deploy directory to reduce the possibility of unintended conflicts.

    -I added the following to the jms-service.xml file to enable me to point to the MQSeries connection factories:
    <!-- The MQSeries JMS provider loader -->

    MQSeriesJMSProvider

    org.jboss.jms.jndi.JBossMQProvider

    qcf
    tcf


    -I modified Standard Message Driven Bean Container configuration in standardjboss.xml to use the MQSeriesJMSProvider:
    MQSeriesJMSProvider

    -In jboss-service.xml I added the following ExternalContext configuration:

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


    -In jboss-service.xml I added the following NamingAlias for my connection factory which satisfies the resource-ref for my EJB as well as the MQSeriesJMSProvider:

    external/fs/mqjndi/pcallies
    qcf


    external/fs/mqjndi/pcalliestcf
    tcf
    -In jboss-service.xml I added the following NamingAlias for my connection factory which satisfies the DLQ configuration:

    external/fs/mqjndi/pcallies
    java:/ConnectionFactory


    -I added the following NamingAliases for the queues my MDB references:

    external/fs/mqjndi/Router1Input
    queue/Router1Input


    external/fs/mqjndi/HQResponses
    queue/HQResponses


    -I added the following NamingAlias for the DLQ:

    external/fs/mqjndi/DLQ
    queue/DLQ


    I still get the exception below if the queue is populated with more than a few messages (I'm using 100 in my test case) before I start the MDB. In this situation, I also get DEBUG output stating "The Pool for com.mckhboc.realtime.common.edi.mdb.HelloMDB has been overloaded. You should change pool parameters." I'm beginning to investigate this, but if you know of a configuration tweak I can make, please let me know.

    2002-05-08 14:29:00,028 ERROR [STDERR] java.lang.NullPointerException
    2002-05-08 14:29:00,028 ERROR [STDERR] at com.ibm.mq.jms.MQSession.run(MQSession.java:980)
    2002-05-08 14:29:00,028 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:175)
    2002-05-08 14:29:00,028 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:655)
    2002-05-08 14:29:00,028 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

  • 32. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Peter Callies Newbie

    I'm ba-aack.

    First of all, I'd like to give my compliments to the chef (Peter). The standard MDB container works as advertised once I finished stumbling through the configuration (doh!).

    Using 3.0.0RC2, the final piece to the puzzle was configuring the JMS service to use the MQSeries connection factory instead of the Spy connection factory.

    Here is the configuration I ended up with.

    -I removed jbossmq-destinations-service.xml and jbossmq-service.xml from the deploy directory to reduce the possibility of unintended conflicts.

    -I added the following to the jms-service.xml file to enable me to point to the MQSeries connection factories:
    <!-- The MQSeries JMS provider loader -->

    MQSeriesJMSProvider

    org.jboss.jms.jndi.JBossMQProvider

    qcf
    tcf


    -I modified Standard Message Driven Bean Container configuration in standardjboss.xml to use the MQSeriesJMSProvider:
    MQSeriesJMSProvider ;

    -In jboss-service.xml I added the following ExternalContext configuration:

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


    -In jboss-service.xml I added the following NamingAlias for my connection factory which satisfies the resource-ref for my EJB as well as the MQSeriesJMSProvider:

    external/fs/mqjndi/pcallies
    qcf


    external/fs/mqjndi/pcalliestcf
    tcf
    -In jboss-service.xml I added the following NamingAlias for my connection factory which satisfies the DLQ configuration:

    external/fs/mqjndi/pcallies
    java:/ConnectionFactory


    -I added the following NamingAliases for the queues my MDB references:

    external/fs/mqjndi/Router1Input
    queue/Router1Input


    external/fs/mqjndi/HQResponses
    queue/HQResponses


    -I added the following NamingAlias for the DLQ:

    external/fs/mqjndi/DLQ
    queue/DLQ


    I still get the exception below if the queue is populated with more than a few messages (I'm using 100 in my test case) before I start the MDB. In this situation, I also get DEBUG output stating "The Pool for com.mckhboc.realtime.common.edi.mdb.HelloMDB has been overloaded. You should change pool parameters." I'm beginning to investigate this, but if you know of a configuration tweak I can make, please let me know.

    2002-05-08 14:29:00,028 ERROR [STDERR] java.lang.NullPointerException
    2002-05-08 14:29:00,028 ERROR [STDERR] at com.ibm.mq.jms.MQSession.run(MQSession.java:980)
    2002-05-08 14:29:00,028 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:175)
    2002-05-08 14:29:00,028 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java: 655)
    2002-05-08 14:29:00,028 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

  • 33. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Christian Holliday Newbie

    I have Jboss-2.4.5.RC3 installed and working on a Red Hat 7.1 machine. Our company is starting to implement IBM MQSeries everywhere and I am going to have it installed on our DEC Alpha. I want to use MQSeries as my main communication link between our linux machine and our Alpha. The Alpha we be in charge of reporting to our IBM mainframe business system. The client for MQSeries does not queue up messages if it cannot contact the server so I would have to develop some way to queue up messages from our linux machine. If I integrate MQSeries into Jboss will I have queueing if the MQSeries server is down? We currently use DEC MessageQ everywhere in our Alpha environment, so I looked into BEA MessageQ but it's Java front end was entirely too expensive. But another department uses BEA MessageQ on their linux machine using C, is something available for me to integrate BEA MessageQ?

  • 34. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Aanchal Newbie

    Hi,

    I am working on configuring Jboss 2.2 with Mqseries 5.2 . What i need to know is do i have to upgrade to Jboss 2.4 inorder to work with Mqseries or can i work with Jboss 2.2. Since a week i have been struggling on gettin Mqseries to work with Jboss 2.2 but not been able to do so. I need some help urgently and when i did as per details done by Peter and you i still had no luc with the configuration. Please help me i have posted my problem on the forums and need help !!! Please let me know if I should work on Jboss 3.0 or it is possible to keep struggling on Jboss 2.2 .

  • 35. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Benoit Xhenseval Newbie

    Has anyone managed to solve this issue?

    2002-05-08 14:29:00,028 ERROR [STDERR] java.lang.NullPointerException
    2002-05-08 14:29:00,028 ERROR [STDERR] at com.ibm.mq.jms.MQSession.run(MQSession.java:980)
    2002-05-08 14:29:00,028 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:175)
    2002-05-08 14:29:00,028 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:655)
    2002-05-08 14:29:00,028 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

    We are facing the same problem when we start Jboss 2.4.x with a "pre-loaded" MQSeries queue.

    Many thanks

    Benoit.

  • 36. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Jerôme De Clerck Newbie

    Very interesting thread you guys have going here and as someone about to begin using JBoss with MQSeries I appreciate the effort you have all gone to in explaining your experiences. :)

    I have read through all the postings and are about to embark on connecting JBoss 3.0 and MQSeries 5.2. Does the posting above from Peter still stand as the configuration standard that I should follow?

    thanks,
    Jerôme

  • 37. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Marcos Oda Newbie

    Hi all,

    I configure everything, but I´m having problems to configure the JMSProviderLoader. I have to use a custom class and use a ProviderUrl like this example:


    DefaultJMSProvider
    org.jboss.jms.jndi.JBossMQSeriesProvider
    file:///jndiRoot
    QueueConnectionFactory
    QueueConnectionFactory


    Someone can show me the custom class. And what do I have to put in ProviderUrl?

    Thank´s

    Marcos Oda


  • 38. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Allen Hsu Newbie

    Dear All,
    Just want to share a successful story here as a starting point when you try to integrate MQSeries(5.2) as a JMS Provier in JBoss(3.0.0)
    I have been trying to look up key words like "JBoss and MQSeries", "MQSeries and JMX" and "JBoss and JMS Provider" from search engine, Google. It really helps!

    First of all, JMSAdmin can use JBossNS service directly. Try this JMSAdmin.config:
    INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
    PROVIDER_URL=jnp://localhost/


    Secondly, create a new class MQSeriesProvider that extends AbstractJMSProviderAdapter in package org.jboss.jms.jndi. This class just mimics JBossMQProvider. Rebuild JBoss and get a new jboss.jar that contains MQSeriesProvider.

    Thirdly, modify standardjboss.xml:
    Replace this
    DefaultJMSProvider
    with this
    MQSeriesProvider
    Also, modify jms-service.xml:
    Replace this
    <!-- The JMS provider loader

    DefaultJMSProvider

    org.jboss.jms.jndi.JBossMQProvider

    java:/XAConnectionFactory
    java:/XAConnectionFactory

    with this
    <!-- The MQSeries JMS provider loader -->

    MQSeriesProvider

    org.jboss.jms.jndi.MQSeriesProvider

    MQQueueCF
    MQTopicCF


    Now, you are ready to run this new JBoss with MQSeries as JMS Provider

    Back to JMSAdmin. Create following objects.
    InitCtx> def qcf(MQQueueCF) qmanager(MGW.QM) host(192.168.7.102) port(1416) channel(SMS.PLUGINI.CHL) transport(client)
    InitCtx> change ctx(queue)
    InitCtx/queue> def q(plugini) queue(SMS.PLUGINI.PLY.Q) qmanager(MGW.QM)


    Finally, create a standard MDB (with a destination points to 'plugini', in my case). No additinal setting required. And then deploy it and see how it works.

    In my case, I can see my legacy system put a message to SMS.PLUGINI.PLY.Q and the MDB got the message nicely.

    Cheers,
    Allen Hsu

  • 39. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Shai Bentin Newbie

    to Allen Hsu,

    I'm a little puzzelled. If you got it to work with the regular initial context factory, why did you have to create a new MQSeriesProvider?

  • 40. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Shai Bentin Newbie

    I tried this last strategy...

    I populated the MQQueuefactory and an MQ Queue objects into the jndi. I edited the jms-service.xml accordinly. However, I get a classCastException from the JMSContainerInvoker (and I don't know which class it's not able to cast because the info is not there) any ideas?

  • 41. Re: MQSeries/JBoss MDB/3rd Party Messaging
    David Tauzell Newbie

    There is one other issue. MQSeries client (all java) drivers are not XA compliant. JBoss assumes that your MBeans want an XAQueueConnectionFactory which cannot be case to MQQueueConnectionFactory.

    I added the following to my jboss.xml descriptor file to tell it to not use XA transactions:
    <xa-connection>false</xa-connection>

    For example:

    <message-driven>
    <ejb-name>MyMdb</ejb-name>
    <destination-jndi name>queue/my_queue</destination-jndi-name>
    <xa-connection>false</xa-connection>
    </message-driven>

    If this doesn't help can you post your stack trace?

    -dave

  • 42. Re: MQSeries/JBoss MDB/3rd Party Messaging
    thethunderking Newbie

    Hi Everybody,

    We have been trying to connect MQSeries with JBoss with quite some time now. We have been able to refer the JNDI service running on JBoss through JMSAdmin and have created the reqd. objects QueueConnectionFactory and have also bound a Queue named testQueue under QueueManager named myQueueManager. And have also made the corresponding objects on the WebSphere MQ.

    Our setup exist of a WebSphereMQ 5.3 running on a machine and JBoss 3.0.6 running on a different machine.

    We have done the following using the wonderful case studies being provided on this thread.

    1. Updated the JMSAdmin.config in the MQSeries

    INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
    PROVIDER_URL=jnp://10.*.*.*:1099/

    2. Created a new class MQSeriesProvider that extends AbstractJMSProviderAdapter in package org.jboss.jms.jndi. This class mimics JBossMQProvider. Rebuild JBoss and get a new jboss.jar that contains MQSeriesProvider. And updated the jboss.jar in the lib directory of the default server.

    3.Updated the standardjboss.xml replacing the DefaultJMSProvider
    with this
    MQSeriesProvider

    4.Also, modified the jms-service.xml:
    Replacing :
    <!-- The JMS provider loader

    DefaultJMSProvider

    org.jboss.jms.jndi.JBossMQProvider

    java:/XAConnectionFactory
    java:/XAConnectionFactory

    with this
    <!-- The MQSeries JMS provider loader -->

    MQSeriesProvider

    org.jboss.jms.jndi.MQSeriesProvider

    MQQueueCF
    MQTopicCF


    5. We also updated the jboss-service.xml so as to use the MQSeriesProvider class as JMS provider.

    Now we tried setting up a small test environment using the test code provided in the QuickStart.pdf

    ----------------- PrintBean.java ---------------------

    package example.beans;

    import javax.ejb.MessageDrivenBean;
    import javax.ejb.MessageDrivenContext;
    import javax.ejb.EJBException;
    import javax.jms.MessageListener;
    import javax.jms.Message;

    public class PrintBean implements MessageDrivenBean,
    MessageListener {
    public void setMessageDrivenContext(MessageDrivenContext c)
    throws EJBException {}
    public void ejbCreate() {}
    public void ejbRemove() {}
    public void onMessage(Message message) {
    System.err.println("Got Message: " + message.toString());
    }
    }
    ---------------------------------------------------------

    -------------------- jboss.xml ------------------------
    <?xml version="1.0"?>

    <enterprise-beans>
    <message-driven>
    <ejb-name>PrintBean</ejb-name>
    <configuration-name>Standard Message Driven Bean</configuration-name>
    <destination-jndi-name>queue/testQueue1</destination-jndi-name>
    <xa-connection>false</xa-connection>
    </message-driven>
    </enterprise-beans>

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

    ------------------ ejb-jar.xml -------------------------<?xml version="1.0"?>
    <!DOCTYPE ejb-jar>
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <ejb-name>PrintBean</ejb-name>
    <ejb-class>example.beans.PrintBean</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>
    </enterprise-beans>
    </ejb-jar>
    ---------------------------------------------------------

    On deploying this setup. We get the following error.

    17:17:53,069 INFO [DLQHandler] Creating
    17:17:53,079 ERROR [DLQHandler] Initialization failed
    java.lang.ClassCastException: javax.naming.Reference
    at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:12
    1)
    at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
    136)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContaine
    rInvoker.java:608)
    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)

    Any help regarding this would be highly appreciated by me.

    Best Regards
    Thunder.

  • 43. Re: MQSeries/JBoss MDB/3rd Party Messaging
    thethunderking Newbie

    Hi Everybody,

    We have been trying to connect MQSeries with JBoss with quite some time now. We have been able to refer the JNDI service running on JBoss through JMSAdmin and have created the reqd. objects QueueConnectionFactory and have also bound a Queue named testQueue under QueueManager named myQueueManager. And have also made the corresponding objects on the WebSphere MQ.

    Our setup exist of a WebSphereMQ 5.3 running on a machine and JBoss 3.0.6 running on a different machine.

    We have done the following using the wonderful case studies being provided on this thread.

    1. Updated the JMSAdmin.config in the MQSeries

    INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
    PROVIDER_URL=jnp://10.*.*.*:1099/

    2. Created a new class MQSeriesProvider that extends AbstractJMSProviderAdapter in package org.jboss.jms.jndi. This class mimics JBossMQProvider. Rebuild JBoss and get a new jboss.jar that contains MQSeriesProvider. And updated the jboss.jar in the lib directory of the default server.

    3.Updated the standardjboss.xml replacing the DefaultJMSProvider
    with this
    MQSeriesProvider

    4.Also, modified the jms-service.xml:
    Replacing :
    <!-- The JMS provider loader

    DefaultJMSProvider

    org.jboss.jms.jndi.JBossMQProvider

    java:/XAConnectionFactory
    java:/XAConnectionFactory

    with this
    <!-- The MQSeries JMS provider loader -->

    MQSeriesProvider

    org.jboss.jms.jndi.MQSeriesProvider

    MQQueueCF
    MQTopicCF


    5. We also updated the jboss-service.xml so as to use the MQSeriesProvider class as JMS provider.

    Now we tried setting up a small test environment using the test code provided in the QuickStart.pdf

    ----------------- PrintBean.java ---------------------

    package example.beans;

    import javax.ejb.MessageDrivenBean;
    import javax.ejb.MessageDrivenContext;
    import javax.ejb.EJBException;
    import javax.jms.MessageListener;
    import javax.jms.Message;

    public class PrintBean implements MessageDrivenBean,
    MessageListener {
    public void setMessageDrivenContext(MessageDrivenContext c)
    throws EJBException {}
    public void ejbCreate() {}
    public void ejbRemove() {}
    public void onMessage(Message message) {
    System.err.println("Got Message: " + message.toString());
    }
    }
    ---------------------------------------------------------

    -------------------- jboss.xml ------------------------
    <?xml version="1.0"?>

    <enterprise-beans>
    <message-driven>
    <ejb-name>PrintBean</ejb-name>
    <configuration-name>Standard Message Driven Bean</configuration-name>
    <destination-jndi-name>queue/testQueue1</destination-jndi-name>
    <xa-connection>false</xa-connection>
    </message-driven>
    </enterprise-beans>

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

    ------------------ ejb-jar.xml -------------------------<?xml version="1.0"?>
    <!DOCTYPE ejb-jar>
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <ejb-name>PrintBean</ejb-name>
    <ejb-class>example.beans.PrintBean</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>
    </enterprise-beans>
    </ejb-jar>
    ---------------------------------------------------------

    On deploying this setup. We get the following error.

    17:17:53,069 INFO [DLQHandler] Creating
    17:17:53,079 ERROR [DLQHandler] Initialization failed
    java.lang.ClassCastException: javax.naming.Reference
    at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:12
    1)
    at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
    136)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContaine
    rInvoker.java:608)
    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)

    Any help regarding this would be highly appreciated by me.

    Best Regards
    Thunder.

  • 44. Re: MQSeries/JBoss MDB/3rd Party Messaging
    Jiri Chaloupka Newbie

    is there any way to call JBoss-MQ from another source (call JBossMQ from Oracle procedure written in Pl/SQL and call put or get from MQ series) ? I need to start this process from Oracle DB and I cannot communicate with MQSeries directly (some problem with OS versions ...) and I don t want to run Java inside the db ...