1 Reply Latest reply on Mar 14, 2003 6:16 PM by sczadzeck

    Executing a .jar on deployment?

    c-phi

      Hi,

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

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

      /meta-inf/Manifest.mf
      /foo/TestClass.class

      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
      -3.0.6_tomcat-4.1.18/server/default/deploy/RandomTest.jar
      13:49:15,750 INFO [MainDeployer] Deployed package: file:/D:/jboss-3.0.6_tomcat-
      4.1.18/server/default/deploy/RandomTest.jar

      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,

      Colin

        • 1. Re: Executing a .jar on deployment?
          sczadzeck

          You need to include deployment descriptor files (e.g. jboss.xml, ejb-jar.xml, etc.)in your JAR. Also, make sure they are in the \meta-inf directory. If you're new to J2EE and JBOSS you should check out the JBOSS 3.0 Getting Started guide. This should help you get off the ground.

          Good Luck,
          Scott