-
1. Re: Method annotated with @Schedule invoked twice in a singletone bean
sfcoy Aug 6, 2013 10:01 PM (in response to freakyprogrammer)What does your deployment look like?
Is there any chance that you're using an EAR containing EJB jar and WAR? If so, is there any chance that the WAR got a second copy of the EJB jar in it's WEB-INF/lib directory?
-
2. Re: Method annotated with @Schedule invoked twice in a singletone bean
freakyprogrammer Aug 6, 2013 10:27 PM (in response to sfcoy)Yes. Actually i am doing exactly what you mentioned in your answer by maven multi module structure. My war file has EJB jar which has JMS and Scheduling stuff as a dependency and EAR is the parent of these two files. Does that cause this issue?
-
3. Re: Method annotated with @Schedule invoked twice in a singletone bean
sfcoy Aug 6, 2013 10:42 PM (in response to freakyprogrammer)I'm concerned with the possibility that your WAR file has a copy of the EJB jar in it's WEB-INF/lib directory. EJBs in a WAR get deployed as EJBs in Java EE 6+. ie. Both the EAR and the WAR contain a copy of the EJB jar.
You need to add the EJB jar as a "provided" dependency to the WAR in a conventional multimodule EAR build.
-
4. Re: Method annotated with @Schedule invoked twice in a singletone bean
freakyprogrammer Aug 7, 2013 9:21 AM (in response to sfcoy)Stephen Coy wrote:
I'm concerned with the possibility that your WAR file has a copy of the EJB jar in it's WEB-INF/lib directory. EJBs in a WAR get deployed as EJBs in Java EE 6+. ie. Both the EAR and the WAR contain a copy of the EJB jar.
You need to add the EJB jar as a "provided" dependency to the WAR in a conventional multimodule EAR build.
Thanks stephen, this resolved my issue.