1 2 Previous Next 22 Replies Latest reply on May 12, 2007 1:21 PM by tamaluna

    Can't run example (JBoss Messaging 2.1)

    tamaluna

      I'm trying to make a MDB using JBoss 4.0.5.GA and JBoss Messaging 2.1. I started with the JBoss Messaging 1.2 User's Guide. First I installed the 2.1 package as per Chapter 4 "Download Software" and Chapter 5 "JBoss Messaging Non-Clustered Installation".

      At first, the validation step (5.3 "Installation Validation) failed due to some weird server behavior, so I reinstalled JBoss (to a different directory, with new JBOSS_HOME environment var). Repeated installation steps (Ch. 5), and everything worked smoothly.

      My next step was to create the MDB, as per Chapter 7.4 "Using EJB2.1 Message Driven Beans". I built my MDBExample.class and jar'd it up with my META-INF (with ejb-jar.xml and jboss.xml), and dropped it into my "messaging" server.

      The first time I tried this, it failed with the following message:

      org.jboss.deployment.DeploymentException: ejb-jar.xml must either obey the right xml schema or define a valid DOCTYPE!

      So I modified it as follows:
      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
       http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
       <display-name>MDBExampleJAR</display-name>
       <enterprise-beans>
       <message-driven>
       <ejb-name>MDBExample</ejb-name>
       <ejb-class>org.jboss.example.jms.queue.MDBExample</ejb-class>
       <transaction-type>Container</transaction-type>
       </message-driven>
       </enterprise-beans>
      </ejb-jar>

      When I ran it, I encountered the following error:
      WARN [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected for MDBExample

      org.jboss.deployment.DeploymentException: Error during topic setup; - nested throwable: (javax.management.InstanceNotFoundException: jboss.mq:service=DestinationManager is not registered.)
      at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
      etc...

      I scoured the interweb for solutions to this, but no one seems to have the answer. Isn't this supposed to work "right out of the box"? Or is there something else I'm supposed to set up. Please advise.

      TIA
      Pauly T.


        • 1. Re: Can't run example (JBoss Messaging 2.1)
          timfox

           

          jboss.mq:service=DestinationManager
          


          Tells me you are trying to deploy a jboss mq destination inside jboss messaging. This won't work.

          • 2. Re: Can't run example (JBoss Messaging 2.1)
            tamaluna

             

            jboss.mq:service=DestinationManager

            Tells me you are trying to deploy a jboss mq destination inside jboss messaging. This won't work.

            It sure would appear that way. Given that I followed the instructions in the User's Guide and used the MDB verbatim, why isn't this working?

            • 3. Re: Can't run example (JBoss Messaging 2.1)
              timfox

              As I say, you probably didn't perform the install correctly, or have subsequently deployed a service without incorrect jbossmq configuration.

              Do a text search in all *.xml files in your jboss installation for "jbossmq" to see where the offender is.

              • 4. Re: Can't run example (JBoss Messaging 2.1)
                tamaluna

                Ok, I started again from scratch. This time I did the web install of JEMS 1.2.0.GA. I selected the "all" option rather than the "default" installation. The next window in the installation shows all the components, with checkboxes next to each one to toggle their installation. Notably, jbossmq-service-ha is deselected, while jbossmq-service is selected (by default). It is noteworthy that the User's Guide does not advise on the proper JBoss setup.

                After JEMS install, there are two jar files containing the string "mq":

                jbossmq-client.jar in [JBOSS_HOME]\client\
                jbossmq.jar in [JBOSS_HOME]\server\default\lib

                After the "ant -f release-admin.xml" step (Ch5.1 of the User's Guide), there are now three jar files containing the string "mq":

                jbossmq-client.jar in [JBOSS_HOME]\client\
                jbossmq.jar in [JBOSS_HOME]\server\default\lib
                jbossmq.jar in [JBOSS_HOME]\server\messaging\lib

                When I start the "messaging" server (with my MDB present), I get the same errors I was getting before.

                You were suggesting, Tim, that I did something unusual in the installation. But I followed the instructions step by step, so I am inclined to think that the installation protocol is faulty.

                So, to get around this issue, do I only have to eliminate these "mq" jars? and/or is there some other jar I need instead?

                ~PT

                • 5. Re: Can't run example (JBoss Messaging 2.1)
                  timfox

                  You must have a service referencing "jboss.mq:service=DestinationManager" somewhere in your config otherwise you won't get that exception.

                  Without looking at your install first hand it's hard for me to diagnose what has happened.

                  And yes, it does work out of the box, we test it before each release.

                  • 6. Re: Can't run example (JBoss Messaging 2.1)
                    timfox

                    Please post your ejb.jar.xml and jboss.xml

                    • 7. Re: Can't run example (JBoss Messaging 2.1)
                      tamaluna

                      ejb-jar.xml is as above. jboss.xml is as in the User's Guide, Ch 7.4, p. 25.

                      DestinationManager appears in many files under [JBOSS_HOME], in these dir's:

                      [JBOSS_HOME]\docs\examples\jms*
                      [JBOSS_HOME]\server\default\conf
                      [JBOSS_HOME]\server\default\deploy
                      [JBOSS_HOME]\server\default\deploy\jms
                      [JBOSS_HOME]\server\messaging\conf
                      [JBOSS_HOME]\server\messaging\deploy

                      In the messaging dir's, the files are jboss-service.xml and cache-invalidation-service.xml, respectively. Do those have to be edited or something? The "messaging" server was created by the ant script; I would have expected it to take care of that sort of thing.

                      Also you mentioned jbossmq-*.jar files. Do these have something to do with the problem?

                      ~PT

                      • 8. Re: Can't run example (JBoss Messaging 2.1)
                        timfox

                        After you installed, did you successfully run the examples?

                        • 9. Re: Can't run example (JBoss Messaging 2.1)
                          tamaluna

                          I completed everything in Ch. 5, inlcuding the Queue Example (Ch. 5.3 "Installation Validation"), which worked like a charm. I haven't tried anything else in Ch. 7 other than 7.4, which is the MDB EJB2.1 example that refuses to work.

                          • 10. Re: Can't run example (JBoss Messaging 2.1)
                            timfox

                            All the examples should run after a successful install.

                            If they do not then something went wrong with the install.

                            The most common reason for this is you didn't run the release-admin.xml script over a fresh install of JBoss AS.

                            Without seeing your install is hard to see what has happened.

                            • 11. Re: Can't run example (JBoss Messaging 2.1)
                              tamaluna

                              Well, I've ant'd release-admin.xml over a fresh install twice, and I ended up with the same issue both times. So we can most likely rule that out.

                              Is there something that I could post that would help to figure this out? Right now I'm only slightly concerned with what went wrong; but I'm more interested to know what I can do to rectify this.

                              ~PT

                              • 12. Re: Can't run example (JBoss Messaging 2.1)
                                clebert.suconic

                                I just did a complete run from scratch.. and everything ran fine.


                                I - downloaded jboss-4.0.4.GA and jboss-4.0.5.GA.

                                II - unziped jboss-4.0.4.GA

                                III - set JBOSS_HOME=/myDir/jboss-4.0.4.GA

                                IV - downlaoded jboss-messaging-1.2.0.SP1 and unziped it

                                V - cd /myDir/jboss-messaging-1.2.0.SP1/util

                                VI - ant -f release-admin.xml

                                VII - cd /myDir/jboss-4.0.4.GA/bin

                                VIII - ./run.sh -c messaging

                                IX - in another window.. I defined JBOSS_HOME again and:
                                cd /mydir/jboss-messaging-1.2.0.SP1/examples/mdb

                                X - ant

                                XI -

                                [java] The example connected to JBoss Messaging version 1.2.0.sp1 (1.2)
                                [java]
                                [java] #####################
                                [java] ### SUCCESS! ###
                                [java] #####################



                                So... you are doing something wrong at your install!


                                • 13. Re: Can't run example (JBoss Messaging 2.1)
                                  clebert.suconic

                                  Make sure you are using 1.2.0.SP1 (*** Post edited.. I had a typo here ***)

                                  http://labs.jboss.com/jbossmessaging/downloads

                                  I remember one bug when running the MDB example alone, fixed on SP1:

                                  http://jira.jboss.com/jira/browse/JBMESSAGING-254

                                  • 14. Re: Can't run example (JBoss Messaging 2.1)
                                    tamaluna

                                     

                                    Make sure you are using 1.2.1.SP1

                                    I don't see 1.2.1.SP1, only 1.2.0.SP1, which I already have (jboss-messaging-1.2.0.SP1.zip).


                                    I - downloaded jboss-4.0.4.GA and jboss-4.0.5.GA.

                                    II - unziped jboss-4.0.4.GA

                                    III - set JBOSS_HOME=/myDir/jboss-4.0.4.GA
                                    ...

                                    So you didn't try it with 4.0.5.GA? Or you did them both side-by-side?

                                    [java] #####################
                                    [java] ### SUCCESS! ###
                                    [java] #####################

                                    Yes, this much works fantastic for me.

                                    So... you are doing something wrong at your install!

                                    Such as? Am I supposed to say a few Hail Mary's? ;)

                                    But seriously, could someone answer the question as to whether these jbossmq-*.jar's or DestinationManager references in the xml files should or shouldn't be there? Maybe I just need to get rid of or alter some files that are interfering?

                                    ~PT

                                    1 2 Previous Next