how to deploy a jar in glassfish so that it gets executed

I have a simple jar file that just writes a integer to a file.
i have checked that the jar works by :
java -jar myApp.jar

I have placed the jar file [with permissions] it in the glassfish/modules folder . but it is not getting executed after i start glassfish.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pvinodpAuthor Commented:
thanks for that link. But i am using spring to call my jar..pleaase helpme to call my jar thru spring in a glassfish container.

I am pasting my jar content here for reference:

1.      $baseDir/META-INF/MANIFEST.MF:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: root
Build-Jdk: 1.6.0_33

2. $baseDir/META-INF/spring/myApp-beans.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<beans xmlns=""

   <bean id="auditExecutor" class="org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean">
      <property name="scheduledExecutorTasks">
            <ref local="auditPurgeJob"/>

   <!-- Example configuration of the AuditPurgeJob using the spring executor integration -->
   <!-- Should in theory be configured and managed via the Scheduled Job Service -->
   <bean id="auditPurgeJob" class="org.springframework.scheduling.concurrent.ScheduledExecutorTask">
      <property name="delay" value="1"/>
      <property name="period" value="3"/>
      <property name="timeUnit" value="MINUTES"/>
      <property name="runnable">
         <bean class="">

3.  $baseDir/META-INF/spring/myApp-config.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<beans xmlns=""


4.  pom.xml

<project xmlns="" xmlns:xsi=""


#Generated by Maven
#Tue Oct 15 11:33:33 IST 2013



public class App implements Runnable {

   public void run(){
      FileOutputStream out = null;

      try {
          out = new FileOutputStream("/tmp/outagain.txt");
          int c=1000;
          String suv ="suv";
          while (c > 0) {
             suv = suv+c;
             byte[] bytes = suv.getBytes("UTF-16");
      catch (IOException ioe){
      }finally {
          if (out != null) {
              try {
            } catch (IOException e) {
               // TODO Auto-generated catch block
pvinodpAuthor Commented:
I am closing the question . I am having a need to deploy the jar in a bundle format.. I got it working. THanks for your help anyways
ok :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.