I read Beginning Java EE 6 platform with GlassFish 3 from Antonio Goncalves.
In chapter about EJBs he wrote that some features of EJB may be deprecated in next releases of Java EE.
None of the following features is actually removed from EJB 3.1, but
the next version will have to either remove or retain some of them:
- JAX-RPC-based web service endpoints
But I not understand what he mean here. He wrote about classes annotated with @Stateless and @WebService? i.e.
@Stateless
@WebService
public class MyService {
}
So it is bad practice to annotate one class with this both annotations? It is better to separate classes? Create one to act only as EJB, and create another class to act only as as WebService (which delegates method invocation to EJB defined as class-member)?
Both
@Statelessand@WebServiceare not part of JAX-RPC. They belong to EJB3 and JAX-WS. They will not be deprecated.JAX-RPC 2.0 was renamed JAX-WS 2.0 in 2005.