3 Replies Latest reply on Mar 1, 2007 4:25 AM by aschulz

    Howto package datasource and MQ definitions in ear

    aschulz

      Hi,

      I would like to include my datasource (*-ds.xml) and mq (*-mq-service.xml) definitions in my ear file. Right now these files are in the deploy folder.

      What do I have to do? Build an rar/sar and package the definitions there?

      Please, can somebody provide an example.

      Thanks in advance.
      Alex

        • 1. Re: Howto package datasource and MQ definitions in ear
          peterj

          Looking at the jboss-app_4_0.dtd file, it appears that one can embed a Hibernate archive and a service within an ear file (and reference them via a jboss-app.xml file), but one cannot embed a *-ds.xml. So it looks you you will have to create a sar file, though you could possibly place only the *-ds.xml file in it and then embed the sar within the ear. I haven't tried this, but if it works, let me know.

          • 2. Re: Howto package datasource and MQ definitions in ear
            georgesberscheid

            Put a jboss-app.xml file into META-INF of your ear that looks somewhat like this:

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
            <jboss-app>
             <module>
             <service>META-INF/datasources/mysql-ds.xml</service>
             </module>
            </jboss-app>


            This will deploy your -ds.xml and -service.xml files. You will have to adjust the path to the files though, depending on where you put them inside your archive ;-)

            • 3. Re: Howto package datasource and MQ definitions in ear
              aschulz

              Thanks for your replies.

              I choose the "boss-app.xml"-alternative and it is working great.

              Alex