I have a situation where my ear is deployed into weblogic server, it should automatically trigger a method based on timer control.
I have used the Timer class and scheduled methods to do. But I could not find out how to make a call to the timer function.
step 1: jar file deployed to weblogic server
step 2: immediately once the deployment is done, without any human intervention, a method needs to be called.
Is ther anyways to obtain this?
I jus tried this steps below.: using ejb3.0
1. created a bean class with the timer implemention which will trigger a method on a particular time.
2. I have a remote class for which the bean has been implemented.
3. I have a client file which will use the lookup to call the bean.
Now my question is how can i avoid the client file?? when I deploy, the bean should automatically be called somehow.
Hope am clear.
This would be a great help. I tried google.. But quite helpless.
Thanks for that. It helped me. But still i get errors in making use of it.
below is my bean
is my remote..
I dont have a client. As far i read accross, I dont need a cleint program. but the thing is I use weblogic 10.3 and I dont ve a ejb3.1.jar so I jus added ejb31-api-experimental-3.1.1.jar which i found from findjar.com and i use weblogic.jar for ejb3.0 classes.
not sure if this cud be the probelm. Can you help with that?
below is the err:
Exception preparing module: EJBModule(timerTest1) Unable to deploy EJB: timerTest1.jar from timerTest1.jar: There are 1 nested errors: weblogic.ejb.container.compliance.ComplianceException: No business interface, component interface or web service endpoint interface found for Session Bean TestTimer at weblogic.ejb.container.compliance.SessionBeanClassChecker.checkInterfacesExist(SessionBeanClassChecker.java:177) at weblogic.ejb.container.compliance.Ejb30SessionBeanClassChecker.checkInterfacesExist(Ejb30SessionBeanClassChecker.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
But i manually dragged the jars which contains javax.ejb.schedule etc.. and added it to eclipse buildpath..
will that not be suffice for it to work??
No. Just adding jars will not provide the services which the service is expected to implement. You'll have to upgrade to a version of WebLogic (or some other server) which supports EJB3.1, if you want to use this feature.