2 Replies Latest reply on Mar 13, 2003 5:18 AM by sanne

    How to auto start a jar?

    Colin Phillips Newbie


      I am having a problem getting a .jar file to execute a class upon deployment.

      The contents/listings of my .jar are as follows:


      Manifest.mf listing:

      Manifest-Version: 1.0
      Created-By: 1.4.1_01 (Sun Microsystems Inc.)
      Main-Class: foo.TestClass

      TestClass.java listing:

      package foo;

      public class TestClass {

      public static void main(String[] args) {
      System.out.println("TEST **** TEST");

      When I copy the .jar file to the server/default/deploy directory, the following is displayed in the console:

      13:49:15,750 INFO [MainDeployer] Starting deployment of package: file:/D:/jboss
      13:49:15,750 INFO [MainDeployer] Deployed package: file:/D:/jboss-3.0.6_tomcat-

      The main() method of TestClass is not executed. If I execute the .jar from the command line (java -jar RandomTest.jar) .. it works.

      Please help .. am I missing some JBOSS specific configuration?

      Thanks in advance,