1 Reply Latest reply on Jan 13, 2011 11:04 PM by yun_man_ger

    Problem getting class from ear.

    tain

      Hi,

       

      I have such problem:

       

      I decided to use scheduler and edited scheduler-service.xml from directory jboss-5.1.0.GA/server/{project-name}/deploy/ , then wrote class implementing  import org.jboss.varia.scheduler.Schedulable interface. Firstly(from this post http://community.jboss.org/message/580355#580355), i had problem there was  java.security.InvalidParameterException: Given class xxx.SimpleSchedule is not found, i googled but nothing helped me, i was putting {project-name}.ear to deploy folder, i tried to put there {project-name}.jar too, then MAGIC IT WORKS GREAT! But i have some problems because of replication of jar(in ear it also has jar), errors with persistent:

       

      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.{project-name}",type=Component already registered.

       

      i don't know why scheduler-service.xml can't find my class, what i must do?

       

       

      <attribute name="SchedulableClass">xxx.SimpleSchedule</attribute>
      

       

      Please Help!

        • 1. Problem getting class from ear.
          yun_man_ger

          Hi, Rinat.

           

          I'm not sure, but maybe the problem in the order classes are loaded by the container. I think .ear's are loaded at the end after

          all services are up. And at the time Scheduler is loaded, your .ear and your class in it is invisible yet. And by the way there is an context issue.

           

          I think you could try, to put your Scheduler class separately in, let's say, abc.jar. And put it into jboss-5.1.0.GA/server/{project-name}/lib/ folder.

          These libraries are loaded into the container. And they are in global context.

          1 of 1 people found this helpful