0
votes

I'm writing, or trying to write, Baby's First MDB on WebSphere 7. I have nearly no hair left, having pulled it all out trying to get the thing to work. It appears that I've got everything set up right, but I get no response when I put a message to the associated queue.

Here's the EAR file setup:

simplemdb.ear
    META-INF
        Manifest.mf
        application.xml
    simplemdb.jar
        META-INF
            Manifest.mf
            ejb-jar.xml
        com
            [ classes go here ]

I can't find any syntax for defining the queue's JNDI name in ejb-jar.xml, so instead I:

  • Define a WebSphere activation spec. Name SimpleMDBActivationSpec, JNDI name jms/SimpleActivationSpec, Destination jms/SimpleMDBQueue.
  • Define a WebSphere queue. Name SimpleMDBQueue, JNDI name jms/SimpleMDBQueue, Queue name SIMPLE.MDB.QUEUE.
  • Define an MQ queue, name SIMPLE.MDB.QUEUE.
  • Deploy the EAR file. During the deployment, I'm asked to enter binding information. I select Activation Specification, then point the Target Resource JNDI Name and Destination JNDI name at the activation spec and queue, respectively.

(The MDB code has no annotations.) At this point, the app points to the spec and queue, and the spec points to the queue - belt and suspenders. Naturally, I imagine that the app therefore knows about the queue. Full of hope, I put a message on the queue, and ... nothing. The onMessage event is supposed to use System.out to log a message. I see no message.

Clear documentation on this is conspicuous by its absence. Google gives LOTS of results, but none of them details how the configuration all fits together. There's lots of hand-waving about ibm-ejb-jar-bnd.xmi, but examples of the file are arcane, full of opaque numbers with no explanation about how they were generated, or how they relate to other parts of the configuration.

For goodness' sake. All I want to do is deploy an MDB, and have it write "Hello, world" when I put a message to a queue. I'm using vi and ant as my development and build tools. Can anybody out there give me an idea about what I'm missing?

Edit: "zos" tag added.

2
I'm not an MDB expert, but your config steps for actspec, queue, and binding look proper, so I'm not sure what's wrong. I'll note that when checking Google, ibm-ejb-jar-bnd.xmi is for pre-EJB3, and .xml is used for EJB3. Regardless, those files are created/populated for you during the deployment step, so you shouldn't need them. Hope that helps...Brett Kail
Thanks. So far as I can tell, the ibm-ejb-jar-bnd.xmi/xml file gives the default values to use. I should be able to change bindings on the fly with the Admin Console. Doing so doesn't make the app work. =( Also, I just tried using a listener port instead of an activation spec. No go. WebSphere reports that everything is deployed just fine, but the MDB still doesn't respond in any way to puts to the queue. A bit of research uncovered the idea that if the MDB is properly listening, the MQ queue will show a connection (or two). That's not happening, either. Aargh!Singlestone

2 Answers

1
votes

I found the problem. It's specific to WebSphere running on z/OS. For an activation spec to be fully available in that environment, the Control Region Adjunct (CRA) process must be started. I told WAS to start it up, recycled the app server, and lo! My MDB started responding.

To make the CRA start via the WebSphere Admin Console, go to ...

  • Application servers > [server name] > Communications > Messaging > WebSphere MQ CRA Settings

... and check the box that says "Start CRA". Hit OK, save it to the master configuration, and to make the CRA actually start, bring the app server down and back up. (This is for WAS 7.0.)

Thanks to everyone for their time and thoughtspace.

0
votes

have a quick look at this and see if there is anything here that helps you.

http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.wasfpejb/wasfpejb/6.1/DevelopmentTools/WASv61_EJB3FP_MDBLab.pdf

I haven't played with this for the last one year so i am not able to comment straight away but i thought the PDF might be of some assistance to you.

HTH

Manglu