title: How to execute a jar file on jboss7 startup?
body: <p>I have a simple java class which displays "waiting" text on execution , in "TMSCore" java project.</p>
  
  <pre><code> package com.stock.bo;
  
      public class example {
  
          /**
           * @param args
           */
          public static void main(String[] args) {
              // ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
               System.out.println("================================&gt; waiting");
          }
  
      }
  </code></pre>
  
  <p>I have created TMSCore.jar and have set this example.class as entry point ,of my jar file.</p>
  
  <p>Then i have created a module for this project in C:\Jboss\jboss-as-7.1.1\modules\org\tms\main , and pasted the jar in the same path</p>
  
  <p>then i have created module.xml and pasted in the same path</p>
  
  <h1>module.xml</h1>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module xmlns="urn:jboss:module:1.1" name="org.tms"&gt;
     &lt;resources&gt;
      &lt;resource-root path="TMSCore.jar"/&gt;
     &lt;/resources&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>then i have created a jboss-deployment-structure.xml in my webproject/web-inf directory</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-deployment-structure&gt;
    &lt;deployment&gt;
      &lt;dependencies&gt;
        &lt;module name="org.tms"/&gt;
      &lt;/dependencies&gt;
    &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>when i start the server with my war containing above jboss-deployment-structure.xml, in my console its showing deployed TMSCore.jar</p>
  
  <p>but my "waiting" text in my jar is not displayed on console</p>
  
  <p>my requirement is i should get "================================> waiting" on my console once jboss is started up</p>
  
  <p>or else can any one can suggest how to make a jar to execute on starting jboss server?</p>
  
  <p>BTW i am using JBOSS7.1</p>