Found something interesting which is different in jboss 4 and 5 and which may be a clue to the problem:
I have following dependency mentioned in jboss-service.xml file of sar archive
This is what I noticed:
In Jboss 4:
[ServiceController] recording that sync:service=SyncStartup depends on jboss.j2ee:service=EjbModule,module=SynchronyEJB.jar
its remain as it is jboss.j2ee:service=EjbModule,module=MyEJB.jar
In Jboss 5:
DEBUG [org.jboss.system.ServiceController] (main) Waiting in create of sync:service=SyncStartup on jboss.j2ee:module=MYEJB.jar,service=EjbModule
It has been changed to 'jboss.j2ee:module=MyEJB.jar,service=EjbModule' - Switched places automatically.
Now the service is being created and started as jboss.j2ee:service=EjbModule,module=MyEJB.jar as mentioned in -service.xml in both Jboss 4 and 5 but in jboss 5 its being put on wait with different name.
Dependency "sync:service=SyncStartup" (should be in state "Create", but is actually in state "Configured")
Deployment "sync:service=SyncStartup" is missing the following dependencies:
Dependency "jboss.j2ee:module=MyEJB.jar,service=EjbModule" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:module=SynchronyEJB.jar,service=EjbModule' **")
Can anyone help here?
I able to resolve this by changing the dependency to one of the EJB rather than full EJB.jar.