1 Reply Latest reply on Jul 21, 2011 1:10 PM by rafaelcba

    some examples are not copying config files during the ant deploy target

    rafaelcba

      Hello!

       

      I'm a newbie on HornetQ.

       

      I'm trying to run the javaee examples available in HornetQ 2.2.5-Final bundle but sounds like some examples are not copying the configurations files to JBossAS profiles when you invoke the Ant deploy target.

       

      I saw in hornetq-2.2.5.Final/examples/javaee/common/build.xml the copy-profile target excludes the conf files

       

       

      {code:xml}

         <target name="copy-profile" depends="profile.check" unless="donot.copy.profile">

            <property name="profile" value="${jboss.home}/server/default"/>

            <property name="example-profile" value="${jboss.home}/server/${example.name}-example-profile"/>

            <property name="deploy.dir" value="${example-profile}/deploy/"/>

            <mkdir dir="${example-profile}"/>

            <copy todir="${example-profile}">

               <fileset dir="${profile}">

                  <exclude name="**/*hornetq-configuration.xml"/>

                  <exclude name="**/*hornetq-jms.xml"/>

                  <exclude name="**/*hornetq-users.xml"/>

               </fileset>

            </copy>

         </target>

      {code}

       

      And the copy-resources target is empty to be overridden by each example, but not all do that.

       

      {code:xml}

        <!-- can be overriden if the example requires to copy resources after the

              profile is created and before the server is started -->

         <target name="copy-resources">

         </target>

      {code}

       

      The javaee mdb-bmt for example does not works properly due the its config files located in javaee/mdb-bmt/server/ are not copied to jbossas example profile create during the Ant target deploy. So when you run the example the following error occurs during jbossas startup:

       

       

      {noformat}

      java.io.FileNotFoundException: /home/myprofile/opt/jboss-eap-5.1.1/jboss-as/server/mdb-bmt-example-profile/deploy/hornetq/hornetq-configuration.xml

           at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:105)

           at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:112)

           at java.net.URL.openStream(URL.java:1010)

           at org.hornetq.core.config.impl.FileConfigu

      {noformat}

       

      Message was edited by: Rafael Soares

        • 1. Re: some examples are not copying config files during the ant deploy target
          rafaelcba

          Sorry...

           

          The problems is I'm running the examples using EAP 5.1.1 version of JBoss. The script used to configure HornetQ inside EAP is a bit different of AS 5 version. The difference is in the hornetq-2.2.5.Final/config/jboss-as-5/build.xml Ant script at target 'create-profile' that define the HQ_HOME as 'hornetq.sar'

           

          <property name="hornetq.sar.dir" value="${dest.dir}/deploy/hornetq.sar"/>

           

          But for EAP version the HQ_HOME is just 'hornetq' (jboss-as/server/default/deploy/hornetq).

           

          Another difference when you try to run HQ examples is the reference to JCA Adapter used in example src code - @ResourceAdapter("jms-ra.rar"). In JBossAS 5 version this adapter is deployed as hornetq-ra.rar. So if you run the examples code in EAP you must change this ref. to 'jms-ra.rar'.

           

          regards.