I'm using EJB 3 and JBoss AS 6.0.0.Final. I have a stateless session bean with the annotations @Stateless and @WebService. When I add the annotation @Singleton, the deployment is in error showing the message:
...name=ServiceBean, service=ejb3 is already installed
What can I do to avoid the deployment error?
You can use @WebService and @Stateless or @WebService and @Singleton in the same bean which makes perfectly sense if you want to expose a POJO as both a web service and EJB.
Don't see much sense in using @Stateless and @Singleton in the same bean. When you use @Singleton, you are creating an EJB with all the EJB capabilities (transaction management, security, etc) exactly as with @Stateless. The only difference is how the container manages the EJB lifecycle:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With