"It depends" is always the best answer.
You should check the market and see what is required by the companies you would like to work for.
In our company we banned Spring over Java EE and we use EJB's in combination with CDI and JPA all the time. JAX-RS (and JAX-WS) can be done before or after learning about EJB's and JPA.