7 Replies Latest reply on Nov 27, 2002 3:52 PM by Greg Turner

    HOWTO deploy Session Bean and MDB without Xdoclet

    koltar Newbie

      I have had alot of problems trying to use the ant script and xdoclet to deploy a new EJB thats not part of the TestSessions in the templates. I think I am going at this the from the wrong direction. I really need to understand the JBoss server before using any fancy tools that are hard to use.

      Can anyone tell me a step by step HOWTO deploy a Session Bean and Message Driven Bean on JBoss. Where do the files go, I know how to write the Java but getting the configurations working on JBoss is a major headache.

      Does anyone have an example I just jar, ear or war up and drop in deploy with an explanation of each xml file? Or point me to documentation that explains how this works in Jboss? I was able to war up a JSP project from tomcat and it worked beautifully by dropping it in deploy. I would love to be able to do that with EJB's but I'm not understanding how these xml files work it seems like to get one JNDI item to work there are 6 different files to touch. Modifying the xdoclet tags are not producing xml entries with the new META-INF xml files, so I just want to learn the basics of JBoss and drop Xdoclet.

      Any examples would be greatly appreciated!

        • 1. Re: HOWTO deploy Session Bean and MDB without Xdoclet
          Greg Turner Apprentice

          OK. Here is the hot scoop. Since I don't believe in rewriting the wheel, this hot scoop refers you to places to find out what you need.

          Now, the various war, ear, jar files are to be copied to the deploy directory to get JBoss to deploy them.

          The various war, ear, and jar files have various formats specific to each type. Info about this can be found here:
          In reading this, keep in mind what is specific to J2EE in general and what is specifc to the vendor implementation of J2EE.

          The thing to remember about these files is that for JBoss specifc info, you usually put a jboss specific xml descriptor in the file along side the J2EE descriptor.

          Review the various free JBoss docs for info on the JBoss descriptors.

          That's it from a high level perspective. If you do the homework of reading the docs, you can do it. That is what is expected when you work with free software.

          The alternative is to pay someone to do it for you.

          • 2. Re: HOWTO deploy Session Bean and MDB without Xdoclet
            koltar Newbie

            Alot of sarcasm loaded in that answer, not sure why you answer questions in the newbie corner. Its not titled the Expert Corner.

            I tried your URL and get a 404. You were correct about the manual I purchased on JBoss 100% worthless a waste of time and money.

            So back to my question if someone could tell me how to deploy a Message Driven Bean and a Stateless Session bean without ANT and Xdoclet, it would be greatly appreciated.

            I don't need to know the Theories I have memorized that and I can recite it like I am an expert.

            I need to know what XML files need to be touched, I was told it was ejb-jar.xml and jboss.xml to get the MDB working from the jboss manual I purchased.

            What I don't know is how these XML files are placed on the file system before I ear, war or jar it up to drop it in the deploy directory. Or do I have to touch or move xml files into deploy that are native to jboss to get the JNDI working properly.

            1. How do I setup the ConnectionFactory in the XML so the applications can do a context lookup?
            2. How do I setup the queue/mytestQueue properly so the applications can do a context lookup?

            Thats all I need, thats it no theories no Java, all XML and "JBoss configuration"

            The other servers have GUIs that do all this work for you I can not get ant and xdoclet working so I just need to know the absolute basics of the XML "JBoss Configuration" files

            • 3. Re: HOWTO deploy Session Bean and MDB without Xdoclet
              Jean-Paul Cardier Newbie

              Hey koltar,
              I found a decent website that had a JBoss tutorial. It worked fine from work, but I'm getting some kind of redirect on it now. The website is:


              my apologies if it gives you a redirect. You will need a working version of Ant and JBoss, but that's it. I am attaching their ZIP file. Unzip it. Inside you will find a directory called anttest. Inside anttest are example1 and example2 dir's. Go to example1 and type "ant" from the command prompt. It will use the build.xml to generate the directories and class files.

              Once you've done that and run the resulting class file, go to example2. Run ant again. This time it will create an EAR file. Copy this file to your JBoss/server\deploy directory. Then start JBoss and go to http://localhost:8080/example2/

              It should be running. Hope that helps

              • 4. Re: HOWTO deploy Session Bean and MDB without Xdoclet
                Joel Vogt Master

                well hang on there was no sarcasm in the answer. His point was creating an ear file is more a j2ee beginner's corner question. It's also something that is answered probably a few 1000 times elsewhere in these forums.

                • 6. Re: HOWTO deploy Session Bean and MDB without Xdoclet
                  koltar Newbie

                  I was able to get this working and I believe Joel helped me on another post, which I was greatly appreciative of.

                  I do not agree with the methodology that if an answer has been answered a thousand times, you send the person asking the question on a wild goose chase sifting through forum posts and theory documentation to waste weeks of time to figure out things that can be answered in a setence fragement.

                  The answer to the question I had was
                  Create ejb-test.jar contents:

                  Create test.ear contents:

                  drop in server/default/deploy

                  That did not requires 3 weeks of moonlight searching through theory documentation and unrelated posts.

                  • 7. Re: HOWTO deploy Session Bean and MDB without Xdoclet
                    Greg Turner Apprentice

                    Thanks Joel. Another implication in my way of answering is this. When somebody asks me for a fish, especially a newbie, my response is usually to teach them how to fish. Some people, you give them so much gold for free and they just don't realise it.