13 Replies Latest reply on Jan 10, 2013 12:24 PM by jeetu

    Timer-Service does not start on JBoss AS7

    jeetu

      Hi all,

       

      I have been trying to make this timer-service work on the jboss as7 on my windows xp.

       

      I created a simple singleton bean with a simple method that has the @Schedule annotation to trigger every minute.

       

      The maven build goes fine, but when i try to deploy the war onto the as7, the deployment fails with the below message.

       

       

      INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

      JBAS014775: New missing/unsatisfied dependencies:

      service jboss.thread.executor.ejb3.my-timer (missing) dependents: [service jboss.deployment.unit."Titan.war".component.TimerEjb.ejb3.timerService]

       

      TimerEjb is the simple ejb i created. From the above, i understood that there is some capability i am missing on the Standalone-full.xml, but not sure what it is. I have the javax.ejb3 capability added into the standalone-full.xml, not sure whatelse is required for this to work. Googled a lot, but could not find anything that makes sense.

       

      Any help is greatly appreaciated.

       

      Attaching the standalone-full.xml of my AS7 server for your reference.

       

      Thanks

      Jithendra

        • 1. Re: Timer-Service does not start on JBoss AS7
          sfcoy

          Please add the full server log as an attachment.

           

          You should not need to add anything to your configuration for this to work as it is standard behaviour, even with the ordinary standalone.xml configuration.

          • 2. Re: Timer-Service does not start on JBoss AS7
            jeetu

            Thanks for looking into this Stephen. Attaching my full server log.

             

            Regards

            Jithendra

            • 3. Re: Timer-Service does not start on JBoss AS7
              sfcoy
              1. Are you using a jboss-deployment-structure.xml in Titan.war? If so, please attach it. You should not normally be seeing "JBAS018567: Deployment "deployment.Titan.war" is using a private module..." warnings in the logs.
              2. Is Titan.war using OSGI?
              3. Please show the code for your singleton Timer, or at least the annotated portions.
              4. Please show the output of tar tf Titan.war.
              • 4. Re: Timer-Service does not start on JBoss AS7
                jeetu

                Hi Stephen,

                 

                Responses corresponding to your queries.

                 

                1. The Titan.war has the jboss-deployment-structure.xml and am attaching that. I am using the maven-war-plugin to do the build.

                2. No, Titan.war does not use OSGI.

                3. Code i have for the singleton timer

                 

                      

                @Singleton

                Public class TimerEjb {

                 

                @Schedule(hour="*", minute="*")

                public void triggerCron(){

                System.out.println("Invoking Cron Trigger");

                }

                 

                }

                4. The output of the jar -tf is in the attached output.log

                 

                Thanks again.

                 

                Regards

                Jithendra

                 

                 

                • 5. Re: Timer-Service does not start on JBoss AS7
                  nickarls

                  That's a lot of jars (serveral of which shouldn't belong there)

                  • 6. Re: Timer-Service does not start on JBoss AS7
                    jeetu

                    The project is a work in progress. Cleanup is down the way! Our first project of this kind, still in the learning process. Suggestions are welcome. I am guessing the existence of the non-needed jars cause the issue that i am seeing right??

                     

                    Regards

                    Jithendra

                    • 7. Re: Timer-Service does not start on JBoss AS7
                      nickarls

                      Not guaranteed but a possibility. You could start with a minimal project containing just a war with the single @Startup @Singleton with a @Timer and see if it fires.

                      • 8. Re: Timer-Service does not start on JBoss AS7
                        jeetu

                        Hi Nicklas,

                         

                        Tried with a minimal project with only one singleton as you suggested and tried deploying that on the server. The server threw similar deployment exception below.

                         

                        13:59:46,254 INFO [org.jboss.as.server] (management-handler-thread - 7) JBAS015870: Deploy of deployment "test-timer-service.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.web.deployment.default-host./test-timer-service Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.unit.\"test-timer-service.war\".component.TimerSample.START Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.unit.\"test-timer-service.war\".jboss.security.jacc Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.unit.\"test-timer-service.war\".component.TimerSample.ejb3.timerService Missing[jboss.thread.executor.ejb3.my-timer]"]}

                         

                        My singleton looks like this.

                         

                         

                         

                        package com.clink.ejb;

                        import javax.ejb.Schedule;
                        import javax.ejb.Singleton;
                        import javax.ejb.Startup;

                        @Startup
                        @Singleton
                        public class TimerSample {

                         

                        @Schedule(hour="*", minute="*")
                        public void triggerCron(){
                          System.out.println("Trigger CRON ");
                        }

                         

                        }

                         

                         

                         

                        Regards

                        Jithendra

                        • 9. Re: Timer-Service does not start on JBoss AS7
                          jeetu

                          Hi Nicklas,

                           

                          Just to confirm, i have asked one of my mate to deploy the simple project i have created on his server. He deployed it with no issues and it worked fine. Wondering what is wrong with my server. Will try to compare the standalone-full.xml and see if he has any other capability that i dont have.

                           

                          Regards

                          Jithendra

                          • 10. Re: Timer-Service does not start on JBoss AS7
                            sfcoy

                            Jithendra,

                             

                            The general rule of thumb is that you do not deploy jars in your application that duplicates code that is present in the application server (there's exceptions, but not in your case just yet). A full JEE server provides a lot more functionality than a servlet container such as Tomcat or Jetty, where you may need to have more stuff in your WAR files.

                             

                            There is nothing useful in your jboss-deployment-structure.xml so get rid of that to begin with.

                             

                            As you appear to be building with Maven, it will be easiest to clean up your pom.xml. Therefore, if you can post that we can make some recommendations.

                            • 11. Re: Timer-Service does not start on JBoss AS7
                              jeetu

                              Stephen,

                               

                              Attaching my pom.xml. I would leave it to your able hands to suggest me what takes it to make it better.

                               

                              Regards

                              Jithendra

                              • 12. Re: Timer-Service does not start on JBoss AS7
                                nickarls

                                1. Leave org.jboss.spec.jboss-javaee-6.0 in

                                2. Comment all the other deps.

                                3. Uncomment until it compiles

                                 

                                (and even then you can check if some of the stuff can be changed to references to server-side-modules where applicable)

                                 

                                I find it hard to believe that you really reference stuff like Oracle drivers, connection pool implementations etc.

                                • 13. Re: Timer-Service does not start on JBoss AS7
                                  jeetu

                                  Thanks for the suggestions Nicklas. I will do it.

                                   

                                  I have anyway able to make the timer service working by just blowing away my standalone-full.xml and replaced it with the original version without any of my configuration changes and it started working fine. Then i added my changes and it all gels well now.

                                   

                                  If i now compare the working version with the version i had problems with, there is not much of a difference. Wierd!!

                                   

                                  Anyways thanks for all the time.

                                   

                                  Regards

                                  Jithendra